Problem
In codebase_rag/tools/semantic_search.py, the semantic_code_search() function creates a new MemgraphIngestor context manager on every call rather than reusing the existing ingestor connection that the orchestrator already has. This adds unnecessary connection overhead per semantic search invocation.
Additionally, the code calls the private method ingestor._execute_query() directly instead of using the public fetch_all() API, which bypasses the public interface contract.
Expected Behavior
- Reuse the existing Memgraph connection/ingestor instance instead of creating a new one per search call
- Use the public
fetch_all() method instead of the private _execute_query()
Affected Files
codebase_rag/tools/semantic_search.py (lines 39-46)
Problem
In
codebase_rag/tools/semantic_search.py, thesemantic_code_search()function creates a newMemgraphIngestorcontext manager on every call rather than reusing the existing ingestor connection that the orchestrator already has. This adds unnecessary connection overhead per semantic search invocation.Additionally, the code calls the private method
ingestor._execute_query()directly instead of using the publicfetch_all()API, which bypasses the public interface contract.Expected Behavior
fetch_all()method instead of the private_execute_query()Affected Files
codebase_rag/tools/semantic_search.py(lines 39-46)