Repository navigation
Prefrontal memory: explain it to agents, measure reading, gate SUBMIT for issue finders - #64
Merged
Merged
Conversation
…T for issue finders
…imi K2.5, LLM timeout 300s
…rompt), log prompt-cache use
…om TEMPERATURES, in_prompt docs
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.
Problem
Every RLM agent receives
prefrontal_memoryas a REPL variable, but the prompt only shows a 1,000-char head+tail preview of it. On peaks-com/mono#10519 the memory was ~68k chars, so the preview was ~1.5% of it. No prompt mentioned memory, nothing measured whether it was read, and nothing gated SUBMIT on it. The diff had the same problem before the coverage gate in #62.Changes
with_prefrontal_memoryappends a MEMORY block to the instructions. It covers:require_read=True, the prompt tells the model to print the memory in slices under the output cap.memory_checksends an early SUBMIT back with the unseen section titles and the exactprefrontal_memory[a:b]slices to print.combine_checks).max_iters/max_llm_callsis spent, SUBMIT is accepted. The ContextSafe fallback gets the same gate.memory_seen=<seen>/<total> sections (unseen: …).unseen_files.format.is_section_title), so headings inside briefings or reflect answers stay in their section.docs/memory.mdgains a "Delivery to agents" subsection and a log example. CHANGELOG has a### Changedentry under Unreleased, with no version bump.Cost
The 4 gated agents now print the whole memory, which adds its size (~17k tokens on mono#10519) to every later step's prompt in each scope run.
Tests
tests/test_memory_coverage.pyadds 48 tests: section parsing and round-trip, unseen sections, slices under the cap, the combined gate,CodespyRLMreject and accept, logging, the prompt blocks and cache, and agent wiring. The full suite has no new failures: 40 failed and 3 errors, the same tests as onmain.Validation still to do
Re-run on peaks-com/mono#10519 and check:
memory_seen=y/yor log the budget-spent acceptance;coverage_rejections, cost and latency compared with the previous run;content_filterrefusals.