agentos icon indicating copy to clipboard operation
agentos copied to clipboard

souls: one memory for a souled GMI, reached by forget, export, correction and retention

Open jddunn opened this issue 2 weeks ago • 2 comments

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 public memory.store option and gmi() on its own do not change.
  • Every per-person call reaches what the mind remembers. forgetUser, exportUserMemory, correctUserMemory, sweepRetention and 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 complete stays 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 correction and is never rewritten by gist or drift.
  • memoryPolicy, screen and sharedMemory work on the GMI runtime. They are wired into the GMI's filing path first (screen before 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. The memoryPolicy answer gains profiling: 'off' and minor: true.
  • Defaults on a souled agent.
    • Cognitive memory stays off until memory is 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.embedding names one. With memory set 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.enabled is 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.
  • Minors. A host marks a minor with minor: true on its memoryPolicy answer. 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 tombstoneKey is 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.store a caller passes to souledAgent() 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-adapter adapter, 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 }) and agent({ 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 the light profile 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:

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:
    • What Applies on Each Path (L390-L411);
    • the cross-model calibration tip (L489-L492) reworded;
    • the soul.md links at L4, L18 and L509 pointed at github.com/aeonfun/soul.md, the repository's current name, and the same link in src/api/agent.ts L397.
  • 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, correctUserMemory and sweepRetention named where souledAgent() is introduced;
    • the scheduled sweepRetention() recipe for a server that never calls close().
  • 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_delete outside 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 forgetUser but not exportUserMemory, correctUserMemory, tombstoneKey or sweepRetention, 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, screen and sharedMemory on the GMI filing path, then the TypeError removed; profiling: 'off' and minor: 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' as souledAgent()'s default runtime with the light profile, 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 tombstoneKey is refused on a clean ledger;
    • screen and memoryPolicy work on runtime: '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.

jddunn avatar Nov 17 '26 11:11 jddunn

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: true throws at open), so nothing writes a gist, and it extracts no typed facts from what a person says. The export's held.typedFacts is 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 under held.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).

jddunn avatar Nov 23 '26 17:11 jddunn

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 no runtime now runs on the GMI runtime with the light profile. runtime: 'legacy' keeps the legacy runtime, and agent() 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).

jddunn avatar Nov 23 '26 21:11 jddunn