souls: one memory for a souled GMI, reached by forget, export, correction and retention
What ships
A souledAgent() on the GMI runtime with cognitive memory on keeps one memory of each person, and every per-person call reaches it.
Today it keeps two. The soul's store still files each turn under its subject, while the GMI recalls from a cognitive memory of its own (docs/SOUL_FILES.md L400, src/api/gmi.ts L666-L667). memoryPolicy, screen and sharedMemory act on the soul's store alone, so they are refused when cognitive memory is on (docs/SOUL_FILES.md L410, src/api/souledAgent.ts L595-L603).
Once this is done:
- One store, one key, one write a turn.
souledAgent()hands its own store to its GMI. The GMI files and recalls each person's traces under the key the soul already uses for that person, and each turn is written once. The publicmemory.storeoption andgmi()on its own do not change. - Every per-person call reaches what the mind remembers.
forgetUser,exportUserMemory,correctUserMemory,sweepRetentionand the wiki compile reach the mind's traces, with their graph nodes, archived originals and typed facts, and the caches of open sessions.- The deletion report names each part it reached, and
completestays false while any part is missed. - The export holds the data derived about the person (emotional context, typed facts, any learner row) and lists who outside the process received the person's text.
- A correction is filed tagged
correctionand is never rewritten by gist or drift.
- The deletion report names each part it reached, and
memoryPolicy,screenandsharedMemorywork on the GMI runtime. They are wired into the GMI's filing path first (screenbefore encoding and embedding); then the TypeError that refuses them is removed.longTerm: 'off'stops encoding, recall, the mechanisms and the compile for that person and leaves stored traces in place. ThememoryPolicyanswer gainsprofiling: 'off'andminor: true.- Defaults on a souled agent.
- Cognitive memory stays off until
memoryis set. - Once it is on, retrieval-induced forgetting, feeling of knowing, schema encoding, source-confidence decay and emotion regulation run. Involuntary recall, reconsolidation and temporal gist stay off until the host turns them on.
- Stored traces carry a neutral emotional context unless the host opts in.
- Text goes to an embedding provider only when
memory.embeddingnames one. Withmemoryset and none named,souledAgent()refuses at open with a message naming the option. - The end user's id goes to the model provider only when the host opts in.
memory.consolidation.enabledis refused on a souled agent, and nothing derived from one person is filed in an agent-wide scope.- On a souled agent, the manager skips the brain-wide load of the newest 1,000 traces; each session loads its own person's key.
- Cognitive memory stays off until
- Minors. A host marks a minor with
minor: trueon itsmemoryPolicyanswer. On an'until-deletion'store that person's session files no long-term memory; profiling is off for them; their text is compiled only by a compile provider the host names for minors. - Erased people stay erased. The tombstone ledger matches a person against both its unkeyed and keyed entries. Then, on a store whose ledger holds no unkeyed entries, opening a second person's session without a
tombstoneKeyis refused; a store whose ledger already holds unkeyed entries opens with one warning through the host's logger. - Stores that already hold memory are not rewritten. Traces filed before the change keep the soul's recall, a marker says which side filed each trace, the mechanisms never act on soul-filed traces, and nothing stored is embedded at upgrade. A GMI
memory.storea caller passes tosouledAgent()stays open for forget, export and correction only; one log line counts it; a copy call with a dry run moves it across person by person. - The store on the host's own database. A new
souledAgent()option takes a host's@framers/sql-storage-adapteradapter, with a ledger database or schema of its own and an independent ledger copy. The file in the soul's folder (src/api/souledAgent.ts L640) stays the default. - Which entry point to use. A docs page that says what
souledAgent(),gmi({ soul })andagent({ soul })each give, and which call reaches which memory. It ships first for the code as it stands and is rewritten with the release. - Releases. The code ships as one minor (0.20.0 unless another minor ships first), and
souledAgent()'s default runtime stays'legacy'in it (src/api/agent.ts L400-L405). The next minor makes'gmi'with thelightprofile the default, with its own upgrade note and tests on both runtimes;runtime: 'legacy'stays.
Related: #759 (closed: one identity mapping and memory scoped per user), #754 (open: GMI recall with a settable budget and a per-turn record).
Spec or design
The spec is written next. The public design lands in docs/SOUL_FILES.md and docs/GMI.md with the first code pull request.
Today's behaviour:
- What Applies on Each Path, docs/SOUL_FILES.md L390-L411
- The eight mechanisms, docs/GMI.md L552-L574
souledAgent(), docs/getting-started/HIGH_LEVEL_API.md L1097
Plan
The code lands on the branch feat/souled-gmi-one-memory, one pull request a task in the order of the task list below, and merges into master as one release.
Screens and pictures
No visible change: a library API and its docs pages. The new page is Markdown in the docs site's existing layout, one entry in docs/publication-manifest.cjs.
Docs to change
- A new which-to-use page, added to docs/publication-manifest.cjs. For each soul path it gives: what is stored, where, under which key, for how long, which derived data exist, who receives text, and which call exports, corrects, restricts and deletes.
- docs/SOUL_FILES.md:
- docs/GMI.md:
- the defaults on a souled agent beside the eight mechanisms;
- the end user's id and
memory.embedding(L169-L170); - that decay, retrieval-induced forgetting and gists delete nothing.
- docs/getting-started/HIGH_LEVEL_API.md, the
souledAgent()section:- the new options;
forgetUser,exportUserMemory,correctUserMemoryandsweepRetentionnamed wheresouledAgent()is introduced;- the scheduled
sweepRetention()recipe for a server that never callsclose().
- docs/safety/MEMORY_HOST_DUTIES.md: what each call reaches, the outside recipients of a person's text, minors, and what the host owns (encryption at rest,
secure_deleteoutside SQLite). - Upgrade notes for both releases.
- docs.agentos.sh lags the repository. On 17 Nov 2026, https://docs.agentos.sh/features/memory-host-duties answered 404, and the served high-level API page named
forgetUserbut notexportUserMemory,correctUserMemory,tombstoneKeyorsweepRetention, which the repository's page holds. The fix is in framerslab/agentos-live-docs, which builds the site from the manifest.
Tasks
- [x] Docs now: the which-to-use page for the code as it stands; the docs site's missing page and sections (#864, framerslab/agentos-live-docs#53)
- [x] Docs now: the soul.md links and the calibration tip in docs/SOUL_FILES.md (#864)
- [x] The store hand-over, the per-person key resolver, one write a turn, the two recall paths, the per-subject load (#899)
- [x]
memoryPolicy,screenandsharedMemoryon the GMI filing path, then the TypeError removed;profiling: 'off'andminor: true(#899) - [x] One deletion core for forget, correction and the retention sweep, with its report; the export's derived fields; the list of outside recipients (#899)
- [x] The defaults on a souled agent: mechanisms, the correction rule, neutral emotional context, a named embedding provider, the end user's id by opt-in, consolidation refused, nothing person-derived in agent-wide scopes (#899)
- [x] The tombstone ledger matching both forms, then the open-time key rule (#869)
- [x] Existing stores: the filed-by marker, the passed GMI store kept within reach, the copy call and its dry run (#899)
- [x] The host adapter option with its ledger checks (#871)
- [x] A per-turn screen of the user's input before the reply, and a session's start and elapsed time on the session object, where either is missing (#868)
- [x] Integration tests in CI, the upgrade note, the docs rewritten; the minor released (#899)
- [x] The next minor:
'gmi'assouledAgent()'s default runtime with thelightprofile, its upgrade note and tests on both runtimes (#900)
Done when
- Integration tests of the real path pass in CI:
- two people on one store;
- a forget in mid-session, with learning off, leaves no row of that person in
memory_traces, the archive, the graph, or the full-text and vector indexes, and a reopened session recalls nothing of them; - an export holds a person's turns, a gist and a typed fact, and nothing of a second person;
- a corrected trace that has a gist and a typed fact comes back as the correction, never the old text;
- a one-day retention with the clock moved two days leaves nothing;
- no mechanism crosses between two people on one store, and agent-wide scopes hold no person-derived text;
- the ledger matches both forms, and a second subject without a
tombstoneKeyis refused on a clean ledger; screenandmemoryPolicywork onruntime: 'gmi';- a minor on an
'until-deletion'store files no long-term memory; - the copy call's dry run;
- both runtimes, and the file and adapter backends.
- If the joined store cannot pass these tests, the release instead refuses cognitive memory on
souledAgent({ runtime: 'gmi' }), so no souled agent runs two memories. - The minor is on npm, and docs.agentos.sh serves the which-to-use page, the duties page and the
souledAgent()calls.
Release 1 is out: @framers/[email protected], from #899 (release notes, with the upgrade note under its breaking changes). The task lines it finishes are ticked above. souledAgent()'s default runtime stays 'legacy' in it; the last task line, the next minor that makes 'gmi' the default, stays open, and so does this issue.
Two lines under "Done when" name a gist and a typed fact. A souled agent makes neither, so the release meets them this way:
- An export holds a person's turns, a gist and a typed fact. A souled agent refuses consolidation (
memory.consolidation.enabled: truethrows at open), so nothing writes a gist, and it extracts no typed facts from what a person says. The export'sheld.typedFactsis always empty and says so in the docs. The tests plant an archived original for a person's trace and assert the export lists it underheld.archivedOriginals, with nothing of a second person, and that no typed fact exists. - A corrected trace that has a gist and a typed fact comes back as the correction. The tests correct a trace that has an archived original, a graph node and a compiled page: the old text is gone from the store, the mind, the archive, the pages and the open sessions, and recall returns the correction. A restore from before the correction brings back neither the old text nor loses the correction.
The other lines are covered by the integration tests named in the pull request's QA record, which ran on SQLite and PostgreSQL in the release's own suite (run 45222030268).
Release 2 is out: @framers/[email protected] is on npm as latest, built from #900's merge b5590109. Release notes: https://github.com/framerslab/agentos/releases/tag/v0.21.0
souledAgent()with noruntimenow runs on the GMI runtime with thelightprofile.runtime: 'legacy'keeps the legacy runtime, andagent()keeps its own default.- The upgrade note is under Breaking changes in the release notes and in the "Upgrading" section of docs/SOUL_ENTRY_POINTS.md.
- With 0.20.0 (#899), every task line above is done.
The review of #900 found two older defects on the GMI runtime, each with its own fix in progress: #901 (an agent's responseSchema is not read) and #902 (a turn stopped after its last step still files its exchange in cognitive memory).