agentleFS
daemon-blockint-techdaemon-blockint-tech/Agentic-Enteprises-Skill/ai-memory-developer/SKILL.md

ai-memory-developer

Skill8 starsChanged 6 months agoMITView on GitHub

Guides design and implementation of AI agent and application memory—short-term conversation state, long-term user/tenant memory, episodic vs semantic stores, consolidation, retrieval, forgetting, privacy retention, and eval of memory quality. Use when building persistent memory for copilots, designing memory APIs, choosing vector or graph stores, implementing memory write/read policies, debugging wrong or stale memories, or tuning what the model should remember across sessions—not for general RAG document search (ai-engineer), context window packing and token budgets (ai-context-engineer), AI team operations cadence (ai-lead-ops), or org-wide token cost improvement roadmaps (ai-token-improvement-plan-engineer).

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run nightly consolidation: merge episodic notes into semantic summaries.

    line 101

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

AI Memory Developer

When to Use

  • Building persistent memory for copilots, agents, or conversational AI
  • Designing memory APIs (read/write/consolidate/forget)
  • Choosing between vector stores, graph databases, or structured DBs for memory
  • Implementing memory write/read policies and ACLs
  • Debugging wrong, stale, or hallucinated memories
  • Tuning what the model should remember across sessions (episodic vs semantic)
  • Planning GDPR deletion paths and privacy retention for stored memories
  • Evaluating memory quality (recall, precision, isolation)

When NOT to Use

  • General RAG document search or indexing pipelines → ai-engineer
  • Context window packing, token budgets, or compression → ai-context-engineer
  • AI team operations, release governance, or SLOs → ai-lead-ops
  • Org-wide token cost improvement roadmaps → ai-token-improvement-plan-engineer

Related skills

NeedSkill
End-to-end LLM app, RAG, agentsai-engineer
Context assembly and compressionai-context-engineer
Prompt and tool message designprompt-engineer
PII retention and governanceai-risk-governance
Production monitoring and incidentsai-lead-ops
Token cost program and phased savings planai-token-improvement-plan-engineer

Core Workflows

1. Memory model design

Classify memory types:

TypeLifetimeExamplesStore
WorkingSingle turn / tool loopTool results, scratchpadIn-context only
SessionChat sessionCurrent task stateRedis / thread store
User long-termCross-sessionPreferences, facts user statedVector + structured DB
OrganizationalSharedDocs, policiesRAG index (see ai-engineer)

Design decisions:

  1. What may be written automatically vs requires user confirmation?
  2. Per-tenant isolation and ACL on every read/write
  3. TTL and deletion (GDPR erase path)
  4. Conflict resolution when new fact contradicts old

See references/memory_architecture.md for patterns and anti-patterns.

2. Write path (ingestion to memory)

observe → extract candidates → score importance → dedupe → persist → index

Checklist:

  • Extract only durable facts, not transient chit-chat
  • Attach provenance (message ID, timestamp, source)
  • Dedupe with embedding similarity + entity linking
  • Never store secrets, raw payment data, or full medical records unless required and approved

See references/write_consolidation.md for extraction prompts and consolidation jobs.

3. Read path (retrieval for generation)

  1. Build query from current user message + session summary
  2. Retrieve top-k memories with metadata filters (user_id, tenant_id)
  3. Rerank; drop below relevance threshold
  4. Inject into context in structured block (see ai-context-engineer)
  5. Cite memory IDs in logs for debugging

See references/read_retrieval.md for ranking and injection formats.

4. Forgetting and maintenance

TriggerAction
User delete requestHard delete all user memories
TTL expiredArchive or purge
Low usefulness scoreDecay or summarize away
ContradictionSupersede old record; keep audit trail

Run nightly consolidation: merge episodic notes into semantic summaries.

See references/write_consolidation.md for consolidation algorithms.

5. Evaluation

TestPass criteria
Write accuracyGold facts appear in store after session
RecallQuestion answerable from prior session
PrecisionIrrelevant memories not retrieved
IsolationTenant A never sees tenant B
ForgettingDeleted user has zero retrievable memories

See references/memory_eval.md for datasets and regression harness.

When to load references

  • Architecture and stores → references/memory_architecture.md
  • Write and consolidation → references/write_consolidation.md
  • Read and ranking → references/read_retrieval.md
  • Evaluation → references/memory_eval.md

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.