"Memory is not a volume to be filled, its a surface to be encoded"
local-first · open source · self-improving
SEAM is Surface Encoded Agent Memory. It is a self-improving memory layer designed to give AI real persistence. It takes a machine-first approach by compressing natural language into a machine-first shorthand called MIRL. MIRL is a token compression language that is directly queryable and 100% lossless. SEAM uses Postgres and SQL as the canonical source of truth, making it 100% lossless. Hybrid retrieval treats RAG as an acceleration layer, achieving token compression of up to 90%.
SEAM compiles untrusted source material into canonical MIRL records (the readable semantic IR), persists them as durable truth in SQLite, derives rebuildable indexes, orchestrates six retrieval signals, and emits token-bounded PACK context. RAW preserves the original evidence. Retrieved content is always data — never authority.
These are not aspirational — they are enforced.
Every surface — CLI, MCP stdio, REST + browser dashboard, and more — drives the exact same runtime. Ingest, MIRL compilation, retrieval orchestration, PACK emission, and refinement all happen in the core. The interfaces are thin, auditable adapters.
Operator-facing composition surface.
seam <command>Standard agent-tool protocol via stdio.
stdio · agentsFastAPI with browser dashboard.
seam serve :8765Operator observation and control.
seam dashboardSEAM exposes its core memory runtime to operators and agents through four primary external interfaces, or surfaces. All four of these surfaces share and call the exact same underlying runtime behaviors rather than reimplementing them:
RAW preserves exact evidence. MIRL is the canonical semantic IR. PACK produces dense, budgeted context for agents. LENS shapes task-specific views — all with unbreakable provenance back to source.
Preserve exact source detail for recovery. Source identity, hashes, exact spans and offsets, provenance, and prompt-injection containment before anything becomes canonical.
The canonical MIRL semantic IR. Deterministic records with stable identities, entity/relation consistency, uncertainty, contradiction state, temporal semantics, and full provenance bindings.
Token-bounded context projection for agents. Relevance + displacement scoring, strict budgets, provenance retention, and explicit lossy-vs-exact modes.
Task- or interface-specific views over canonical records. View filtering with stable back-references. No promotion of summaries into truth.
The SEAM Skill Factory is an adaptive system designed to continuously evolve and improve the static Agent Compiler over time. Its core principle is that as SEAM improves, the agents operating it should improve alongside it.
Rather than just writing one-off prompts, the Skill Factory works through a structured, 7-layer loop that observes agent behavior, proposes optimizations, and safely applies them:
To prevent the system from self-corrupting or creating unstable agent instructions, the Skill Factory operates under absolute safety invariants:
Lexical, vector, graph, temporal, hybrid, and mix signals are orchestrated together. The system measures displacement and precision, not just recall. Every decision produces full traces back to the exact MIRL records used.
Canonical MIRL in SQLite. Rebuildable indexes. Multi-signal retrieval. Token-bounded PACK. Self-improving refinement. Holographic surfaces. Everything an agent needs to remember — exactly, durably, and on its own terms.
Records live in SQLite as the single source of truth. Indexes exist only as query accelerators and can be thrown away and rebuilt without loss.
Multiple orthogonal signals are combined at query time, with full traces so you can see exactly why a record was chosen.
Context is produced under explicit token limits. Every projection keeps provenance back-pointers and declares whether it is lossy or exact.
Standard MCP stdio protocol. Works with Gemini, Claude, Cursor, and any MCP-compatible client.
FastAPI/Uvicorn server with auth, CORS, rate limiting, SSRF controls, and a full browser dashboard.
Source-to-MIRL transformation with provenance preservation. Evidence survives compilation.
Entity relationships, temporal semantics, contradiction state. Supersession-aware ranking prevents stale data.
Retrieved content never gains authority. Prompt-injection containment, scope isolation, atomic writes.
Refinement agents detect contradictions and drift. New records emitted during operation are compiled back into the canonical store, updating indexes, skills, and future retrieval.
.skill.md files declare triggers, steps, and contracts. Compiled into versioned, reloadable capabilities with provenance — skills become first-class MIRL citizens.
Every run records the exact MIRL ids, retrieval traces, PACK contents, and decision paths used. Holdout-sealed and hash-verified — no score without its glassbox evidence.
If you find SEAM valuable, consider supporting the research.