C.W.K.
Stream
Lesson 03 of 05 · published

Context Layer: Prompt, Memory, Retrieval, Tool

~25 min · memory, retrieval, tools

Level 0Window Watcher
0 XP0/50 lessons0/13 achievements
0/100 XP to next level100 XP to go0% complete

layer마다 수명이 다르다

instruction은 안정적인 의도. conversation은 최근 작업 상태. retrieval은 선택적 배경지식. tool은 바깥 세계 접근. durable memory는 window 밖에서도 살아야 하는 사실. 이걸 섞어버리면 비싸고 낡고 그래도 불완전한 giant prompt가 된다.

항상 적용될 규칙은 durable project instruction에 있어야 해. 한 답변에 필요한 사실은 retrieval이나 tool read로 충분해. 현재 계획은 handoff board에. 한 번 본 stack trace는 진단 끝나면 session 밖으로 밀어내도 돼.

맞는 수명으로 사실 옮기기

context 관리는 더 세게 요약하는 일이 아니라, 어떤 사실을 window 밖 맞는 저장소로 승격시키고 어떤 noise를 attention 밖으로 demote할지 결정하는 일이야. 매 chat마다 같은 영구 규칙을 paste하는 건 budget 낭비. 가장 최근 메시지에만 사는 handoff는 한 번의 compaction으로 사라질 위험.

결정 습관

chat에 중요한 게 등장할 때마다 수명 질문을 해: 이게 다음 session 살아야 하나, 다음 주 살아야 하나, 다음 답변까지만 살면 되나? 긴 프로젝트 동안 수십 번 이걸 묻는 게 정돈된 AI 워크플로와 prompt 묘지의 차이야.

Code

맞는 수명 고르기·python
fact_lifetime = {
  "forever rule":         "project/vault instruction file (.md / CLAUDE.md)",
  "team policy":          "shared system prompt block",
  "current task state":   "handoff board (committed file)",
  "source material":      "indexed file or retrieval corpus",
  "one command result":   "current session only",
  "human decision":       "explicit note before compaction",
  "transient noise":      "drop on next checkpoint",
}
promote / demote / drop·yaml
lifetime_actions:
  promote_to_durable:
    - "do not push without human approval"
    - "always run pytest before commit"
  keep_in_session:
    - latest tool result waiting for review
    - draft answer being refined
  drop_after_use:
    - one-time stack trace once root cause is found
    - banner timestamps from the system

External links

Exercise

지저분한 AI session 하나 상상하고, 사실 10개를 system rule / project rule / handoff state / reference / throwaway noise로 분류해봐.
Hint
미래 agent가 반드시 따라야 하면 chat history에만 두면 안 돼.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.