feat: add unified memory routing to consolidation service
- Add MemoryRouteClassification and MemoryRoutingResult models - Implement unified classifier (_classify_web_results_unified) that routes web results to: wiki, volatile, file (Paperless), prefetch, or skip - Add routing methods: _route_to_volatile, _route_to_files, _register_prefetch - Update _process_search to use unified classifier instead of separate analysis - Add get_volatile_cache_service factory to dependencies - Wire volatile_service and settings_client into ConsolidationService - Update ConsolidationResult/Response with new routing counters Test fixes: - Fix WikiJSClient fixtures to use api_token instead of username/password - Fix entity linking test assertions to expect full user-namespaced paths - Add sample_unified_classification fixture for new classifier format 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -597,7 +597,9 @@ def get_consolidation_service() -> "ConsolidationService":
|
||||
ollama=get_ollama_client(),
|
||||
wiki=get_wikijs_client(),
|
||||
settings=get_settings(),
|
||||
ingestion_service=get_ingestion_service()
|
||||
ingestion_service=get_ingestion_service(),
|
||||
volatile_service=get_volatile_cache_service(),
|
||||
settings_client=get_settings_client(),
|
||||
)
|
||||
|
||||
|
||||
@@ -638,6 +640,17 @@ def get_rag_search_service() -> "RAGSearchService":
|
||||
)
|
||||
|
||||
|
||||
@lru_cache
|
||||
def get_volatile_cache_service() -> "VolatileCacheService":
|
||||
"""Get VolatileCacheService singleton."""
|
||||
from src.services.volatile_service import VolatileCacheService
|
||||
return VolatileCacheService(
|
||||
qdrant_client=get_qdrant_client(),
|
||||
ollama_client=get_ollama_client(),
|
||||
settings=get_settings()
|
||||
)
|
||||
|
||||
|
||||
# Authentication
|
||||
from fastapi import Security, HTTPException
|
||||
from fastapi.security import HTTPBearer
|
||||
|
||||
Reference in New Issue
Block a user