Find answers from the community

Updated 2 months ago

How to Index Postgres Vector Database Based on Metadata Keys

At a glance
The community member is using a Postgres database with a VectorStoreIndex and adding metadata to each node. They need to filter the nodes based on two keys in the metadata, "book" and "page". The community member is asking how to tell LlamaIndex to index the database based on these metadata keys, or if they need to index the database manually. A comment from another community member suggests that the community member would need to index the column manually.
Vector DB indexing question:
I am inserting nodes into VectorStoreIndex, and adding metadata to each node. Every time I am doing a RAG operation on the query engine, I will need to filter out each node based on 2 keys within the metadata.
Eg: the meta data will be
Plain Text
{"book": <str>, "page": <int>}

My Vector database is Postgres which allows for JSON indexing based on keys within a JSONField.
How can I tell LlamaIndex to index my db based on my metadata keys, or will I need to index the DB manually?
L
1 comment
I think you'd need to index the column manually
Add a reply
Sign up and join the conversation on Discord