feat: add core project memory package - #11355
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e6978050dc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Code Review SummaryStatus: No Issues Found | Recommendation: Merge All five previously-flagged findings were addressed in the latest commits:
The broader extraction into Files Reviewed (incremental: 24 files)
Previous Review Summaries (3 snapshots, latest commit e7e9efe)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit e7e9efe)Status: No Issues Found | Recommendation: Merge All five previously-flagged findings were addressed in the latest commits:
The broader extraction into Files Reviewed (incremental: 24 files)
Previous review (commit 7194bf7)Status: 5 Issues Found | Recommendation: Address before merge (no new issues since last review) Overview
Issue Details (click to expand)WARNING
Files Reviewed (35 files)
Fix these issues in Kilo Cloud Previous review (commit 23b4086)Status: 3 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Files Reviewed (14 files)
Reviewed by gpt-5.4-20260305 · 146,104 tokens Review guidance: REVIEW.md from base branch |
|
A non-overengineered architecture improvement (that would make maintenance much easier) could split serialization, file system access and storage modules from the domain logic. |
23b4086 to
7194bf7
Compare
7194bf7 to
e7e9efe
Compare
e7e9efe to
0486646
Compare
Context
Add durable, project-scoped memory so Kilo can retain useful facts, decisions, constraints, commands, corrections, and recent session context across conversations. The core is opt-in, local-only, and designed to save durable information rather than transcripts or unsafe model output.
Memory is stored outside the repository under
~/.kilo/memory/<project-name>-<hash>/, keeping the checkout clean while giving Git worktrees a stable shared project identity.Implementation
The new
@kilocode/kilo-memorypackage provides storage, capture, indexing, and recall primitives without coupling them to a product surface. Its source layout separates durable project facts (project.md), environment notes (environment.md), corrections (corrections.md), compact startup context (index.kmem), session digests, and audit records.Writes are atomic and serialized with ownership-aware filesystem locks; destructive purge requires a valid memory manifest; source and session changes invalidate the generated index. Capture output is schema-validated, size-limited, and redacted before persistence. Recall uses compact typed records and session digests under explicit byte/token budgets.
Memory output is context, not instruction: current user messages, repository files, tool output, and
AGENTS.mdremain authoritative when they conflict with saved memory. The package also includes corrupt-state recovery, deterministic command parsing, and regression coverage for deletion safety, concurrent updates, redaction, qualified forget, session replacement, and stale indexes.Screenshots / Video
N/A — package-only change with no visual surface.
How to Test
Manual/local verification
Executed by the coding agent:
bun run typecheckfrompackages/kilo-memorybun run buildfrompackages/kilo-memorybun testfrompackages/kilo-memory— 69 tests passedbun run test:cifrompackages/kilo-memorybun turbo test:ci --filter=@kilocode/kilo-memoryfrom the repository rootbun run lintfrom the repository root — 0 errorsbun turbo typecheck— 18 tasks passedReviewer test steps
bun run typecheck && bun run build && bun testfrompackages/kilo-memory.Blocked checks and substitute verification
Checklist