Open AMasetti opened 1 day ago
Hey @AMasetti! 👋 I'm here to help you with your bug and answer any questions you have. Let's squash this bug together!
The issue you're encountering with using document_id
as a metadata key in the Postgres Vector Store of LlamaIndex seems to be related to how certain metadata keys are handled internally. While there isn't specific documentation or comments in the codebase that mention document_id
as a reserved key, the library does have special handling for certain metadata keys, which might be causing this behavior [1][2][3].
The suggested fix to document any reserved metadata keys and potentially add warnings or errors when such keys are used is a good approach. This would help prevent silent failures and make debugging easier. In the meantime, using a different key name for your metadata should resolve the issue, as you've already observed.
If you need further assistance or a workaround, consider renaming the document_id
key to something else that doesn't conflict with the library's internal handling.
To continue talking to Dosu, mention @dosu.
@dosu Good catch, the reference [3] also points to reserved keys that fail silently doc_id
and response
It's great that you found the reference to other reserved keys like doc_id
and response
. This highlights the importance of documenting these reserved keys to avoid silent failures. If you encounter any more issues or need further clarification, feel free to ask. Meanwhile, using alternative key names should help you avoid these conflicts. If there's anything else you need, just let me know!
To continue talking to Dosu, mention @dosu.
Bug Description
Using document_id as a metadata key seems to be reserved and leads to unexpected behavior, as queries to the index return an empty list of nodes. This issue is not documented in the Postgres Vector Store documentation, making it difficult to debug.
Version
0.11.23
Steps to Reproduce
Create a Postgres index with metadata that includes the key document_id. Attempt to query the index. Observe that the query returns an empty list of nodes. Change the metadata key from document_id to a different key (e.g., camelCase or snake_case). Observe that the query now works as expected.
Expected Behavior
Using document_id as a metadata key should either:
Work like any other metadata key, or Be explicitly documented as reserved to prevent its use waring the user.
Actual Behavior
Queries fail silently when document_id is used as a metadata key, returning an empty list of nodes.
Suggested Fix
Clearly document any reserved metadata keys in the Postgres Vector Store documentation. Optionally, add a warning or error when reserved keys are used.
Environment
Library version: 0.11.23 Database: Postgres Language: Python
Relevant Logs/Tracbacks
No response