Discovery
Issues #2059 and #2056 (Neural Mesh RAG Phase 3) are closed, but RAGService._mesh_retriever is never assigned in any non-test production code path. The mesh_retriever_enabled config flag defaults to False, so even if a NeuralMeshRetriever instance existed, it would not be used.
Evidence
rag_service.py:71 — field defaults to None and is never set outside tests:
self._mesh_retriever: Optional[Any] = None
# "set externally when Phase 3 is active" — but nothing sets it
rag_service.py:616 — guarded by two conditions, both always False in production:
if self.config.mesh_retriever_enabled and self._mesh_retriever is not None:
return await self._run_mesh_retriever(query, max_results)
Grep result for _mesh_retriever = across all non-test Python files:
(empty — only test files assign it)
rag_config.py:61:
mesh_retriever_enabled: bool = False # never flipped to True in production
The only non-test reference is services/neural_mesh/query_decomposer.py:102:
self.mesh_retriever = mesh_retriever # different attribute, different class
Impact
NeuralMeshRetriever service exists with tests but is never called in production
- The entire Neural Mesh RAG Phase 3 retrieval path is dead code
- RAG always falls through to
AdvancedRAGOptimizer regardless of config
mesh_retriever_enabled in RAGConfig / GET /api/rag/config response is misleading — turning it on does nothing
Fix Options
- Wire it up: Find where
NeuralMeshRetriever is instantiated and inject it into RAGService._mesh_retriever during app startup (in the relevant API startup/lifespan handler)
- Remove it: If Phase 3 was abandoned, remove
_mesh_retriever, _run_mesh_retriever(), mesh_retriever_enabled, and the mesh test file — clean dead code
Needs investigation to determine which path is correct.
Affected Files
autobot-backend/services/rag_service.py — _mesh_retriever field + _run_mesh_retriever()
autobot-backend/services/rag_config.py — mesh_retriever_enabled
autobot-backend/services/neural_mesh/ — NeuralMeshRetriever implementation (check if still intended)
Discovery
Issues #2059 and #2056 (Neural Mesh RAG Phase 3) are closed, but
RAGService._mesh_retrieveris never assigned in any non-test production code path. Themesh_retriever_enabledconfig flag defaults toFalse, so even if aNeuralMeshRetrieverinstance existed, it would not be used.Evidence
rag_service.py:71— field defaults to None and is never set outside tests:rag_service.py:616— guarded by two conditions, both always False in production:Grep result for
_mesh_retriever =across all non-test Python files:rag_config.py:61:The only non-test reference is
services/neural_mesh/query_decomposer.py:102:Impact
NeuralMeshRetrieverservice exists with tests but is never called in productionAdvancedRAGOptimizerregardless of configmesh_retriever_enabledinRAGConfig/GET /api/rag/configresponse is misleading — turning it on does nothingFix Options
NeuralMeshRetrieveris instantiated and inject it intoRAGService._mesh_retrieverduring app startup (in the relevant API startup/lifespan handler)_mesh_retriever,_run_mesh_retriever(),mesh_retriever_enabled, and the mesh test file — clean dead codeNeeds investigation to determine which path is correct.
Affected Files
autobot-backend/services/rag_service.py—_mesh_retrieverfield +_run_mesh_retriever()autobot-backend/services/rag_config.py—mesh_retriever_enabledautobot-backend/services/neural_mesh/—NeuralMeshRetrieverimplementation (check if still intended)