Add AI Council architecture: Tier 2/3/Graph implementation + Integration Plan

Architecture (Agent 1):
- hermes_memory/tier2/{schema,facts,entities,relations,timeline}.py
- hermes_memory/tier3/{backend,chroma_backend,embedder}.py
- hermes_memory/graph/nx_store.py
- hermes_memory/api/memory_api.py (unified API)
- hermes_memory/cron/{consolidate,embed_queue,graph_refresh,prune}.py
- hermes_memory/config.py + pyproject.toml

Integration Plan (Agent 3):
- INTEGRATION_PLAN.md: Memory Provider Plugin strategy
- Hermes Core needs minimal changes
- sync_turn() + prefetch() hooks
- Skills integration via nextlevel_search/remember

Auto-Extraction (Agent 2):
- ARCHITECTURE.md: Full extraction pipeline docs
- Chunking, Pre-Filter, LLM Prompts, Classification
- Entity-Linking, Temporal Reasoning, Deduplication

All files: Python syntax checked, ECC standards applied.
This commit is contained in:
Florian Hartmann
2026-06-03 22:51:50 +00:00
parent 33fb180855
commit b83546d833
25 changed files with 2661 additions and 0 deletions
+69
View File
@@ -0,0 +1,69 @@
"""Konfiguration für Hermes Memory Next Level.
Lädt aus ~/.hermes/profiles/<profile>/memory/config.json
mit Fallback auf DEFAULT_CONFIG.
"""
import json
import os
from pathlib import Path
from typing import Any, Dict
DEFAULT_CONFIG: Dict[str, Any] = {
"profile": "default",
"tier2": {
"enabled": True,
"db_path": "{HERMES_HOME}/{profile}/memory/tier2.db",
"wal_mode": True,
"max_facts": 100_000,
"max_entities": 10_000,
"auto_dedupe": True,
},
"tier3": {
"enabled": True,
"backend": "chroma",
"path": "{HERMES_HOME}/{profile}/memory/tier3",
"embedding_model": "local",
"embedding_dim": 384,
"chunk_size": 512,
"chunk_overlap": 64,
"min_score": 0.7,
},
"graph": {
"enabled": True,
"path": "{HERMES_HOME}/{profile}/memory/graph",
"auto_rebuild_interval_hours": 24,
"max_nodes": 50_000,
"centrality_algorithm": "betweenness",
},
"cron": {
"consolidate_schedule": "0 3 * * *",
"embed_schedule": "*/5 * * * *",
"graph_rebuild_schedule": "0 4 * * 0",
"prune_schedule": "0 2 1 * *",
},
"limits": {
"fact_ttl_days": 365,
"session_index_max_age_days": 90,
"max_embedding_queue": 1000,
},
}
def _resolve_path(template: str, profile: str) -> Path:
"""Ersetzt {HERMES_HOME} und {profile} im Pfad-Template."""
hermes_home = Path(os.environ.get("HERMES_HOME", Path.home() / ".hermes"))
raw = template.replace("{HERMES_HOME}", str(hermes_home)).replace("{profile}", profile)
return Path(raw)
def load_config(profile: str = "default") -> Dict[str, Any]:
"""Lade Konfiguration mit Profil-Auflösung."""
config_path = _resolve_path("{HERMES_HOME}/profiles/{profile}/memory/config.json", profile)
config = DEFAULT_CONFIG.copy()
if config_path.exists():
with open(config_path, "r", encoding="utf-8") as f:
user_config = json.load(f)
config.update(user_config)
config["profile"] = profile
return config