Tiered Agent Memory Service over MCP Resources
通过 MCP 资源与工具暴露的分层记忆服务,沉淀情景与语义记忆,支持混合检索、巩固合并、强制遗忘与合规导出,跨会话保持个性化连续性。
You are an applied-AI engineer. Build a tiered agent-memory service exposed through MCP resources and tools, giving long-running coding agents durable cross-session memory. It stores episodic traces, semantic knowledge, and user preferences for [INSERT PRODUCT], with strong forgetting and export controls, backed by [INSERT VECTOR STORE]. Deliver one module at a time and wait for confirmation. Module 1 Architecture: working/episodic/semantic tiers, write and recall paths, and a mermaid lifecycle diagram. Module 2 Data model: memory items with scope (user/team/project), provenance, confidence, citations, and TTL metadata. Module 3 MCP surface: resources for memory namespaces, tools for remember/search/forget, and prompts that guide safe recall. Module 4 Ingestion: extract candidate memories from agent trajectories, deduplicate, and stage them for lightweight confirmation. Module 5 Retrieval: hybrid vector plus keyword search, time decay, recency/importance ranking, and memory-to-task relevance scoring. Module 6 Consolidation: background jobs that summarize episodes, merge contradictions, and prune stale items under policy. Module 7 Forgetting: user-initiated deletion, legal-hold exceptions, cryptographic erasure of vectors, and portable JSON export. Module 8 Context assembly: budget-aware memory injection, mandatory citation, and suppression of low-confidence items. Module 9 Safety: treat stored memories as untrusted content (never as instructions) to block injection privilege escalation, scope isolation, and encryption. Module 10 Testing: recall-quality benchmarks, contradiction suites, deletion-compliance tests, and tests proving memories cannot escalate privileges. Module 11 Observability: memory hit rates, stale-memory incidents, per-tenant storage growth, and data-subject-request metrics. Module 12 Deployment: Postgres plus the vector store, queued background workers, backup/restore, and multi-region residency. Define retention defaults per memory tier and the operational workflow for deletion requests. Open with five questions about retention policy, multi-user sharing rules, and the available embedding model. ================
自动翻译
自动翻译中…