Problem
When multiple projects are indexed in the same Memgraph database, Cypher queries return results from all projects without disambiguation. The Cypher system prompt and examples do not mention filtering by project, so LLM-generated queries cannot scope results to a specific project.
This is distinct from #425 (cross-project indexing). That issue is about enabling cross-project retrieval. This issue is about the opposite: ensuring queries can be scoped to a single project when desired.
Current Behavior
A query like "show all classes" returns classes from every indexed project. The user has no way to scope queries to the project they are working on.
Expected Behavior
- The Cypher system prompt should include the current project name as context
- Query examples should demonstrate project-scoped patterns (e.g.,
MATCH (p:Project {name: $project})-[:CONTAINS_PACKAGE*]->...)
- The query tool should automatically inject the project scope when a single project is being queried
Affected Components
codebase_rag/prompts.py (CYPHER_SYSTEM_PROMPT, LOCAL_CYPHER_SYSTEM_PROMPT)
codebase_rag/tools/codebase_query.py (query execution)
codebase_rag/cypher_queries.py (example queries)
Problem
When multiple projects are indexed in the same Memgraph database, Cypher queries return results from all projects without disambiguation. The Cypher system prompt and examples do not mention filtering by project, so LLM-generated queries cannot scope results to a specific project.
This is distinct from #425 (cross-project indexing). That issue is about enabling cross-project retrieval. This issue is about the opposite: ensuring queries can be scoped to a single project when desired.
Current Behavior
A query like "show all classes" returns classes from every indexed project. The user has no way to scope queries to the project they are working on.
Expected Behavior
MATCH (p:Project {name: $project})-[:CONTAINS_PACKAGE*]->...)Affected Components
codebase_rag/prompts.py(CYPHER_SYSTEM_PROMPT, LOCAL_CYPHER_SYSTEM_PROMPT)codebase_rag/tools/codebase_query.py(query execution)codebase_rag/cypher_queries.py(example queries)