Check here to get or create a PAT.Dependencies# Install required dependenciespip install clarifaiImportsHere we will be setting the personal access token. You can find your PAT under settings/security on the platform.# Please login and get your API key from  https://clarifai.com/settings/securityfrom getpass import getpassCLARIFAI_PAT = getpass()     ¬∑¬∑¬∑¬∑¬∑¬∑¬∑¬∑# Import the required modulesfrom langchain.text_splitter import CharacterTextSplitterfrom langchain.document_loaders import TextLoaderfrom langchain.vectorstores import ClarifaiSetupSetup the user id and app id where the text data will be uploaded. Note: when creating that application please select an appropriate base workflow for indexing your text documents such as the Language-Understanding workflow.You will have to first create an account on Clarifai and then create an application.USER_ID = "USERNAME_ID"APP_ID = "APPLICATION_ID"NUMBER_OF_DOCS = 4From Texts‚ÄãCreate a Clarifai vectorstore from a list of texts. This section will upload each text with its respective metadata to a Clarifai Application. The Clarifai Application can then be used for semantic search to find relevant texts.texts = [    "I really enjoy spending time with you",    "I hate spending time with my dog",    "I want to go for a run",    "I went to the movies yesterday",    "I love playing soccer with my friends",]metadatas = [{"id": i, "text": text, "source": "book 1", "category": ["books", "modern"]} for i, text in enumerate(texts)]clarifai_vector_db = Clarifai.from_texts(    user_id=USER_ID,    app_id=APP_ID,    texts=texts,    pat=CLARIFAI_PAT,    number_of_docs=NUMBER_OF_DOCS,    metadatas=metadatas,)docs = clarifai_vector_db.similarity_search("I would love to see you")docs    [Document(page_content='I really enjoy spending time with you', metadata={'text': 'I really enjoy spending time with you', 'id': 0.0, 'source': 'book 1', 'category': ['books', 'modern']}),     Document(page_content='I went to the movies yesterday',
Clarifai is an AI Platform that provides the full AI lifecycle ranging from data exploration, data labeling, model training, evaluation, and inference. A Clarifai application can be used as a vector database after uploading inputs.
Clarifai is an AI Platform that provides the full AI lifecycle ranging from data exploration, data labeling, model training, evaluation, and inference. A Clarifai application can be used as a vector database after uploading inputs. ->: Check here to get or create a PAT.Dependencies# Install required dependenciespip install clarifaiImportsHere we will be setting the personal access token. You can find your PAT under settings/security on the platform.# Please login and get your API key from  https://clarifai.com/settings/securityfrom getpass import getpassCLARIFAI_PAT = getpass()     ¬∑¬∑¬∑¬∑¬∑¬∑¬∑¬∑# Import the required modulesfrom langchain.text_splitter import CharacterTextSplitterfrom langchain.document_loaders import TextLoaderfrom langchain.vectorstores import ClarifaiSetupSetup the user id and app id where the text data will be uploaded. Note: when creating that application please select an appropriate base workflow for indexing your text documents such as the Language-Understanding workflow.You will have to first create an account on Clarifai and then create an application.USER_ID = "USERNAME_ID"APP_ID = "APPLICATION_ID"NUMBER_OF_DOCS = 4From Texts‚ÄãCreate a Clarifai vectorstore from a list of texts. This section will upload each text with its respective metadata to a Clarifai Application. The Clarifai Application can then be used for semantic search to find relevant texts.texts = [    "I really enjoy spending time with you",    "I hate spending time with my dog",    "I want to go for a run",    "I went to the movies yesterday",    "I love playing soccer with my friends",]metadatas = [{"id": i, "text": text, "source": "book 1", "category": ["books", "modern"]} for i, text in enumerate(texts)]clarifai_vector_db = Clarifai.from_texts(    user_id=USER_ID,    app_id=APP_ID,    texts=texts,    pat=CLARIFAI_PAT,    number_of_docs=NUMBER_OF_DOCS,    metadatas=metadatas,)docs = clarifai_vector_db.similarity_search("I would love to see you")docs    [Document(page_content='I really enjoy spending time with you', metadata={'text': 'I really enjoy spending time with you', 'id': 0.0, 'source': 'book 1', 'category': ['books', 'modern']}),     Document(page_content='I went to the movies yesterday',