Update vector query methods to support ID filtering in PostgreSQL

- Modified `mix_kg_vector_query` in operate.py to pass optional IDs to vector search
- Updated PostgreSQL SQL template to filter results using document IDs instead of chunk_id
- Improved query flexibility by allowing precise document selection during vector search
This commit is contained in:
Roy
2025-03-08 20:25:20 +00:00
parent 528fb11364
commit e31c0c8f6c
2 changed files with 3 additions and 2 deletions

View File

@@ -892,7 +892,8 @@ async def mix_kg_vector_query(
try:
# Reduce top_k for vector search in hybrid mode since we have structured information from KG
mix_topk = min(10, query_param.top_k)
results = await chunks_vdb.query(augmented_query, top_k=mix_topk)
# TODO: add ids to the query
results = await chunks_vdb.query(augmented_query, top_k=mix_topk, ids = query_param.ids)
if not results:
return None