Agent Memory & Live Context
The Agent Memory system enables Matih agents to persistently learn from interactions, accumulate tenant-specific knowledge, and assemble rich live context for every request.
Two-Service Architecture
| Service | Stack | Port | Purpose |
|---|---|---|---|
| memory-service | Java Spring Boot | 8216 | Memory CRUD, lifecycle FSM, RBAC, Qdrant integration |
| memory-intelligence-service | Python FastAPI | 8217 | LLM extraction, hybrid search, temporal graph, context assembly |
Design Principles
- Cherry-picked algorithms: Mem0 single-call extraction, Graphiti temporal edges, Hindsight RRF fusion, LangMem procedural memory
- Built on existing infra: Qdrant, Neo4j, Kafka, GrowthBook, asset-service
- Tenant isolation: All operations scoped by tenant_id, enforced at API gateway and service level
- Experimentation-first: Every tunable parameter exposed as a GrowthBook feature flag
- Feedback-driven: Closed-loop system where user feedback directly improves memory quality
Data Flow
User Interaction → Extraction (LLM) → Memory CRUD → Qdrant Vectors
↓
Agent Request → Context Assembly ← Hybrid Search (BM25 + Vector + Graph → RRF)
↑
MCP Servers + Decision Traces + Procedural MemoryKey Capabilities
- 4 Memory Types: Factual, Procedural, Correction, Preference
- 4 Memory Scopes: User, Session, Agent, Organization
- Lifecycle FSM: CANDIDATE → ACTIVE → DECAYED/CONSOLIDATED → ARCHIVED
- Hybrid Search: BM25 + vector + graph with Reciprocal Rank Fusion
- Temporal Graph: Neo4j with bi-temporal edges ("what was known at time T")
- Live Context: Real-time assembly from 28+ MCP servers + memory + traces
- Feedback Loop: Importance adjustment, procedural compilation, drift detection