persistent memory · claude code

Memory
that actually
remembers.

A hierarchical knowledge graph that captures the people, projects, and decisions you discuss with Claude — and brings them back into context every session, automatically. No hooks to wire, no prompts to engineer.

nodes person company project paper episode
edges relation mention
the gap

Every session starts
from zero.

Claude Code has no memory between sessions. Open a new terminal tomorrow and the model knows nothing about Alice, the migration you've been planning, or the decision you made last week.

You can paste context. You can write CLAUDE.md files. You can call tools and hope. But none of that accumulates — there's no growing understanding of your work, no graph of who-does-what.

pamiec fills that gap with a knowledge graph maintained in the background. It captures conversation turns, extracts the entities that matter, and surfaces the right slice when you need it.

session — monday
01You: "Alice from Acme owns ProjectX"
02Claude: noted.
session — tuesday
01You: "what's the status of ProjectX?"
02Claude: I don't have any context on ProjectX.
→ with pamiec
01You: "what's the status of ProjectX?"
02Claude: [recalls Alice, Acme, ProjectX from graph]
03Claude: ProjectX is owned by Alice at Acme. Last week...
three tiers · gam-inspired

Strict isolation
between capture and knowledge.

Inspired by GAM (arxiv 2604.12285). Real-time turn capture never contaminates the stable entity graph. Each layer has a different lifecycle, a different cost profile, and is queryable independently.

01
tier 1 — live
EPG buffer
Conversation turns flow in real-time, batched by a 2-minute cron. Embedded locally with fastembed — no LLM calls, no token cost. Searchable while the session is still in progress.
~2 min cadence no LLM queryable live
02
tier 2 — archive
Episodes
Every 30 minutes, the buffer is split at semantic topic boundaries (centroid-based local minima detection) and each segment becomes a frozen episode with a Haiku-generated summary.
semantic boundaries single haiku call embedded summaries
03
tier 3 — long-term
Entity graph
Each episode produces typed entities with confidence scores, merged into a stable graph. Cross-links connect entities back to source episodes. Aggressive deduplication keeps it clean.
confidence-gated typed edges auto-compaction
install

Two cron jobs.
Done.

~/pamiec
# clone and install $ git clone https://github.com/fuzue/pamiec.git ~/pamiec $ cd ~/pamiec && uv sync $ pamiec init # downloads embedding model (~130 MB) # register the MCP server with Claude Code $ claude mcp add --scope user pamiec "$HOME/pamiec/.venv/bin/pamiec-mcp" pamiec: ✓ Connected # schedule the two background jobs $ crontab -e */2 * * * * $HOME/pamiec/.venv/bin/pamiec capture */30 * * * * $HOME/pamiec/.venv/bin/pamiec consolidate-session # that's it. open a new claude code session and ask anything. $ pamiec graph # view the live knowledge graph
compared to gam

Where we follow.
Where we diverge.

following gam

Three-tier write isolation

Real-time capture, semantic-boundary archive, and stable entity graph — the three layers GAM defines, with the same strict no-contamination contract between them.

Dual-granularity nodes

Every entity has both a one-line summary (csum) and a structured detail block (craw) — fast retrieval up top, full context on demand.

our approach

Cross-session entity memory

GAM optimises for episodic memory within a long conversation. pamiec optimises for entity memory across all sessions — what do I know about Alice / Acme / ProjectX, ever.

Embeddings, not LLMs, where possible

Boundary detection uses sliding-window centroid similarity — no LLM call. Edge confidence comes from Haiku, but never the cross-encoder rerank. Cheaper to run, easier to reason about.