Repository navigation
feat(memory): 기억을 기록으로 — 종류 · 버전 · 출처, 턴마다 예산 안에서 선택 (4.108.0) - #183
Merged
Merged
Conversation
사실 원장 · 에버그린은 통째로 다시 쓰고 통째로 싣는 문서라 기억이 커지면 프롬프트가 커지고 잘렸다. 기억의 단위를 기록(rule/fact/state/decision/procedure)으로 바꾼다. - 쓰기: 대화별 커서 → 범위가 묶인 추출 → 이웃만 놓고 판정 → 권위 · 상태 불변식은 코드가 지킨다 - 버전 · 이력 · 되돌리기, 낙관적 동시성, 이력은 검색 · 의미 색인 밖 - 읽기: 규칙 · 상태 · 관련 · 색인을 예산 안에서 고른다(한 줄 먼저, 남는 몫으로 통째로, 자르지 않음) - 정리: 묶음 합치기 · 거두기 · 결정 완료 · 충돌, 한 줄 요약 - 이관: 옛 원장 · 에버그린 · 고정 노트를 여러 pass 에 걸쳐 잃지 않고 옮긴다(재실행 안전) - 도구: memory_pin → 기록, memory_record 신설, 주인 변경 API(owner) - XGEN_MEMORY_RECORDS=off 로 예전 동작 - scripts/bench_memory_records.py 실측 Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
왜
사실 원장(
__facts__.md) · 에버그린(__evergreen__.md)은 통째로 다시 쓰고 통째로 매 턴 싣는 문서였다. 기억이 커지면 프롬프트가 커지고, 고정 층 예산에서 잘렸다(128k 창 3.8k자). 원장은 200개에서 멈춰 고침까지 버렸고, 에버그린은 상한이 없었고, 추출 커서는 다른 대화의 턴을 건너뛰었다.무엇
기억의 단위를 기록(rule · fact · state · decision · procedure)으로 바꾼다. 저장은 상한이 없고 프롬프트에는 턴마다 고른 것만 들어간다. 자세한 내용은 CHANGELOG 4.108.0.
memory_pin→ 기록,memory_record신설) · 주인 변경 APIXGEN_MEMORY_RECORDS=off로 예전 동작실측 (
scripts/bench_memory_records.py)옛 기억 42개(8.7만 자): 예전 고정 층은 4.9% · 7.4% · 35%(128k · 200k · 1M)를 싣고 나머지를 말없이 잘랐다. 기록 블록은 규칙을 10 · 17 · 74개(/74) 싣고 나머지는 색인에 남긴다.
검증
pytest tests/6,368 통과(실패 1건test_old_stage_module_is_gone은 로컬 잔여__pycache__폴더 탓, 변경 전에도 실패)tests/unit/test_memory_records.py32개gen_event_docs --check🤖 Generated with Claude Code