Skip to content

Phase 7: the extractor - #21

Merged
rohan-hotdata merged 4 commits into
mainfrom
phase-7-extractor
Oct 14, 2026
Merged

rohan-hotdata merged 4 commits into
mainfrom
phase-7-extractor

Conversation

@rohan-hotdata

Copy link
Copy Markdown
Collaborator

Closes #19.

This PR adds a second extractor prompt for the memory arm, detail, and a session source on each fact. The library does not change. All work is in bench/.

How

  • bench/prompts.py: the detail variant. It tells the extractor to read every turn, to keep a fact that the user states in passing, to keep each item of a list, and to write absolute dates. baseline is unchanged.
  • bench/e2e.py: each fact carries session:<hash>, 12 hex digits of the SHA-256 of the session id. The block shows sources to the reader, and LongMemEval names evidence sessions answer_..., so the plain id would tell the reader which facts hold the answer. --no-fact-sources keeps the phase 5 and 6 behavior.
  • bench/models.py: a reply with a schema that reaches its token limit comes back with stopped set, and the cache keeps it. The extractor writes no facts for that session and counts it in sessions_at_limit.
  • bench/diagnose.py: names the session of each fact that holds the answer.

Results (docs/benchmarks.md)

Memory arm Sample A Sample B
baseline, no sources (phase 6) 19 27
baseline, with sources 22 not run
detail, with sources 31 32
No stored fact held the answer: baseline, then detail 19, then 16 16, then 14

Verification

  • make verify, with new offline tests for the variant, the source, and a reply at the limit.
  • A replay of sample A with --no-fact-sources gave the same 54 answers and marks as phase 6, with no model call.
  • The phase spent at least $5.23 on models.

Notes

  • detail met a stop condition: it cut the target group from 19 to 16, and the issue asked for 12 or fewer. The owner accepted it. docs/internal/plan.md records the findings and decisions.
  • The diagnosis marker can miss stored facts in a list of 200 to 300. For 3 misses of detail on sample A, the facts exist but were not marked.
  • Task 6 did not run, because no second extractor model was named.
  • detail still drops values that the assistant said, in 7 single-session-assistant misses on sample A.

…h fact

Tasks 1 and 2 read the 19 misses of sample A that no stored fact answers. In 14 of them,
the user stated the fact in passing, in a turn about another topic. In 5, the answer is
a value that the assistant said. Task 2 found no reply at the token limit, no reply that
fails to parse, and no near fact in "Facts already in memory". plan.md records the
findings.

The variant `detail` asks the extractor to read every turn, to keep a fact that the user
states in passing, to keep each item of a list, and to write absolute dates.

Each fact now carries the source `session:<hash>`, with 12 hex digits of the SHA-256 of
the session id. The block shows sources to the reader, and an evidence session id holds
`answer`, so the source does not show the id. `--no-fact-sources` runs the memory arm as
phases 5 and 6 did. The diagnosis gives the session of each fact that holds the answer.
…imit

The first runs with sources stopped on question a3332713. The extractor reply for one
session reached the limit of 4,000 output tokens. In that session the user pastes a list
of survey answers from other people.

A reply with a schema that reaches its limit now comes back with `stopped` set, and the
cache keeps it. The extractor writes no facts for that session, so a replay and the
diagnosis skip the same session. Each result row and the result file count these
sessions in `sessions_at_limit`. The marker calls of the diagnosis still stop the run at
the limit.
On sample A, the baseline with sources scored 22 of 54 and `detail` scored 31. On sample
B, `detail` scored 32, against 27 for the phase 6 baseline. The group with no stored fact
for the answer went from 19 to 16 on sample A and from 16 to 14 on sample B.

docs/benchmarks.md reports each run with its prompt, model, cost, and diagnosis. It also
records that the marker of the diagnosis can miss stored facts. plan.md records the
owner's acceptance of `detail` below the stop condition, that task 6 did not run, and the
spend of the phase.
The README gave only the baseline scores of the memory arm. It now also gives the scores
of the `detail` prompt on both samples.

A replay of sample A with `--no-fact-sources` gave the same 54 answers and marks as
phase 6, with no model call. docs/benchmarks.md records it.
@rohan-hotdata
rohan-hotdata requested a review from a team as a code owner October 14, 2026 16:45
@rohan-hotdata
rohan-hotdata requested review from zfarrell and removed request for a team October 14, 2026 16:45
@rohan-hotdata
rohan-hotdata merged commit ab93da1 into main Oct 14, 2026
3 checks passed
rohan-hotdata added a commit that referenced this pull request Oct 15, 2026
Phase 7 closed with PR #21. The roadmap records what it changed for later phases, and lists more extractor prompts under Deferred. The plan drops phase 7, adds the detail results to its start point, and opens phase 8 as issue #22.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Phase 7: the extractor

1 participant