Implements the missing pieces of the MemPalace epic (#367): - sovereign_store.py: Self-contained memory store replacing the third-party mempalace CLI and its ONNX dependency. Uses: * SQLite + FTS5 for keyword search (porter stemmer, unicode61) * HRR phase vectors (SHA-256 deterministic, numpy optional) for semantic similarity * Reciprocal Rank Fusion to merge keyword and semantic rankings * Trust scoring with boost/decay lifecycle * Room-based organization matching the existing PalaceRoom model - promotion.py (MP-4, #371): Quality-gated scratchpad-to-palace promotion. Four heuristic gates, no LLM call: 1. Length gate (min 5 words, max 500) 2. Structure gate (rejects fragments and pure code) 3. Duplicate gate (FTS5 + Jaccard overlap detection) 4. Staleness gate (7-day threshold for old notes) Includes force override, batch promotion, and audit logging. - 21 unit tests covering HRR vectors, store operations, search, trust lifecycle, and all promotion gates. Zero external dependencies. Zero API calls. Zero cloud. Refs: #367 #370 #371
18 lines
661 B
Python
18 lines
661 B
Python
"""MemPalace integration for Hermes sovereign agent.
|
|
|
|
Provides:
|
|
- mempalace.py: PalaceRoom + Mempalace classes for analytical workflows
|
|
- retrieval_enforcer.py: L0-L5 retrieval order enforcement
|
|
- wakeup.py: Session wake-up protocol (~300-900 tokens)
|
|
- scratchpad.py: JSON-based session scratchpad with palace promotion
|
|
- sovereign_store.py: Zero-API durable memory (SQLite + FTS5 + HRR vectors)
|
|
- promotion.py: Quality-gated scratchpad-to-palace promotion (MP-4)
|
|
|
|
Epic: #367
|
|
"""
|
|
|
|
from .mempalace import Mempalace, PalaceRoom, analyse_issues
|
|
from .sovereign_store import SovereignStore
|
|
|
|
__all__ = ["Mempalace", "PalaceRoom", "analyse_issues", "SovereignStore"]
|