Replies: 1 comment 6 replies
-
To add an additional field in metadata while processing/storing embeddings in a vector database using pgvector and filter documents using metadata, you can follow these steps:
This example demonstrates how to create a table with metadata, add texts with metadata, and filter documents using metadata in a vector database using pgvector. For more advanced usage, such as creating a vector store with custom metadata columns and filtering documents based on metadata, you can refer to the LangChain integration with pgvector. Here is an example of how to create a collection with custom metadata fields and filter documents:
This example shows how to create a PGVector collection with custom metadata fields, add texts with metadata, and filter documents using metadata in a vector database using LangChain's integration with pgvector [1][2][3][4][5]. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Checked other resources
Commit to Help
Example Code
Description
How to add additional field in metadata in pgvector while processing/storing embedding in vector database and filter document using metadata,
currently I am getting metadata as :
{
"page": 2,
"Title": "Code of Conduct Policy",
"source": "/home/temp/CustomBot/media/dkgagavza@gmail.comknnjjnnnnnnnnnnn/Code of Conduct Policy.pdf",
"Creator": "Pages",
"ModDate": "D:20230119063429Z00'00'",
"Producer": "macOS Version 11.6 (Build 20G165) Quartz PDFContext",
"file_path": "/home/temp/CustomBot/media/dkagvagzaz@gmail.comknnjjnnnnnnnnnnn/Code of Conduct Policy.pdf",
"total_pages": 16,
"CreationDate": "D:20230119063429Z00'00'"
}
System Info
langchain==0.2.11
langchain-anthropic==0.1.22
langchain-community==0.2.10
langchain-core==0.2.26
langchain-openai==0.0.5
langchain-qdrant==0.1.3
langchain-text-splitters==0.2.2
langchain-weaviate==0.0.2
langchainhub==0.1.14
Linux
Python 3.12.4
Beta Was this translation helpful? Give feedback.
All reactions