[GH-ISSUE #1858] [FEAT]: Implement metadata-based filtering of documents for RAG #1207

Closed
opened 2026-02-22 18:23:42 -05:00 by yindo · 2 comments
Owner

Originally created by @chewjh1234 on GitHub (Jul 11, 2024).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/1858

What would you like to see?

Currently, AnythingLLM's RAG system retrieves documents based solely on content similarity, and does not have filtering capabilities in its RAG system.
To improve retrieval relevance and support use cases involving time-sensitive documents or specific metadata attributes, I propose implementing metadata-based filtering capabilities for the RAG system.

Key benefits:

  • Enable time-based filtering for up-to-date information retrieval
  • Improve relevance by considering document attributes beyond content
  • Support use cases like summarization of specific document types or date ranges

Proposed functionality:

  1. Allow users to specify metadata filters when querying the RAG system
  2. Integrate metadata filtering with vector search to combine content and attribute-based relevance
  3. Support filtering on common metadata fields like date, document type, author, etc.

I learnt that Weaviate leverages an inverted index alongside the vector index to create an allow-list of eligible candidates before performing the vector search. Pinecone also allows for metadata filtering to be applied before vector searching, which can improve query performance.

I would really appreciate this feature as it would significantly enhance AnythingLLM's RAG capabilities, allowing users to more effectively narrow down relevant information and improve the accuracy of AI-generated responses.

Originally created by @chewjh1234 on GitHub (Jul 11, 2024). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/1858 ### What would you like to see? Currently, AnythingLLM's RAG system retrieves documents based solely on content similarity, and does not have filtering capabilities in its RAG system. To improve retrieval relevance and support use cases involving time-sensitive documents or specific metadata attributes, I propose implementing metadata-based filtering capabilities for the RAG system. Key benefits: * Enable time-based filtering for up-to-date information retrieval * Improve relevance by considering document attributes beyond content * Support use cases like summarization of specific document types or date ranges Proposed functionality: 1. Allow users to specify metadata filters when querying the RAG system 2. Integrate metadata filtering with vector search to combine content and attribute-based relevance 3. Support filtering on common metadata fields like date, document type, author, etc. I learnt that Weaviate leverages an inverted index alongside the vector index to create an allow-list of eligible candidates before performing the vector search. Pinecone also allows for metadata filtering to be applied before vector searching, which can improve query performance. I would really appreciate this feature as it would significantly enhance AnythingLLM's RAG capabilities, allowing users to more effectively narrow down relevant information and improve the accuracy of AI-generated responses.
yindo added the enhancementfeature request labels 2026-02-22 18:23:42 -05:00
yindo closed this issue 2026-02-22 18:23:42 -05:00
Author
Owner

@scottybo commented on GitHub (Dec 12, 2024):

This would be amazing! My use case would be filtering results prior to doing the vector search on the remaining cohort

@scottybo commented on GitHub (Dec 12, 2024): This would be amazing! My use case would be filtering results prior to doing the vector search on the remaining cohort
Author
Owner

@cwill-dev commented on GitHub (Jan 7, 2025):

Agreed, this would be a significant value-add for my business. We have several product lines with similar names, which often causes issues when embedding content. It would be ideal if we could add a metadata field for ‘product name’ that the LLM could dynamically determine based on the user query. This would allow the model to prefilter the documents and return more relevant results.

@cwill-dev commented on GitHub (Jan 7, 2025): Agreed, this would be a significant value-add for my business. We have several product lines with similar names, which often causes issues when embedding content. It would be ideal if we could add a metadata field for ‘product name’ that the LLM could dynamically determine based on the user query. This would allow the model to prefilter the documents and return more relevant results.
yindo changed title from [FEAT]: Implement metadata-based filtering of documents for RAG to [GH-ISSUE #1858] [FEAT]: Implement metadata-based filtering of documents for RAG 2026-06-05 14:39:32 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#1207