Logo Memory Design

Memory Design

Cộng đồng
nahid-sparktales
memory-design

Decide what an agent should remember, which layer holds it, who it is scoped to, and how a stale or contradicted memory is detected and retired. Use when an agent forgets something across sessions, when a memory or persistent-context feature is being designed, or when stored memories have grown noisy, wrong, or are leaking between users. Not for retrieval over a document corpus, not for prompt or context-window packing, and not for conversation transcript storage.

Tổng quan

Nhà phát hànhnahid-sparktales
Kho mãagent-dispatcher
Tên kỹ năngmemory-design
Sao
58
Bản fork
5
Tệp đi kèm
1
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 1 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được nahid-sparktales công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Memory Design trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/nahid-sparktales/agent-dispatcher/tree/main/skills/ai/memory-design
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/nahid-sparktales/agent-dispatcher.git /tmp/agent-dispatcher
mkdir -p .claude/skills
cp -r /tmp/agent-dispatcher/skills/ai/memory-design .claude/skills/memory-design
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Memory Design trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Memory Design ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Memory Design với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

Memory design

Memory is the only part of an agent that keeps being wrong after you stop looking. A retrieval bug shows up in the next answer; a stale memory sits there being quietly confident for months. Design the retirement path before the write path.

When this fires

An agent needs a fact to survive past the current context — across turns, tasks or sessions — or an existing memory store has grown noisy, contradictory, or is surfacing one subject's data to another. It does not fire for retrieval over a document corpus (that is retrieval-rag), and not for keeping a transcript: a transcript is a log, not memory.

Procedure

  1. Name the repeat failure first. What did the agent forget, how often, and what did it cost — a re-asked question, a redone decision, a wrong assumption. Memory added without a named repeat failure is speculative storage, and storage you cannot justify is storage you will not prune.
  2. Classify what is actually worth keeping, because the class decides everything after it:
    • stable facts and preferences — this user's stack, conventions, how they want to be addressed
    • decisions and their rationale — true until explicitly reversed, and the rationale is the part that matters later
    • working state — what this task is mid-way through; it dies with the task
    • derived summaries — regenerable from the source; store only when regeneration is expensive Everything else is a log. Do not promote a log to memory.
  3. Put each class in the shallowest layer that holds it. Working state belongs in a task file or thread state, not a long-term store. Stable facts and decisions belong in a durable record. If the store is a vector index, it is a retrieval system and inherits the retrieval-rag procedure, including the requirement to measure recall — unevaluated vector memory is a wish.
  4. Scope every record explicitly at write time: the subject it is about (this user, this project, this repository, this organization) and who may read it. Default to the narrowest scope. Widening a memory's scope so it crosses users or tenants is a data boundary change — raise it and get an explicit decision, do not infer permission from convenience.
  5. Write memories as assertions with provenance, not as free prose: the claim, when it was learned, what it was learned from (session, message, file, commit), and what would make it false. A memory with no source cannot be retired safely, because nothing can be checked against the thing it came from.
  6. Choose the write trigger deliberately. Writing on every turn produces noise that buries the few records that matter. The triggers that earn a write: the user says to remember, a decision is settled, a correction is issued, or a fact was expensively discovered. A user correcting the agent is the highest-value write there is — never drop one.
  7. Refuse to store secrets and sensitive personal data. Credentials, tokens, keys, payment and identity data do not go into memory, even when they appeared in the conversation. If one is already stored, stop and tell the user rather than quietly acting on it.
  8. Check for staleness at read time, not only on a schedule. Three detectors, cheapest first: contradiction — a new statement conflicts with a stored one; expiry — the record was time-boxed at write (current sprint, active branch, "for now"); reference decay — it names a file, person, project or setting that no longer exists. Verify a load-bearing memory against the live source before acting on it.
  9. Supersede rather than silently overwrite. The replacing record points at what it replaced and says why. History of a reversed decision is often more useful than the decision.
  10. Treat deletion as destructive. Retiring or clearing memory the user gave you removes something they may be relying on. Propose the retirement with the list of what would go, and ask. Never bulk-delete a memory store to fix a formatting problem.
  11. Bound the store and measure usefulness. Set a cap and an eviction rule based on when a record was last read, not when it was written. Track what fraction of stored memories have been read at all in the last N sessions; a large unread tail is cost with no return, and it is the signal to tighten the write trigger from step 6.
  12. Exercise the full loop before calling it done: write a memory, start a genuinely fresh session, confirm it is retrieved and used. Then change the underlying fact and confirm the old record is superseded rather than duplicated, and that the new answer reflects the new fact.

Checklist

  • The repeat failure this memory exists to fix is named
  • Each stored class mapped to a layer, with working state kept out of the durable store
  • Every record carries subject scope and read visibility
  • Every record carries source, timestamp, and a falsification condition
  • Write triggers are explicit; corrections are always captured
  • Secrets and sensitive personal data excluded at the write path
  • Contradiction, expiry and reference-decay checks run before a memory is acted on
  • Supersession preserves what was replaced and why
  • Deletion is proposed to the user, never performed silently
  • Cross-session round trip exercised, including the changed-fact case

Failure handling

  • Two memories contradict each other — do not pick by recency alone. Check both against the live source; if it cannot be resolved, surface the conflict to the user rather than acting on a coin flip.
  • The agent recalls a fact that is no longer true — the defect is in the retirement path, not in retrieval. Fix the expiry or contradiction detector; deleting the one bad record leaves the next one to be found by the user.
  • A memory from one subject surfaced under another — stop, treat it as a data exposure, report it with the scope that was wrong. Do not continue the feature work first.
  • The store is large and nothing is measurably better — that is a result. Report the unread fraction and propose narrowing the write trigger.
  • No durable store is available in this environment — say so, keep the fact in the task's own working state, and do not describe behaviour as persistent when it is not.

Evidence to report

The classes stored and the layer each lives in; a sample record showing scope, source, timestamp and falsification condition; the write triggers as implemented; the staleness checks that run and where they run; the cross-session round trip actually performed, including the changed-fact case, with what was recalled; and the read-rate of the store if it has been running long enough to have one. "It remembers now" without a fresh-session round trip is a claim, not evidence.

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Memory Design làm được gì?

Decide what an agent should remember, which layer holds it, who it is scoped to, and how a stale or contradicted memory is detected and retired. Use when an agent forgets something across sessions, when a memory or persistent-context feature is being designed, or when stored memories have grown noisy, wrong, or are leaking between users. Not for retrieval over a document corpus, not for prompt or context-window packing, and not for conversation transcript storage.

Vì sao nên dùng Memory Design trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Memory Design là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Memory Design trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/nahid-sparktales/agent-dispatcher/tree/main/skills/ai/memory-design. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Memory Design?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Memory Design với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Memory Design với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Memory Design có miễn phí không?

Có. Kỹ năng này được nahid-sparktales phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇