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.This notebook shows how to use functionality related to the
Clarifai vector database. Examples are shown to demonstrate text semantic search capabilities. Clarifai also supports semantic search with images, video frames, and localized search (see Rank) and attribute search (see Filter).
To use Clarifai, you must have an account and a Personal Access Token (PAT) key.
Check here to get or create a PAT.
Dependencies
Imports
Here we will be setting the personal access token. You can find your PAT under settings/security on the platform.Setup
Setup 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.From 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.From Documents
Create a Clarifai vectorstore from a list of Documents. This section will upload each document with its respective metadata to a Clarifai Application. The Clarifai Application can then be used for semantic search to find relevant documents.From existing App
Within Clarifai we have great tools for adding data to applications (essentially projects) via API or UI. Most users will already have done that before interacting with LangChain so this example will use the data in an existing app to perform searches. Check out our API docs and UI docs. The Clarifai Application can then be used for semantic search to find relevant documents.Connect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.