Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix: pgvector metadata filter (#16688)

kenwoodjwa11335669533
diff --git a/api/core/rag/datasource/vdb/pgvector/pgvector.py b/api/core/rag/datasource/vdb/pgvector/pgvector.py
index 783ad93b0c2..7c0d36ebe0f 100644
--- a/api/core/rag/datasource/vdb/pgvector/pgvector.py
+++ b/api/core/rag/datasource/vdb/pgvector/pgvector.py
@@ -177,7 +177,7 @@ class PGVector(BaseVector):
where_clause = ""
if document_ids_filter:
document_ids = ", ".join(f"'{id}'" for id in document_ids_filter)
- where_clause = f" WHERE metadata->>'document_id' in ({document_ids}) "
+ where_clause = f" WHERE meta->>'document_id' in ({document_ids}) "
with self._get_cursor() as cur:
cur.execute(
@@ -205,7 +205,7 @@ class PGVector(BaseVector):
where_clause = ""
if document_ids_filter:
document_ids = ", ".join(f"'{id}'" for id in document_ids_filter)
- where_clause = f" AND metadata->>'document_id' in ({document_ids}) "
+ where_clause = f" AND meta->>'document_id' in ({document_ids}) "
if self.pg_bigm:
cur.execute("SET pg_bigm.similarity_limit TO 0.000001")
cur.execute(