Repository navigation
Memory: a strategy entry type and memory_distill, the ReasoningBank layer above facts - #431
Merged
currentbits merged 9 commits intoAug 18, 2026
Conversation
… The left bar has too many option we need to move a few. Perh
Shared contract for the ReasoningBank work: a fifth entry type for distilled "when doing X, do/don't Y" rules, ranked between conventions and knowledge. - widenEntryTypes rebuilds the entries table on old DBs (SQLite cannot ALTER a CHECK), reusing the DB's own DDL so the later column migrations still fire - bootstrap gains a `strategies` section, whole-body under a 500-token budget - protocol line tells agents to follow strategies and report bad ones Co-Authored-By: Claude Opus 5 <[email protected]>
… Memory: synthetic state-change regression test
Widen MemoryEntryInfo, the Memory tab badge/store form, and the dev seed so strategy entries render distinctly and can be created. Electron proxy has no type allowlist — left untouched. Co-Authored-By: Claude Opus 5 <[email protected]>
) The server has no LLM, so it does not write type:strategy rows. distill() is a read-only report in the same shape as maintenance(): it hands the caller the raw evidence plus a short instruction list, and the agent writes the "when doing X, do/don't Y" rules with memory_store. Failures (highest-value signal): live harmful_count > 0 entries with their most recent feedback_log notes, plus abandoned tasks. Successes: live runs from the last 14 days and helpful_count > 0. Existing: titles of live strategies already stored, so the agent can see coverage. Each list is project-scoped, live-only, capped at 20, with the true total reported alongside. No watermark — store-time dedup is what makes restating a known strategy a no-op. Co-Authored-By: Claude Opus 5 <[email protected]>
…into coder/memory-distill-procedural-strategy-entri-f14749
#308) The app writes strategies over REST and agents read them over MCP; each side was only covered against its own fake. One test drives the real join, plus a README entry-type table. Co-Authored-By: Claude Opus 5 <[email protected]>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
currentbits
deleted the
coder/memory-distill-procedural-strategy-entri-f14749
branch
October 3, 2026 16:07
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.
Closes #308.
ReasoningBank (arXiv 2509.25140) shows that distilling reusable strategies from past trajectories — successes and failures both, with failures carrying much of the gain — beats plain fact memory. Solenta's memory already had episodic (
run), semantic (knowledge) and standing rules (convention), but no procedural layer. This adds one.A fifth entry type:
strategyA short "when doing X, do/don't Y" rule, importance 4 — above
knowledge(3), belowconvention(5).memory_bootstrapgains astrategiessection that agents get at session start, injected whole under a 500-token budget: a rule truncated mid-clause is worse than an absent one. The protocol tells agents to follow strategies and to report a bad one withmemory_feedback.Widening
entries.typeneeded care. SQLite cannotALTERaCHECKconstraint, sowidenEntryTypes()does the table rebuild — but it reuses the DB's own DDL with only the CHECK list swapped, rather than writing out a fresh full schema. That preserves each DB's exact column set, so theaddColumnIfMissingmigrations below it still fire and still backfill. Building the new table from the current schema instead silently skipped the importance backfill on pre-importanceDBs;db.test.jscaught it.memory_distillThe memory server has no LLM and should not grow one, so distillation is agent-driven, in the same shape as the existing
memory_maintenance: the server hands over evidence plus a short instruction list, and the calling agent writes the rules withmemory_store({ type: 'strategy' }).distill({ project })returns{ failures, successes, existing, instructions }:harmful_count > 0carrying their most recentfeedback_lognotes, plus abandoned tasks. This is the high-value signal: places where an agent was actually misled.runentries from the last 14 days and entries withhelpful_count > 0.Every list is project-scoped and live-only, capped at 20 with the true total reported alongside so nothing truncates silently. The call is read-only: no writes, no
markAccessed, no watermark. Restating a known strategy is already a no-op thanks to store-time Jaccard dedup, so no new state was needed to make it idempotent.App surface
strategyflows throughMemoryEntryInfo, gets its own badge in the Memory tab, is creatable from the store form, and is seeded in the dev provider. No new UI — no distillation button, no new panel. The electron memory proxy has no type allowlist, so there was nothing to widen there.Testing
Beyond each side's own tests,
test/rest.test.jscovers the join the app actually depends on: a strategy stored over REST (how the Memory tab writes) coming back out of bothmemory_bootstrapandmemory_distillover MCP.tsc --noEmitcleanwireClient × webBridge over a real socketbaseline on main, unrelated to this changeDeliberately left out
No automatic distillation schedule: the janitor stays dumb and an agent calls
memory_distillwhen it wants the pack. No server-side LLM. Both are easy to add on top if the manual loop proves worth automating.