memory-systems
Skill này làm gì
Skill này giải thích cách cho agent AI một bộ nhớ bền vững qua các phiên, bao gồm theo dõi thực thể, sự kiện thay đổi theo thời gian và truy xuất từ kho đồ thị hoặc vector. Nó dành cho người xây dựng chọn cách agent của họ ghi nhớ mọi thứ.
Khi nào nên dùng
- ✓Khi một agent phải nhớ người dùng, sự kiện hoặc cuộc trò chuyện qua các phiên riêng biệt.
- ✓Khi sự kiện thay đổi theo thời gian và agent phải biết phiên bản nào vẫn còn hiệu lực.
- ✓Khi bạn chọn giữa các framework bộ nhớ như Mem0, Zep, Letta hoặc Cognee.
Liên kết skill
https://github.com/muratcankoylan/Agent-Skills-for-Context-Engineering/blob/main/skills/memory-systems/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Giúp tôi thiết lập bộ nhớ cho trợ lý để nó nhớ sở thích của từng khách hàng qua nhiều tuần trò chuyện.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Skill so sánh các cách tiếp cận bộ nhớ, từ kho đơn giản đến đồ thị tri thức ghi lại thực thể và thời điểm của chúng, và gợi ý cách truy xuất đúng sự kiện sau này.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Memory System Design
Memory provides the persistence layer that allows agents to maintain continuity across sessions and reason over accumulated knowledge. Simple agents rely entirely on context for memory, losing all state when sessions end. Sophisticated agents implement layered memory architectures that balance immediate context needs with long-term knowledge retention. The evolution from vector stores to knowledge graphs to temporal knowledge graphs represents increasing investment in structured memory for improved retrieval and reasoning.
When to Activate
Activate this skill when:
- Building agents that must persist knowledge across sessions
- Choosing between memory frameworks (Mem0, Zep/Graphiti, Letta, LangMem, Cognee)
- Needing to maintain entity consistency across conversations
- Implementing reasoning over accumulated knowledge
- Designing memory architectures that scale in production
- Evaluating memory systems against benchmarks (LoCoMo, LongMemEval, DMR)
- Building dynamic memory with automatic entity/relationship extraction and self-improving memory (Cognee)
Do not activate this skill for adjacent work owned by other skills:
- File-backed scratchpads, run logs, and tool-output offloading:
filesystem-context. - Conversation compaction or human-readable handoff summaries:
context-compression. - Masking, prefix caching, token budgets, or retrieval scoping inside one trajectory:
context-optimization. - Formal belief/desire/intention models over RDF state:
bdi-mental-states.
Core Concepts
Think of memory as a spectrum from volatile context window to persistent storage. Default to the simplest layer that meets retrieval needs, because benchmark evidence suggests tool complexity matters less than reliable retrieval for some memory workloads (claim-memory-locomo-filesystem-baseline). Add structure (graphs, temporal validity) only when retrieval quality degrades or the agent needs multi-hop reasoning, relationship traversal, or time-travel queries.
Detailed Topics
Production Framework Landscape
Select a framework based on the dominant retrieval pattern the agent requires. Use this table to narrow the shortlist, then validate with the benchmark data below.
| Framework | Architecture | Best For | Trade-off |
|---|---|---|---|
| Mem0 | Vector store + graph memory, pluggable backends | Multi-tenant systems, broad integrations | Less specialized for multi-agent |
| Zep/Graphiti | Temporal knowledge graph, bi-temporal model | Enterprise requiring relationship modeling + temporal reasoning | Advanced features cloud-locked |
| Letta | Self-editing memory with tiered storage (in-context/core/archival) | Full agent introspection, stateful services | Complexity for simple use cases |
| Cognee | Multi-layer semantic graph via customizable ECL pipeline with customizable Tasks | Evolving agent memory that adapts and learns; multi-hop reasoning | Heavier ingest-time processing |
| LangMem | Memory tools for LangGraph workflows | Teams already on LangGraph | Tightly coupled to LangGraph |
| File-system | Plain files with naming conventions | Simple agents, prototyping | No semantic search, no relationships |
Choose Zep/Graphiti when the agent needs bi-temporal modeling (tracking both when events occurred and when they were ingested) because its three-tier knowledge graph (episode, semantic entity, community subgraphs) excels at temporal queries. Choose Mem0 when the priority is fast time-to-production with managed infrastructure. Choose Letta when the agent needs deep self-introspection through its Agent Development Environment. Choose Cognee when the agent must build dense multi-layer semantic graphs — it layers text chunks and entity types as nodes with detailed relationship edges, and every core piece (ingestion, entity extraction, post-processing, retrieval) is customizable.
Benchmark Performance Comparison
Consult these benchmarks to set expectations, but treat them as source-specific signals for retrieval dimensions rather than absolute rankings. No single benchmark is definitive.
| System | DMR Accuracy | LoCoMo | HotPotQA (multi-hop) | Latency |
|---|---|---|---|---|
| Cognee | — | — | Published high score | Variable |
| Zep (Temporal KG) | Published high score | — | Mid-range across metrics | Low-latency reported |
| Letta (filesystem) | — | Published filesystem baseline | — | — |
Câu hỏi thường gặp
Bộ nhớ dài hạn khác cửa sổ ngữ cảnh thế nào?
Cửa sổ ngữ cảnh chỉ giữ phiên hiện tại, còn bộ nhớ dài hạn giữ kiến thức tồn tại giữa các phiên.
Hiệu lực theo thời gian là gì?
Nghĩa là mỗi sự kiện được gắn thời điểm nó đúng, nên thông tin cũ có thể được thay thế thay vì trộn lẫn với thông tin mới.
Làm sao kiểm thử hệ thống bộ nhớ?
Skill nhắc đến các benchmark như LoCoMo và LongMemEval để so sánh các hệ thống bộ nhớ.
Chi tiết
Mô tả gốc của tác giả
This skill should be used for persistent semantic memory in agent systems: cross-session knowledge retention, entity tracking, temporal validity, graph or vector retrieval, memory consolidation, and memory benchmark selection. Route file-backed scratchpads to filesystem-context, handoff summaries to context-compression, and token-efficiency tactics to context-optimization.
Độ phổ biến
- Sao GitHub
- 18k
- Vị trí xếp hạng
- #10647
- Giấy phép
- MIT
- Cập nhật
- 11/10/2026
Bình luận
- …
Thêm skill từ kho mã này
context-engineering-collection
18kGiúp agent của bạn quản lý những gì đưa vào cửa sổ ngữ cảnh của model AI, từ bộ nhớ và công cụ đến thiết lập nhiều agent và đánh giá.
advanced-evaluation
18kDạy agent của bạn cách đánh giá câu trả lời AI bằng một AI khác, với chấm điểm, so sánh cạnh nhau và kiểm tra thiên lệch.
bdi-mental-states
18kDạy agent của bạn mô hình hóa niềm tin, mục tiêu và kế hoạch bằng cách tiếp cận BDI, để các quyết định của nó có thể được truy vết và giải thích.
context-compression
18kGiúp agent của bạn rút gọn các phiên AI dài thành bản tóm tắt giữ lại quyết định, file, rủi ro và bước tiếp theo.
Skill tương tự
add-model-provider
394kGiúp agent của bạn kết nối nhà cung cấp mô hình AI mới với OpenClaw bằng lệnh an toàn, giữ API key khỏi văn bản thuần và chạy thử.
acp-router
394kGiúp agent của bạn gửi một tác vụ đến trợ lý lập trình như Claude Code hoặc Cursor qua OpenClaw, để công việc chạy ngay trong công cụ đó.
browser-automation
394kHướng dẫn agent của bạn điều khiển trang web từng bước, gồm đăng nhập, tab và cách khôi phục khi trang ngừng phản hồi.