界面已本地化;技能介绍与说明文档按所选语言由 AI 自动翻译,代码、命令、路径和专业术语保留原文,以原作者文档为准。
探索技能
文档与办公 · SKILL.md

ai-memory-developer

ai-memory-developer

【文档与办公】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, imp…

独立 GitHub 快照 · 自动分类 · 以原作者文档为准

技能说明

GitHub

name: ai-memory-developer description: | 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).

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
我的收藏