agent-memory-discipline
Skill này làm gì
Skill này dạy agent AI cách dùng bộ nhớ một cách thông minh. Nó đặt ra quy tắc về thời điểm agent nên tìm thông tin cũ trước khi hành động, và khi nào nên lưu thông tin mới hoặc các chỉnh sửa sau khi hành động.
Khi nào nên dùng
- ✓Khi trợ lý quên sở thích hoặc các quyết định trước đây của bạn.
- ✓Khi bạn muốn AI ghi nhớ điều quan trọng cho các dự án sau này.
- ✓Khi trợ lý lặp lại lỗi hoặc câu hỏi đã được giải quyết.
Liên kết skill
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/agent-memory-discipline/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
“Hãy nhớ rằng chúng ta đã quyết định dùng thư viện X cho dự án Y.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Trước khi làm việc quan trọng, AI tìm trong bộ nhớ những thông tin liên quan. Sau khi đưa ra quyết định, sửa lỗi hoặc phát hiện điều mới, AI ghi lại vào bộ nhớ để dùng 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.
Agent Memory Discipline
Overview
Connecting a memory tool does not make an agent use it: tools register, the session runs, and nothing gets recalled or saved. This skill supplies the missing part, standing rules for when to read memory and when to write it.
The problem it solves is specific. An agent with memory available still repeats settled questions, reverts corrected habits, and loses decisions between sessions, because nothing tells it when recall and save are due. The rules below make both moments explicit.
When to Use This Skill
- Use when a memory tool or MCP memory server is connected but the agent is not using it consistently.
- Use when the user complains that the assistant loses preferences, conventions or past decisions between sessions.
- Use when setting up persistent memory for a project and the agent needs standing rules for reading and writing it.
- Use when the user says "remember this", "what did we decide", "recall", or "save this for next time".
How It Works
Before You Start: Any Memory Backend
The agent needs a memory tool it can call. Any backend works, and the rules are identical for each:
- Files. A
memory/folder of Markdown notes, one fact per file. No dependencies, fully greppable, versionable in git. - A local MCP memory server. Keeps everything on the local machine; several open-source options exist.
- A hosted memory service over MCP. Adds portability across tools and machines at the cost of the data living elsewhere.
Authentication is whatever the chosen backend requires: none for a local folder, the server's own configuration for a local MCP server, an API key or OAuth sign-in for a hosted service. This skill never handles credentials itself and never writes them into memory.
Step 1: Recall Before Acting
Read memory before doing any of these, not after:
- starting work on a project touched before
- choosing a library, pattern, or tool
- writing tests, commits, or documentation, where conventions apply
- answering "how do we usually do X here"
- anything the user phrases as "again", "like last time", or "as we agreed"
Skip recall for one-off factual questions, arithmetic, or anything fully specified in the current message. Recall costs a tool call and context; spending it on a self-contained question is waste.
Search with the words the user actually used, plus the project or repository name. If the first search returns nothing useful, try one broader query, then stop and proceed without memory rather than looping.
Step 2: Save After Deciding
Write to memory when one of these has just happened:
- a decision was made and will still matter next week ("we use pnpm", "the billing module stays untouched")
- the user corrected the agent, which is the strongest signal there is
- an approach failed, and why it failed
- a preference was stated that applies beyond this task
- a fact about the environment was discovered the hard way (a port, a flag, a service that must be running)
Do not save: the contents of files that can be read again, restatements of the current task, transient state, anything the user marked as temporary, and anything containing secrets, tokens, or personal data.
One memory, one fact. A paragraph containing four decisions cannot be superseded cleanly when one of them changes.
Step 3: Write It So It Survives
A memory that is useless in three weeks was written wrong. Give each entry, in the text if the backend has no fields for it:
- what was decided or observed, in one sentence
- why, briefly, because the reason outlives the decision
- when it became true, and when it stopped being true if it has
- where it came from: a file, a commit, a conversation, a test run
Prefer the user's own words over a paraphrase. Paraphrase drifts.
Step 4: Close the Past Instead of Overwriting It
When something changes, the old memory is not wrong. It is closed.
If the project moved from Redux to Zustand, "we use Redux" was true from January to June. Deleting it destroys the explanation for every component written in that window. Mark it superseded, keep its validity window, and write the new one alongside.
This is the single most destructive habit in agent memory, and it stays invisible until someone asks a question about old code.
Step 5: Keep Contradictions Visible
…
Câu hỏi thường gặp
Điều gì xảy ra nếu AI tìm thấy thông tin cũ mâu thuẫn?
AI sẽ hiển thị cả hai thông tin cũ cùng với ngày tháng và yêu cầu bạn làm rõ thông tin nào đúng hoặc mới hơn.
AI có lưu mọi thứ tôi nói không?
Không. AI chỉ lưu các quyết định quan trọng, sửa lỗi bạn đã thực hiện hoặc thất bại đã xảy ra. Nó không lưu thông tin tạm thời hay dữ liệu nhạy cảm như mật khẩu.
AI lưu thông tin như thế nào?
AI ghi lại điều đã được quyết định hoặc học được, vì sao nó quan trọng, khi nào xảy ra và thông tin đến từ đâu. Nếu có thay đổi, thông tin cũ không bị xóa mà được đánh dấu là “superseded” (đã bị thay thế) để tham khảo sau này.
Chi tiết
Mô tả gốc của tác giả
Rules for when an agent should recall from long-term memory before acting and when it should save decisions, corrections and failures afterwards. Works with any memory backend.
Độ phổ biến
- Sao GitHub
- 48k
- Vị trí xếp hạng
- #3661
- Giấy phép
- MIT
- Cập nhật
- 15/10/2026
Bình luận
- …
Thêm skill từ kho mã này
00-andruia-consultant
48kGiúp agent của bạn bắt đầu hoặc cải thiện các dự án AI. Phân tích mã, gợi ý công cụ và lập kế hoạch hành động bằng tiếng Tây Ban Nha.
007
48kCho phép agent của bạn thực hiện kiểm toán bảo mật và mô hình hóa mối đe dọa. Hữu ích để bảo vệ dự án khỏi các cuộc tấn công và lỗ hổng.
10-andruia-skill-smith
48kGiúp agent của bạn tạo hoặc cải thiện các công cụ AI. Xác định cách công cụ hoạt động, viết tài liệu và kiểm tra cấu trúc.
20-andruia-niche-intelligence
48kGiúp agent của bạn tạo bản tóm tắt về một ngành cụ thể. Hữu ích để hiểu bối cảnh, quy tắc, cách người dùng tương tác và rủi ro của dự án.
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.