You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently LightRAG has no metadata filtering in the retrieval path. QueryParam has no filter field, and all vdb.query() calls pass only query + top_k + query_embedding. Users cannot restrict retrieval to specific documents, file types, date ranges, or custom tags.
Additionally, chunks carry very sparse metadata (TextChunkSchema only has tokens, content, full_doc_id, chunk_order_index) — no file_path, source, or arbitrary user metadata is stored as a queryable field on vector records.
Proposed Feature
Persist metadata on chunks/entities/relations — extend the ingestion pipeline to store user-provided metadata (e.g. file_path, doc_type, tags, date) as payload fields in the vector DB.
Add a metadata_filter parameter to QueryParam — allow users to pass filter conditions (e.g. {"file_path": {"$contains": "2024"}} or {"tags": {"$in": ["finance"]}}).
Thread the filter through vdb.query() — native backends (Qdrant Filter, Milvus expr, PostgreSQL WHERE) already support filtering; in-memory/FAISS backends would use post-filtering.
Use Cases
Multi-tenant: restrict retrieval to a specific user or workspace subset
Time-scoped queries: only search documents from a specific date range
Document-type filtering: search only PDFs, only meeting notes, etc.
Custom tags: user-defined labels on documents at ingestion time
Current Workaround
None — users must maintain separate LightRAG instances per filter dimension, which is wasteful.
Question
Is this on the roadmap? Would a PR adding metadata filtering (starting with Qdrant + PostgreSQL backends) be welcome?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Problem
Currently LightRAG has no metadata filtering in the retrieval path.
QueryParamhas no filter field, and allvdb.query()calls pass onlyquery+top_k+query_embedding. Users cannot restrict retrieval to specific documents, file types, date ranges, or custom tags.Additionally, chunks carry very sparse metadata (
TextChunkSchemaonly hastokens,content,full_doc_id,chunk_order_index) — nofile_path,source, or arbitrary user metadata is stored as a queryable field on vector records.Proposed Feature
Persist metadata on chunks/entities/relations — extend the ingestion pipeline to store user-provided metadata (e.g.
file_path,doc_type,tags,date) as payload fields in the vector DB.Add a
metadata_filterparameter toQueryParam— allow users to pass filter conditions (e.g.{"file_path": {"$contains": "2024"}}or{"tags": {"$in": ["finance"]}}).Thread the filter through
vdb.query()— native backends (QdrantFilter, Milvusexpr, PostgreSQLWHERE) already support filtering; in-memory/FAISS backends would use post-filtering.Use Cases
Current Workaround
None — users must maintain separate LightRAG instances per filter dimension, which is wasteful.
Question
Is this on the roadmap? Would a PR adding metadata filtering (starting with Qdrant + PostgreSQL backends) be welcome?
All reactions