Xata is a serverless data platform, based on PostgreSQL. It provides a Python SDK for interacting with your database, and a UI for managing your data. Xata has a native vector type, which can be added to any table, and supports similarity search. LangChain inserts vectors directly to Xata, and queries it for the nearest neighbors of a given vector, so that you can use all the LangChain Embeddings integrations with Xata.This notebook guides you how to use Xata as a VectorStore.
langchain
.
Create a table, again you can name it anything, but we will use vectors
. Add the following columns via the UI:
content
of type “Text”. This is used to store the Document.pageContent
values.embedding
of type “Vector”. Use the dimension used by the model you plan to use. In this notebook we use OpenAI embeddings, which have 1536 dimensions.source
of type “Text”. This is used as a metadata column by this example.Document.metadata
object. For example, if in the Document.metadata
object you have a title
property, you can create a title
column in the table and it will be populated.https://demo-uni3q8.eu-west-1.xata.sh/db/langchain
.