본문으로 건너뛰기
Skillpedia
에이전트29k · #9567

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가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/alirezarezvani/claude-skills/blob/main/engineering/memory-engineering/skills/memory-engineering/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

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

  1. Never quote accuracy without cost per correct answer.
  2. Never return a "best" memory system — name the cost the choice makes you pay.
  3. Never auto-merge contradictions. The system surfaces; the human decides.
  4. Never call a design done without a forgetting rule. No evaluated system provides one by default.
  5. Never schedule a pass not yet run by hand.
  6. Report findings as findings. A non-zero exit is a result to surface, not an error to swallow.
  7. 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

자주 묻는 질문

왜 에이전트가 잊어야 하나요?

오래되거나 잘못된 기억은 다음 세션으로 이어져 에이전트를 더 나쁘게 만들 수 있으므로, 의도적으로 잊어야 안정적으로 작동합니다.

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.

repo: alirezarezvani/claude-skills

인기도

GitHub 스타
29k
순위
#9567
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬