From 0ba3b651726a4996ab398c4280712a5e145f48a3 Mon Sep 17 00:00:00 2001 From: portwebdesign Date: Sat, 7 Feb 2026 03:51:33 +0300 Subject: [PATCH 1/2] fix: tighten embeddings query prefix --- codebase_rag/constants.py | 7 ++++--- codebase_rag/graph_updater.py | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/codebase_rag/constants.py b/codebase_rag/constants.py index 4ef971d8a..fb3dc3837 100644 --- a/codebase_rag/constants.py +++ b/codebase_rag/constants.py @@ -420,10 +420,11 @@ class RelationshipType(StrEnum): CYPHER_QUERY_EMBEDDINGS = """ MATCH (m:Module)-[:DEFINES]->(n) WHERE (n:Function OR n:Method) - AND m.qualified_name STARTS WITH $project_name + '.' + AND (m.qualified_name = $project_name + OR m.qualified_name STARTS WITH $project_name + '.') RETURN id(n) AS node_id, n.qualified_name AS qualified_name, - n.start_line AS start_line, n.end_line AS end_line, - m.path AS path + n.start_line AS start_line, n.end_line AS end_line, + m.path AS path """ diff --git a/codebase_rag/graph_updater.py b/codebase_rag/graph_updater.py index 2620d2bcb..50141f10a 100644 --- a/codebase_rag/graph_updater.py +++ b/codebase_rag/graph_updater.py @@ -368,8 +368,9 @@ def _generate_semantic_embeddings(self) -> None: logger.info(ls.PASS_4_EMBEDDINGS) + project_name = str(self.project_name).rstrip(".") results = self.ingestor.fetch_all( - cs.CYPHER_QUERY_EMBEDDINGS, {"project_name": self.project_name + "."} + cs.CYPHER_QUERY_EMBEDDINGS, {"project_name": project_name} ) if not results: From 837054577768c962b113012b3c41ef76c357d48f Mon Sep 17 00:00:00 2001 From: portwebdesign Date: Sun, 8 Feb 2026 13:43:24 +0300 Subject: [PATCH 2/2] fix: correct embeddings query prefix concat --- codebase_rag/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codebase_rag/constants.py b/codebase_rag/constants.py index fb3dc3837..c54d0267d 100644 --- a/codebase_rag/constants.py +++ b/codebase_rag/constants.py @@ -421,7 +421,7 @@ class RelationshipType(StrEnum): MATCH (m:Module)-[:DEFINES]->(n) WHERE (n:Function OR n:Method) AND (m.qualified_name = $project_name - OR m.qualified_name STARTS WITH $project_name + '.') + OR m.qualified_name STARTS WITH ($project_name + '.')) RETURN id(n) AS node_id, n.qualified_name AS qualified_name, n.start_line AS start_line, n.end_line AS end_line, m.path AS path