memory-engineering
하는 일
AI 에이전트의 메모리 설계를 돕습니다. 옵션을 비교하고, 메모리 비용과 무엇을 남기고 버려야 할지 점검합니다. 시간이 지나도 기억해야 하는 에이전트를 만드는 엔지니어를 위한 스킬입니다.
사용하는 경우
- ✓AI 에이전트에 메모리를 추가하면서 설계를 고르고 싶을 때.
- ✓에이전트의 메모리 저장소가 계속 커져서 만료 규칙이 필요할 때.
- ✓메모리 설계를 만들기 전에 비용을 추정하고 싶을 때.
스킬 링크
https://github.com/alirezarezvani/claude-skills/blob/main/engineering/memory-engineering/skills/memory-engineering/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“에이전트의 메모리가 끝없이 커지고 있어요. 무엇을 잊게 할지 정하는 데 도와주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 메모리 설계의 비용을 측정하고, 무엇을 남길 가치가 있는지 검토하며, 도우미 스크립트로 잊기 정책이 있는지 확인합니다. 스크립트는 네트워크나 모델 호출을 하지 않습니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Memory Engineering — engineer the forgetting, not just the remembering
Portability: 4 stdlib scripts, no APIs/LLM calls/network. They measure and gate; you decide.
What this does
Anyone can give an agent memory: vector store, pipe in the history, retrieve top-k. That works until the history outgrows the context window, the write path costs more than every query it serves, and the store fills with stale state nobody removes. Memory is not a bucket — it is a system with a metabolism.
The shift: a storer optimizes what a system remembers; a memory engineer optimizes what it forgets. The problem was never that an agent forgets — it is that it never forgets on purpose.
The four lenses
| Lens | Question | The finding that hurts |
|---|---|---|
| Stanford | What does remembering cost? | Construction energy exceeds total query energy across 300 queries. The tuned half is the smaller half. |
| Microsoft | What is worth keeping? | More raw memory can make an agent worse. Keep facts and skills; drop the events. |
| Anthropic | Who controls what it keeps? | A wrong memory does not fail once — it persists into every future session that reads it. |
| Nvidia | Where does it hit hardware? | It is all KV cache in HBM. Construction is prefill-heavy and stalls the query a user is waiting on. |
Workflow
# 1 - Price it first. Never quote a quality number without a cost number.
python scripts/memory_cost_profiler.py --print-sample-spec > workload.json
python scripts/memory_cost_profiler.py --spec workload.json
# 2 - Pick which cost to pay. No "best" verdict; on a tie it asks, exit 2.
python scripts/memory_architecture_picker.py --constraints workload.json
# 3 - Audit what the store actually holds (skip if greenfield).
python scripts/memory_density_auditor.py --dir ~/.claude/memory
# 4 - Gate on forgetting. Exit 4 is a stop, not a suggestion.
python scripts/forgetting_policy_linter.py --policy design.json
# 5 - No command. Prove each pass by hand before scheduling it.
Step 1 reports the construction/query split, cost per correct answer, and
amortization — if construction dominates, cut construction tokens before
touching retrieval. Step 2 names the cost the winning family makes you pay.
Step 3 classifies records FACT / SKILL / LOG / PROSE (LOG-HEAVY = archiving
events; PROSE-HEAVY = docs, not memory).
Step 4 is the gate: F1 (explicit forgetting rule) and F4 (contradictions surfaced, never auto-merged) are blocking. Retrofitting forgetting onto two years of records is a migration nobody does; auto-merging disagreeing memories destroys the evidence the conflict existed.
Step 5 has no script — prove each pass by hand, then automate. Run it once
against real history and ask whether it changed a decision. If not, scheduling
it only makes noise. Ship order: forgetting_policy_design.md §7.
Hard rules
- Never quote accuracy without cost per correct answer.
- Never return a "best" memory system — name the cost the choice makes you pay.
- Never auto-merge contradictions. The system surfaces; the human decides.
- Never call a design done without a forgetting rule. No evaluated system provides one by default.
- Never schedule a pass not yet run by hand.
- Report findings as findings. A non-zero exit is a result to surface, not an error to swallow.
- Attribute every number with its confidence level. Vendor customer figures are testimonials, not benchmarks.
Scripts
| Script | Role | Exit codes |
|---|---|---|
scripts/memory_cost_profiler.py |
Construction vs query split, cost per correct answer, amortization, co-location warning | 0 · 2 finding · 3 bad input |
scripts/memory_architecture_picker.py |
Scores 4 families, disqualifies, names the cost, refuses to pick on a tie | 0 · 2 ambiguous · 3 bad input · 4 none viable |
scripts/memory_density_auditor.py |
FACT/SKILL/LOG/PROSE, duplicates, staleness, density (--dir or --jsonl) |
0 dense · 2 finding · 3 bad input |
scripts/forgetting_policy_linter.py |
The gate: 8 checks, F1 and F4 blocking | 0 PASS · 2 CONDITIONAL · 4 FAIL |
All support --output json and --sample (no input file needed).
References and assets
references/memory_cost_canon.md— construction dominance, energy per correct answer, the four families, ten recommendations (7 sources)references/what_to_keep.md— PlugM
자주 묻는 질문
왜 에이전트가 잊어야 하나요?
오래되거나 잘못된 기억은 다음 세션으로 이어져 에이전트를 더 나쁘게 만들 수 있으므로, 의도적으로 잊어야 안정적으로 작동합니다.
AI 모델을 호출하나요?
아니요. 스크립트는 측정하고 점검하기만 하며, 최종 결정은 사용자가 합니다.
어떤 옵션을 비교하나요?
긴 컨텍스트, 벡터 저장소를 이용한 검색, 그래프 메모리, 에이전트형 메모리를 비교합니다.
상세 정보
작성자의 원본 설명
Use before adding memory to an agent or when a memory store keeps growing (long context vs RAG vs graph vs agentic memory, what to expire). Prices the design with memory_cost_profiler.py and refuses one without a forgetting policy via forgetting_policy_linter.py.
인기도
- GitHub 스타
- 29k
- 순위
- #9567
- 라이선스
- MIT
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
agent-launcher-orchestrator
29k하나의 명확한 목표에서 시작해 내 계정의 Claude 관리형 에이전트를 계획하고, 만들고, 테스트하고, 예약하도록 돕습니다.
grade-iterate
29k에이전트가 채점 기준표에 따라 관리형 AI 에이전트의 결과물을 평가하고, 정해진 횟수 안에서 개선하도록 돕습니다. 끝없이 반복하지 않습니다.
interview
29kAI 에이전트 아이디어에 대해 질문하고, 답변을 간단한 빌드 계획으로 바꿔 어떤 것도 출시하기 전에 정리하도록 돕습니다.
run-without-you
29k에이전트가 관리형 AI 에이전트를 예약 또는 이벤트에 따라 실행되도록 설정하고, 출시 전에 cron 시간을 확인하도록 돕습니다.
비슷한 스킬
add-model-provider
394k에이전트가 안전한 설정 명령으로 새 AI 모델 제공자를 OpenClaw에 연결하고, API 키를 평문으로 두지 않으며, 실시간 테스트를 실행하도록 돕습니다.
acp-router
394k에이전트가 OpenClaw를 통해 Claude Code나 Cursor 같은 코딩 도우미에 작업을 전달해, 작업이 그 도구에서 실행되도록 돕습니다.
browser-automation
394k에이전트가 로그인, 탭, 페이지 응답이 멈췄을 때의 복구를 포함해 웹 페이지를 단계별로 조작하도록 가르칩니다.