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:
2025-12-28 17:19:20 +01:00
co-authored by Claude Opus 4.5
parent ab892745fa
commit 1f47b052d8
9 changed files with 533 additions and 104 deletions
+5 -2
View File
@@ -12,7 +12,8 @@ from src.models.consolidation import ConsolidationRequest, ConsolidationResponse
from src.services.consolidation_service import ConsolidationService
from src.core.dependencies import (
Neo4jDep, OllamaDep, WikiJSDep,
verify_api_key, get_settings, get_ingestion_service
verify_api_key, get_settings, get_ingestion_service,
get_volatile_cache_service, get_settings_client,
)
from src.config import Settings
@@ -34,7 +35,9 @@ def get_consolidation_service(
ollama=ollama_client,
wiki=wiki_client,
settings=settings,
ingestion_service=get_ingestion_service()
ingestion_service=get_ingestion_service(),
volatile_service=get_volatile_cache_service(),
settings_client=get_settings_client(),
)