ERINYS
Mentions Bootstrap in example use cases for applying optimization techniques to Bootstrap-related scripts.
Exports memory data to markdown format for compatibility with markdown-based tools like Obsidian.
Exports memory data to Obsidian-compatible markdown files with wikilinks for instant knowledge graph creation.
Supports PostgreSQL as a database option for production reliability, with conflict detection against other database choices.
Planned PyPI package distribution for easy installation of the memory server as a Python package.
Includes testing framework integration for running tests on the memory server implementation.
Built as a Python-based MCP server with Python environment setup and package management.
Uses SQLite as the local-first database storage with FTS5 and vector extensions for hybrid search capabilities.
ERINYS β Verifiable local memory for AI agents
~10 ms local retrieval. No API key. No token cost.
A local trust layer for agent memory: one SQLite file, zero LLM calls in the retrieval path. Retrieval recall 99.4% R@5 / 100% R@10 on LongMemEval-S, 96.8% R@5 on the harder _m split β see Benchmarks.
π―π΅ ζ₯ζ¬θͺ Β· Limitations Β· Comparison Β· Tool reference Β· Changelog
AI agent memory systems have always mimicked human memory. Short-term, long-term, episodic, semantic β textbook categories bolted straight onto implementations.
Something always felt off.
Humans forget. But existing memory systems don't β they grow endlessly, serving stale facts with the same weight as fresh ones. Humans notice "wait, didn't you say something different before?" But memory systems silently overwrite. Humans connect two unrelated experiences and think "oh, I can use that here." Memory systems just store and retrieve.
What needed to be mimicked wasn't the taxonomy of memory. It was the behavior. That discomfort is what summoned ERINYS.
ERINYS is a guard dog: it stores facts, preserves history, catches contradictions, and proves deletion.
Origin: ERINYS was built as the retrieval layer for HyperAION, an AI agent self-improvement framework. It is released as a standalone MCP server so any agent stack can use it independently.
Quickstart (30 seconds)
1. Install.
pip install erinys-memory2. Verify your environment. One command checks Python, SQLite extension support, sqlite-vec, embeddings, dependencies, and the DB β each failing check prints a fix.
erinys doctor3. Register the MCP server with your client (Claude Desktop / Claude Code / any stdio MCP host):
{
"mcpServers": {
"erinys": {
"command": "erinys-memory",
"env": {
"ERINYS_DB_PATH": "~/.erinys/memory.db"
}
}
}
}4. Save and search from the JSON CLI (no LLM, no network):
erinys save --title "JWT httpOnly flag was missing" \
--content "Cookie was JS-accessible; added httpOnly, secure, sameSite=strict." \
--type bugfix --project demo
erinys search "auth cookie security" --project demoRetrieval runs in ~7β10 ms against a single local SQLite file, with zero LLM calls.
Related MCP server: yantrikdb-mcp
Benchmarks
These are retrieval recall numbers ("is the correct session in the top-K?"), not end-to-end QA accuracy β QA and answerability harnesses shipped in v0.5.1, real runs pending (LIMITATIONS.md). All results use the same mode (enhanced_v2_boost) with zero LLM calls in the retrieval pipeline, reproduced on current dependencies (2026-07).
Benchmark | N | R@5 | R@10 |
LongMemEval-S | 500 | 99.4% | 100.0% |
LongMemEval-M (~476-session haystack) | 500 | 96.8% | 98.0% |
LoCoMo | 1,982 | 92.7% (fair β 95.7%ΒΉ) | 97.2% |
ConvoMem | 250 | 97.6%Β² | β |
ΒΉ A miss audit found 42% of LoCoMo R@5 misses are benchmark-label defects (single-gold labels for multi-session answers, unanswerable adversarial questions), not retrieval failures. Β² April 2026 configuration; re-run on current dependencies pending.
Why this matters: no API keys, no network, no tokens burned for retrieval. ERINYS reaches these numbers with FTS5 + sqlite-vec + algorithmic boosting alone β your agent's memory searches at the speed of SQLite. Full methodology, per-category breakdowns, miss analyses, and reproduction commands β benchmarks/BENCHMARKS.md
The story of how we got here β πΊπΈ English / π―π΅ ζ₯ζ¬θͺ
What makes ERINYS different
Forgetting. Most memory systems only accumulate. ERINYS decays memories over time following the Ebbinghaus forgetting curve: old noise sinks, frequently accessed knowledge floats. Search results stay relevant without manual curation β decay runs automatically, no LLM needed.
Verified forgetting. erinys_forget deletes a memory and its derived closure (distilled descendants) in a single transaction, then runs a membership test proving zero residue across every DB substrate (observations / vectors / FTS / edges / collisions). Deletion you can prove, not just request.
Provenance. Every observation carries a server-stamped provenance block β who wrote it, via which write path, derived from which parents. erinys_lineage walks any memory back to its origins. Callers cannot spoof it.
Distillation. A specific bugfix ("JWT httpOnly flag was missing") automatically generates three layers: the concrete fact β a reusable pattern ("new endpoints need a security checklist") β a universal principle ("security defaults should be safe without opt-in"). β οΈ Requires an LLM call (local Ollama by default).
Dream Cycle. Two memories are fed to an LLM: "is there a connection?" Candidate pairs are selected by semantic similarity β close enough to be related (cosine > 0.65), far enough to not be redundant (< 0.90). β οΈ Requires LLM calls; not part of the zero-LLM retrieval path.
Distillation and the Dream Cycle are the generative edge of ERINYS: from memories that existed, it even synthesizes memories that never did. Both are LLM-backed and live outside the zero-LLM retrieval path.
Adaptive search. Query complexity is classified automatically (L1/L2/L3): simple keyword lookups stay FTS-heavy, complex multi-hop questions shift to vector-heavy retrieval. WHY/WHO/WHEN intents adjust boost parameters and graph edge types, and graph-reachable neighbors are reranked upward. CJK queries route to vector search by default, where embedding models outperform FTS5's porter tokenizer.
Design philosophy
Memory has layers
Not all memory is equal. ERINYS organizes knowledge by abstraction level:
Concrete β what happened. "The JWT httpOnly flag was missing on
/api/auth."Abstract β patterns from facts. "New API endpoints need a security header checklist."
Meta β principles from patterns. "Security defaults should be safe without manual opt-in."
A single bugfix generates all three through distillation. The meta layer accumulates principles that transfer across projects and tech stacks.
Forgetting is a feature
Every memory has a strength score that decays over time. A memory saved 6 months ago ranks lower than one saved yesterday. Memories accessed frequently resist decay β repeated retrieval reinforces them.
When strength drops below a threshold, the memory becomes a pruning candidate. The database stays lean. Search stays relevant.
Facts change. History shouldn't disappear
When information updates β "we moved from AWS to GCP" β ERINYS doesn't overwrite. It creates a supersede chain: the old fact is marked as replaced but preserved. You can ask "what did we believe in March?" and get the answer that was true then.
Contradictions should be caught
If memory contains both "use PostgreSQL" and "use SQLite", ERINYS detects the conflict. Instead of silently switching, the agent asks: "you previously chose PostgreSQL β has the requirement changed?"
Search finds meaning, not just keywords
Two searches run simultaneously and fuse results:
Keyword search (FTS5) β exact term matching with NEAR phrase expansion.
Vector search (sqlite-vec) β semantic similarity via local embeddings.
RRF fusion β Reciprocal Rank Fusion combines both rankings with adaptive weights.
Intent routing β WHY/WHEN/WHO queries adjust boost parameters and edge types.
Graph reranking β knowledge-graph neighbors boost fusion scores.
No LLM in the loop. Retrieval latency stays under 15 ms.
Everything stays local
One SQLite file. No cloud API, no subscription, works offline. Your agent's memory never leaves the machine.
Use cases
Memory across sessions. An agent saves what it learned; next week's agent finds it.
erinys_save(title="Fixed JWT httpOnly flag",
content="Cookie was JS-accessible; added httpOnly, secure, sameSite=strict.",
type="bugfix", project="my-app")
erinys_search(query="auth cookie security", project="my-app")
# β the JWT fix comes back, scored. The same mistake is not repeated.Contradiction detection.
erinys_save(title="DB choice", content="Use SQLite for simplicity", project="my-app")
erinys_conflict_check(observation_id=42)
# β "β οΈ Conflicts with observation #18: 'Use PostgreSQL for production reliability'"Time-travel queries.
erinys_timeline(query="deployment target", as_of="2026-03-01") # β "AWS EC2 (decided 2026-02-15)"
erinys_timeline(query="deployment target", as_of="2026-04-01") # β "GCP Cloud Run (switched 2026-03-20)"Verified forgetting.
erinys_forget(id=42) # dry run: shows the derived closure that would be deleted
erinys_forget(id=42, dry_run=False) # deletes it, then proves zero residue across all DB substratesCLI
The MCP server is the agent-facing adapter; the same operations are available from a JSON CLI for scheduled jobs, CI, recovery, and manual verification β stable exit codes, machine-readable output.
erinys health --project my-app --deep --json # authoritative: server import + search smoke test
erinys search "Buffer DNS" --project my-app --limit 5 --readonly --json
erinys context --project my-app --limit 10 --readonly --json
erinys save --title "Decision" --content "What: ..." --type decision --project my-app --json
erinys undistilled --project my-app --limit 10 --json
erinys distill 123 --level meta --json--readonlyreads via SQLitemode=roβ keyword search only, no migration or audit-log writes. Drop it when semantic search is needed.dream/pruneoperate on the whole database across all projects;prune --executeadditionally requires--confirm-global.Usage errors also emit JSON (
error.code: "USAGE", exit code 2).Module form:
python -m erinys_memory.cli <command>.
MCP tool surface (28 tools)
Tier | Tools | What | LLM |
Basic | 17 | save / search / recall / sessions β the stable core | β none |
Governance | 7 | lineage, supersede, timeline, conflict check, verified forgetting | β none |
Experimental | 4 | distill, dream, collide, eval β research features | β οΈ distill / dream / collide call an LLM |
Every tool returns the same {ok, data, error} envelope. Full per-tool reference β docs/TOOLS.md
Configuration
Variable | Default | Description |
|
| SQLite database path |
|
| fastembed embedding model |
|
| Auto-distill on save (set |
|
| Local Ollama model for distillation |
|
| Ollama generate endpoint |
Architecture
βββββββββββββββββββββββββββββββ
β FastMCP Server β 28 tools, uniform {ok, data, error} envelope
βββββββββββββββββββββββββββββββ€
β search.py β graph.py β RRF hybrid search β typed edges
β decay.py β session.py β Ebbinghaus decay β lifecycle
β temporal.py β collider.py β versioning β dream cycle
β distill.py β policy.py β 3-level distill β access policy
β provenance.py β db.py β lineage stamps β SQLite + vec
βββββββββββββββββββββββββββββββ€
β embedding.py β fastembed (multilingual-MiniLM, 384d)
βββββββββββββββββββββββββββββββ€
β SQLite + FTS5 + sqlite-vec β fully local, no network at runtime
βββββββββββββββββββββββββββββββDevelopment
git clone https://github.com/GhostyAI-HA/ERINYS-mem && cd ERINYS-mem
python3 -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
PYTHONPATH=src pytest tests/ -v # run tests
python -m erinys_memory.server # run the MCP server from source (stdio)
ollama pull gemma4:e4b # only for distill / dream (LLM features)Release highlights
v0.5 β benchmark truth (reproduced numbers, first
_msplit evaluation), temporal grounding, answerability, opt-in memory access policy, QA / answerability eval harnessesv0.4 β VMG: server-stamped provenance,
erinys_lineage, verified forgetting (erinys_forget); MAGMA retrieval (adaptive weights, intent routing, graph reranking)v0.2 β adaptive retrieval, intent-aware router, distillation quality scoring, dream outcome scoring
Full details β CHANGELOG.md
Roadmap
Dream Daemon β run the Dream Cycle in the background (currently manual)
Auto-prune when the DB crosses a size threshold
Multi-agent scoping β per-agent memory isolation
ConvoMem re-run + real end-to-end QA evaluation on current dependencies
License
MIT Β© 2026 SHUN FUJIYOSHI (GhostyAI-HA) β see LICENSE
This server cannot be installed
Maintenance
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/GhostyAI-HA/ERINYS-mem'
If you have feedback or need assistance with the MCP directory API, please join our Discord server