Agents forget every session
Preferences, decisions, and project context die when the context window resets. You re-explain the same things.
Persistent hierarchical memory that agents can retain, recall, and prune. One excellent local store. Clean MemoryStore port for later backends.
Install
npm i @umg0/umg0Drop-in via MCP (stdio). Offline by default. No cloud required.
# Session start: restore context
→recall("umg0 landing page")
semantic
Prefer TypeScript strict mode
procedural
Always dry-run prune before eviction
# New durable fact
→retain("Brand accent is soft violet #C4B5FD", tier:"semantic")
✓ stored · importance scored
# Session end
→reflect("decisions + prefs from session")
✓ consolidated · candidates retained
4
Tiers
6
MCP tools
FTS
SQLite local
MCP-first — one memory layer across your tools
Works with Claude Code, Cursor, Hermes, Cline, VS Code, Zed, Windsurf, and any MCP client
working → procedural
retain through promote
optional hybrid embeds
stats + umg://stats
The problem
Agent amnesia and unbounded memory bloat are two sides of the same infrastructure gap. umg0 is the layer in between.
Preferences, decisions, and project context die when the context window resets. You re-explain the same things.
Dump everything into one bag and recall gets noisy. Tokens rise. Signal falls. Memory becomes a liability.
Without tiers, scores, and pruning, agents keep stale facts and never promote proven patterns into skills.
Product
Every memory has a tier, importance, decay score, and lifecycle. Recall re-ranks with configurable weights: FTS, importance, decay, tier, recency, and entity match. Then consolidation keeps the store sharp.
working
Current task scratch
24h · cap 50
episodic
Specific interactions
30d · cap 500
semantic
Facts, prefs, decisions
365d · cap 1000
procedural
Skills & lessons
near-immortal · cap 200
Brand accent is soft violet #C4B5FD
Prefer TypeScript strict mode across the monorepo
Always dry-run prune before destructive eviction
Landing page copy review: omit Login until auth exists
Why umg0
Honest v0.2 scope: one excellent local backend, clean MemoryStore port, multi-backend routing out of scope.
Hierarchy
Working for scratch, episodic for interactions, semantic for durable facts, procedural for skills. Each tier has its own TTL, cap, and decay half-life.
retention ↑ · pressure ↓
Consolidation
Importance from entity density and rarity, multi-pass merge, confidence-gated supersede (additive-first on ambiguity), tunable decay, and eviction under pressure. The differentiator is pruning quality, not store size.
// write path (v0.2)
1. score importance
2. find similar
→ merge if similar ≥ 0.82
→ supersede only if confidence ≥ 0.75
→ else additive (keep both)
3. insert + light prune
recall score =
fts · imp · decay · tier · recency · entity
Interface
Six tools agents already understand. SQLite FTS5 offline by default, WAL and single-writer discipline. Optional hybrid embeddings and LLM reflect stay behind flags.
// .mcp.json
{
"mcpServers": {
"umg": {
"command": "node",
"args": ["./dist/index.js", "mcp"]
}
}
}# umg stats · umg compact · umg prune --dry-run
How it works
Useful agent memory is not a bigger store. It is hierarchical retention plus aggressive consolidation.
Write durable facts, preferences, and decisions. Auto-tier or set semantic / working explicitly. Similar facts merge; clear contradictions supersede.
Retrieve ranked context for the current task. Configurable multi-factor score: FTS, importance, decay, tier, recency, entity.
Session write-back consolidates decisions and preferences. Heuristic extract by default; optional LLM reflect behind a flag.
Scores and caps keep the store clean. Multi-pass merge on prune. Patterns can promote to procedural skills with quality gates.
Quickstart
Connect via MCP or use the CLI. Same six tools for retain, recall, reflect, list, prune, and promote in any MCP-compatible client.
Install
npm i @umg0/umg0# Preferred (npm package @umg0/umg0)
npx -y @umg0/umg0 retain --content "Prefer TypeScript strict mode" --tier semantic
npx -y @umg0/umg0 recall --query "TypeScript"
npx -y @umg0/umg0 stats
npx -y @umg0/umg0 prune --dry-run
# After: npm i -g @umg0/umg0
# umg0 retain --content "..." --tier semantic{
"mcpServers": {
"umg": {
"command": "npx",
"args": ["-y", "@umg0/umg0", "mcp"],
"env": {
"UMG_LOG_LEVEL": "info"
}
}
}
}
// Same block for Claude Code, Cursor, Cline, VS Code, Zed, …
// Global install alternative: command "umg0", args ["mcp"]
// See: github.com/Hananahsan/umg/tree/main/examples# Session start
recall(query: "project + task + entities", namespace: "project:slug")
# When you learn something durable
retain(content: "concise fact", tier: "semantic")
# Session end
reflect(text: "Decision: ...\nPreference: ...\nCorrection: ...")
# Periodically
prune(dry_run: true) # then without dry_run
promote_to_skill(...) # dry_run first when unsureSame MCP server works across clients. Only the config file location changes.
Use cases
MCP coding agents (Claude Code, Cursor, Cline, Hermes, and more) that recall project decisions, style prefs, and past fixes instead of relearning every session.
Preferences, constraints, and standing instructions that survive context resets across tools.
Namespace-scoped facts for each codebase: architecture choices, naming rules, and hard-won lessons.
Patterns that prove useful promote to procedural skills: durable playbooks, not one-off notes.
Get started
Persistent. Hierarchical. Clean. Install locally and connect via MCP in minutes.