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 (1536 for OpenAI).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.xata.ts
or xata.js
file that defines the client you can use to interact with the database. See the Xata getting started docs for more details on using the Xata JavaScript/TypeScript SDK.
VectorDBQAChain
to search the documents stored in Xata and then pass them as context to the OpenAI model, in order to answer the question asked by the user.
author
column of type String to the vectors
table in Xata.