Generation models and extraction settings follow the latest published official docs. This page helps you see how the two paths differ, and how to check lineage.
Compare the two paths first
An explicit write keeps what you already decided to keep. Extraction stores a Source first, and it may produce no Memory.
If the Agent already has an explicit instruction to remember a decision, write it directly. Do not invent a Source just to make the lineage look nicer.
A prompt captured automatically should usually stay a Source first. Whether it deserves Memory is a later decision.
Check extraction capability
- capture still succeeds;
- the Source remains in the journal;
- a pending Source window cannot run model extraction;
- configure generation and restart the Server with
--env-file.
flush_memory directly and does not depend on the periodic scheduler.
Complete lineage script
Createsource_memory.py:
What to inspect at each step
Capture
Success is HTTP 202 with:status="accepted";- an exact content SourceRef;
- a numeric scope-local
position.
source_conflict. A real retry should reuse the same serialized input.
Changing content under the same identity must never overwrite the old Source. It returns HTTP 409.
Flush
Determine Source consumption from:previous_cursor;current_cursor;processed_source_count;- the capture response
position.
idle can be correct when the cursor has already reached the position.
Memory lineage
Do not rely on similar search text. Find an entry whosesource_refs contains the exact SourceRef returned by capture.
That proves the Memory entry came from this Source.
Extraction no-op
This is valid:Use stricter assertions for vector verification
Whencapabilities.search_modes includes vector, you may add:
- response
mode == "vector"; - a hit Citation identifies the source-linked entry from this run;
matched_bycontainsvector.
mode=None proves nothing about this Source’s vector projection.
An explicit vector request returns HTTP 422 when vector capability is unavailable. It does not fall back to FTS.
Cross-session recall depends on Scope
The script uses a random Scope for repeatable tests. To verify recall across sessions:- replace it with a stable value such as
project:powercontext-101; - run capture and flush once;
- start a new Python process or agent session that runs only search and prepare;
- connect both processes to the same Server with exactly the same Scope.
- Server URL;
- database home or URL;
- final
scope_id; - whether the entry is active;
- query relevance.
Active, inactive, and history
An extracted entry uses the same lifecycle as explicit Memory:- revise creates another entry version;
- retire marks the current entry inactive;
- default listing, search, and PreparedContext use active content;
include_inactive=Trueand exact read preserve audit history.
Troubleshooting
Capture succeeded, but flush returns 503
Check generation capability and provider credentials. The Source remains stored, so the pending window may be retried after configuration is repaired.Flush is processed, but no linked entry exists
This is an allowed no-op. Check whether the Source contains reusable knowledge, then inspect generation output and deduplication.The cursor never reaches the position
Inspect readiness, generation diagnostics, and scheduler or flush errors. Do not report an unprocessed window as Memory.Search has a hit, but lineage differs
The query found older similar Memory in the same Scope. Usesource_refs and the exact entry Citation as proof.
The second capture conflicts
Content or metadata bytes changed under onesource_id. Use a new ID for a new event; reuse the original input for a retry.
How you know it worked
After this page, you should be able to show that:- Capture creates a Source. It does not create Memory by itself.
- The same input replayed keeps the original position.
- After flush, the cursor reaches the capture position.
- The entry linked to this Source is identified by exact
source_refs. - A processed window may legally leave no Memory.
- Finding it again in another process depends on a stable Scope.
- An inactive entry leaves default recall. History remains.
Next step
Handoff loop
Preparing writes a boundary Source. Commit creates the milestone.
If you are stuck
Capture succeeded, but search finds no Memory. Start there.

