You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 2859e49
Browse filesBrowse the repository at this point in the historyBrowse files
fix(souls): one id for a non-Latin soul name, trace limit types, cleared call prompts and store outages
- soulAgentIdOf trims agentId and hashes a soul name the slug leaves empty,
so a non-Latin name keeps one id whatever the agent is named;
personaFieldsOf gives the same id
- reasoningTrace.maxEntries and maxMessageLength of the wrong type are
refused at load, naming the field
- a call that sets system, even to undefined, still closes with the
hard limits
- a learning store that did not open makes the learner key lookup reject,
so it is asked again instead of read as holding no learners
- docs and comments say a memory provider's recall and a planned call's
plan are system messages after the hard limits; README no longer says
a soul's voice is applied; the systemBlocks TSDoc says the soul still
loads and its limits close the prompt
Signed-off-by: jddunn <[email protected]>
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -79,7 +79,7 @@ Three things accumulate across a session and compose into behavior: **memory** (
79
79
80
80
**HEXACO personality (optional).** Off by default. `agent()` writes the trait values into the system prompt as directives, one for each trait above 0.65 or below 0.35. A cognitive memory manager given the same traits scales its encoding and seven of its eight mechanisms by them, and an `AgentGraph` branches on a trait with `addPersonalityEdge()`. [HEXACO docs ->](https://docs.agentos.sh/features/hexaco-personality)
81
81
82
-
**Soul files.**Identity, voice, hard limits, and HEXACO scores can live in a `SOUL.md` workspace. Every way of building an agent applies them: the hard limits close the system prompt, and the soul's `agentId` is the agent's one id. Its `memory/` directory is a markdown wiki (an `index.md` catalog plus `entities/`, `concepts/`, `log/` pages with `[[wikilinks]]`) that *is* the agent's long-term memory: markdown is the source of truth, the vector/graph index is rebuilt from it, and [`souledAgent()`](https://docs.agentos.sh/getting-started/high-level-api) wires it end to end. [Soul Files ->](https://docs.agentos.sh/features/soul-files)
82
+
**Soul files.**An agent's identity, writing style, hard limits and HEXACO scores can live in a `SOUL.md` workspace. Every way of building an agent applies the identity and the hard limits: the hard limits close the system prompt, and the soul's `agentId` is the agent's one id. Its `memory/` directory is a markdown wiki (an `index.md` catalog plus `entities/`, `concepts/`, `log/` pages with `[[wikilinks]]`) that *is* the agent's long-term memory: markdown is the source of truth, the vector/graph index is rebuilt from it, and [`souledAgent()`](https://docs.agentos.sh/getting-started/high-level-api) wires it end to end. [Soul Files ->](https://docs.agentos.sh/features/soul-files)
Copy file name to clipboardExpand all lines: docs/GMI.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -106,7 +106,7 @@ Every profile keeps the reasoning trace. Sentiment tracking scores each user tur
106
106
107
107
| Persona field | From |
108
108
|---|---|
109
-
|`id`, `name`, `description`| With a soul: the soul's `agentId`, else the slug of its `name`, else a slug of the agent's `name` (an id derived from the soul's text when it has none of these); `name`, else the soul's `name`, else `Agent`; the soul's `role`, else the first line of `instructions`, else the name. With no soul: a slug of `name` (an id of its own for an agent with no name); `name`, or `Agent`; the first line of `instructions`, or the name |
109
+
|`id`, `name`, `description`| With a soul: the soul's `agentId`, else the slug of its `name` (`agent-` and a hash of the name for a name with no Latin letters or digits), else a slug of the agent's `name` (an id derived from the soul's text when it has none of these); `name`, else the soul's `name`, else `Agent`; the soul's `role`, else the first line of `instructions`, else the name. With no soul: a slug of `name` (an id of its own for an agent with no name); `name`, or `Agent`; the first line of `instructions`, or the name |
110
110
|`baseSystemPrompt`| The system prompt `agent()` sends ([`buildSystemPrompt()`](https://github.com/framerslab/agentos/blob/master/src/api/agent.ts): the soul file's body and style, `instructions`, the name line, the personality description, `skills`), or the joined `systemBlocks`; with `learning` on or a persona that has traits, without the personality description, which a GMI given a learner session (`GMIBaseConfig.learning`) sends as a system prompt of its own on each turn the session prepares, and renders itself from the persona's traits (`GMIBaseConfig.personaTraits`) on a turn it does not, as `gmi()` gives its GMIs both; a host that builds a GMI from this persona gives it both for the section on every turn, and a GMI with neither sends none ([Learning](#learning)) |
111
111
|`personalityTraits`|`personality`, else the soul's `hexaco`, as HEXACO traits |
112
112
|`hardLimits`, `moodAdaptation`, `reasoningTraceConfig`, `metadata`| The soul's `hardLimits`, `defaultMood` and `allowedMoods`, `reasoningTrace` and `metadata`; a front matter `voice` or `avatar` is left out with one `soul.field_ignored` log line |
@@ -137,7 +137,7 @@ A soul file's front matter is applied through the loader's one mapping, so the "
137
137
-**`memory.embedding`.**`{ provider, model?, dimension? }` picks the embedding model. Unset, the memory uses the global default provider (`setDefaultProvider()`) when agentos has an embedding model for it, else the first of OpenAI, Gemini and Ollama whose `OPENAI_API_KEY`, `GEMINI_API_KEY` or `OLLAMA_BASE_URL` is set, with that provider's default model (`text-embedding-3-small`, `gemini-embedding-2`, `nomic-embed-text`). Anthropic, Groq, Together AI, xAI, MiniMax and the Claude Code and Gemini CLIs have no embedding models in agentos, and `memory.embedding` naming one is refused when the agent is built. `dimension` is required for a model whose output size agentos does not know. Building the memory embeds one test text through the model. When no embedding model is found, or the model cannot answer (an Ollama model that was never pulled) or returns another size than the memory expects, the first session turn rejects with an error naming `memory.embedding`; a build that fails is retried on the next turn.
138
138
-**Consolidation.**`memory.consolidation.enabled: true` starts the manager's consolidation cycle, which runs every hour (`interval` is not applied, and a warning says so). A cycle reads the traces filed under the agent's persona id, while the sessions file theirs under their user and scope ids, so it finds none of them, and with no model invoker passed it writes no schema summaries.
139
139
-**`memory.persistAccessState`.**`false` turns off the manager's store keeping each trace's stability, access count and reinforcement schedule across a restart ([Access state across restarts](./memory/COGNITIVE_MEMORY.md#access-state-across-restarts)), for one release of before-and-after measurement; the default is `true`. Without `memory.store` the manager keeps its traces in process memory, so neither value changes what a session recalls.
140
-
- **`memory.store`.** Durable memory: `{ path }`, a SQLite file agentos opens, or `{ adapter, brainId? }`, a host's [`StorageAdapter`](https://github.com/framerslab/sql-storage-adapter), which agentos never closes. The manager files every trace into a [`Brain`](https://github.com/framerslab/agentos/blob/master/src/cognition/memory/retrieval/store/Brain.ts) there under the brain id `brainId`, else `learning.agentKey`, else the soul's id, loads the brain's newest 1,000 traces at its first read and, when a session opens, its learner's own two scopes, or for a session with no learner the two scopes of the session's own form, and keeps an archive over the same adapter for a gist's original; the learning store runs on the same adapter ([The trait row and the ledger](#the-trait-row-and-the-ledger)). An agent built again on the file recalls what its users said and renders the traits its learners have. It needs the learning option and a key that names the brain: `learning.agentKey`, or, with a soul, the soul's id (`agentId`, else the slug of its `name`). `gmi()` throws at construction naming `learning` without the option, and naming `learning.agentKey` without a key, with the advice to set `agentId` when the agent has a soul (for durable memory with no learning, set `learning: { mode: 'off' }` on an agent whose soul has an id, or `learning: { agentKey, mode: 'off' }`). The learners of an agent with no `learning.agentKey` are filed under `learning.learnerKey` when set, else under the soul's id. Learners already filed under the slug of the agent's `name` stay there: when the learning store holds learner rows under that slug and none under the soul's id, the slug stays the key and one `soul.id_fallback` log line says so. Set `learning.learnerKey` to make the choice yourself; `learning.agentKey` also names the brain, so do not set it for this. The memory files its own traces and the `persona` scopes (the agent's, and each user's) under the persona's id, which with a soul is the soul's id. A brain whose persona id was the slug of the agent's `name` keeps those traces under the slug, and an agent whose soul gives another id does not recall them; each user's `user` scope it still recalls. To keep recalling them, set the soul's `agentId` to that slug. A value that is neither shape, a blank `path` or `brainId`, or an `adapter` without the storage adapter's methods throws naming the field. A store that does not open fails the session's first send naming `memory.store`, before any model call, and the next send tries again. One process serves a SQLite file; several processes share a Postgres database instead, each through an adapter of its own. A PostgreSQL adapter reads BIGINT as numbers (`typeParsers: { int8: 'number' }`, as `Brain.openPostgres` opens its own): one that reads it as text fails the store's open, naming the option, since a trace's counts and times would load as strings. The manifest's `memory_store` loop names the store. A session id's memory survives a restart, and `agent.close()`; `session.close()` ends it for good, across restarts. The Brain keeps each id's generation in `brain_meta`, a row keyed `session_generation:` and the id's session form, which a session reads as it opens and its `close()` moves on: the id's next opening, in this process or another, files and recalls under a scope id of its own, and what the closed session filed stays in the store under the closed session's. An id no close has ended is at generation 0 and files under its plain session form, as a file written before generations were recorded holds it. Two processes that close one opening of an id at once record one next generation, and a close of an opening another process already ended changes nothing. A `close()` whose end the store does not record rejects naming `memory.store`; the id's next opening on the agent records it before its first turn. The thread notes a host's memory tools file for a session go under its generation too, so the id's next opening finds none of the closed session's with `memory_search`. A host hands an anonymous id to a new person by closing the old session or minting a new id.
140
+
- **`memory.store`.** Durable memory: `{ path }`, a SQLite file agentos opens, or `{ adapter, brainId? }`, a host's [`StorageAdapter`](https://github.com/framerslab/sql-storage-adapter), which agentos never closes. The manager files every trace into a [`Brain`](https://github.com/framerslab/agentos/blob/master/src/cognition/memory/retrieval/store/Brain.ts) there under the brain id `brainId`, else `learning.agentKey`, else the soul's id, loads the brain's newest 1,000 traces at its first read and, when a session opens, its learner's own two scopes, or for a session with no learner the two scopes of the session's own form, and keeps an archive over the same adapter for a gist's original; the learning store runs on the same adapter ([The trait row and the ledger](#the-trait-row-and-the-ledger)). An agent built again on the file recalls what its users said and renders the traits its learners have. It needs the learning option and a key that names the brain: `learning.agentKey`, or, with a soul, the soul's id (`agentId`, else the slug of its `name`). `gmi()` throws at construction naming `learning` without the option, and naming `learning.agentKey` without a key, with the advice to set `agentId` when the agent has a soul (for durable memory with no learning, set `learning: { mode: 'off' }` on an agent whose soul has an id, or `learning: { agentKey, mode: 'off' }`). The learners of an agent with no `learning.agentKey` are filed under `learning.learnerKey` when set, else under the soul's id. Learners already filed under the slug of the agent's `name` stay there: when the learning store holds learner rows under that slug and none under the soul's id, the slug stays the key and one `soul.id_fallback` log line says so. A learning store that does not open leaves the key unresolved, so the session has no learner session and the next open asks the store again. Set `learning.learnerKey` to make the choice yourself; `learning.agentKey` also names the brain, so do not set it for this. The memory files its own traces and the `persona` scopes (the agent's, and each user's) under the persona's id, which with a soul is the soul's id. A brain whose persona id was the slug of the agent's `name` keeps those traces under the slug, and an agent whose soul gives another id does not recall them; each user's `user` scope it still recalls. To keep recalling them, set the soul's `agentId` to that slug. A value that is neither shape, a blank `path` or `brainId`, or an `adapter` without the storage adapter's methods throws naming the field. A store that does not open fails the session's first send naming `memory.store`, before any model call, and the next send tries again. One process serves a SQLite file; several processes share a Postgres database instead, each through an adapter of its own. A PostgreSQL adapter reads BIGINT as numbers (`typeParsers: { int8: 'number' }`, as `Brain.openPostgres` opens its own): one that reads it as text fails the store's open, naming the option, since a trace's counts and times would load as strings. The manifest's `memory_store` loop names the store. A session id's memory survives a restart, and `agent.close()`; `session.close()` ends it for good, across restarts. The Brain keeps each id's generation in `brain_meta`, a row keyed `session_generation:` and the id's session form, which a session reads as it opens and its `close()` moves on: the id's next opening, in this process or another, files and recalls under a scope id of its own, and what the closed session filed stays in the store under the closed session's. An id no close has ended is at generation 0 and files under its plain session form, as a file written before generations were recorded holds it. Two processes that close one opening of an id at once record one next generation, and a close of an opening another process already ended changes nothing. A `close()` whose end the store does not record rejects naming `memory.store`; the id's next opening on the agent records it before its first turn. The thread notes a host's memory tools file for a session go under its generation too, so the id's next opening finds none of the closed session's with `memory_search`. A host hands an anonymous id to a new person by closing the old session or minting a new id.
141
141
142
142
**Recall capture.** A session's `send()` returns `memoryRecall` on its result for a turn that assembled a memory block: the record of what the turn recalled and which memories the block shows ([Recall Capture](./memory/COGNITIVE_MEMORY.md#recall-capture)). It holds ids, ranks, scores, counts and timings, never a memory's text or the query's. The manager `agent()` builds runs on the default capture, `'metadata'`.
Copy file name to clipboardExpand all lines: docs/SOUL_FILES.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -286,7 +286,7 @@ What a soul gives an agent depends on how it is loaded:
286
286
| Path | Soul prose and style in the prompt | Memory index in the prompt | Front matter applied (traits, mood, hard limits, `agentId`) | A recall block each turn |`read_memory_page` tool | Wiki compiled |
287
287
|---|---|---|---|---|---|---|
288
288
|`agent({ soul })`| Yes | Yes | Hard limits as the last block of the system prompt; the `hexaco` paragraph unless `personality` is set; the soul's `name` unless `name` is set. Mood, voice, avatar and reasoning-trace limits have no renderer here | No (only from a `memoryProvider` you pass) | No | No |
289
-
|`souledAgent()`| Yes | Yes | As `agent({ soul })`; the soul's id (`agentId`, else the slug of its `name`, else the agent's `name`) scopes the wiki's traces, and a soul with none of the three is rejected | Yes, from the wiki's store | Yes | Yes, on `close()` and by `agent.memory.compileWiki()`|
289
+
|`souledAgent()`| Yes | Yes | As `agent({ soul })`; the soul's id (`agentId`, else the slug of its `name`, which for a name with no Latin letters or digits is `agent-` and a hash of the name, else the agent's `name`) scopes the wiki's traces, and a soul with none of the three is rejected | Yes, from the wiki's store | Yes | Yes, on `close()` and by `agent.memory.compileWiki()`|
290
290
|`agent({ runtime: 'gmi', soul })`, `gmi({ soul })`| Yes | Yes | The persona's id, name, role, traits, mood, reasoning-trace limits and hard limits, the limits as the last block; `voice` and `avatar` are left out with one log line | With cognitive memory on, from cognitive memory; off, only from a `memoryProvider` you pass | No | No |
291
291
|`souledAgent({ runtime: 'gmi' })`, cognitive memory off | Yes | Yes | As `gmi({ soul })`; one id for the persona and the wiki | Yes, from the wiki's store | Yes | Yes |
292
292
|`souledAgent({ runtime: 'gmi' })`, cognitive memory on | Yes | Yes | As the row above | From cognitive memory; the wiki store's recall is skipped, with a warning, and its turns are still stored | Yes | Yes |
@@ -299,7 +299,7 @@ The exceptions:
299
299
- An inline soul (`{ content }`) has no workspace folder: `souledAgent()` builds a plain `agent()` with no wiki memory, no `read_memory_page` tool and no compile, and says so in one `console.warn` line.
300
300
- One-shot `generate()` and `stream()` on a GMI run the light profile, so they use the memory provider's recall, the wiki store's on a souled agent, even when sessions run with cognitive memory on.
301
301
- A seat of a launched team uses neither memory hook (no recall from the provider, nothing stored with it) and is refused the memory tools, `read_memory_page` among them.
302
-
- Hard limits are a block of prompt text every path renders last, after `systemBlocks` too. It tells the model; it is not a check that enforces the limits.
302
+
- Hard limits are a block of prompt text every path renders last, after `systemBlocks` too, with one exception: on a turn where a memory provider's `getContext` returns text (the wiki's recall on a souled agent), that text is a system message after the limits, and so is the plan of a call with `planning` on. It tells the model; it is not a check that enforces the limits.
303
303
- A `personality` or `name` option set in code wins over the soul's `hexaco` and `name`. The id is the exception: the soul's `agentId` wins over the agent's `name`, since the id keys the agent's memory and must not move when the agent is renamed.
304
304
-`gmi()` accepts guardrails, RAG and approval settings without applying them, and says so in one warning line at construction.
305
305
- A soul that fails to load throws `SoulLoadError` when the agent is built, unless it is given as `{ path, optional: true }` or `{ content, optional: true }`.
`IPersonaDefinition.hardLimits` (and `hardLimits:` in a SOUL file's front matter) renders as the last block of the system prompt on every path: every GMI turn for that persona, and every model call of `agent({ soul })` and `souledAgent()`, after `systemBlocks` too, under the heading "Hard limits", after everything the turn added and after every fragment of the persona's own prompt whatever priority it carries. The guards hold the same rules in code; the block tells the model.
447
+
`IPersonaDefinition.hardLimits` (and `hardLimits:` in a SOUL file's front matter) renders as the last block of the system prompt on every path: every GMI turn for that persona, and every model call of `agent({ soul })` and `souledAgent()`, after `systemBlocks` too, under the heading "Hard limits", after everything the turn added and after every fragment of the persona's own prompt whatever priority it carries. The exception: on a turn where a memory provider's `getContext` returns text (the wiki's recall on a souled agent), that text is a system message after the limits, and so is the plan of a call with `planning` on. The guards hold the same rules in code; the block tells the model.
448
448
449
449
A GMI built by `agent({ runtime: 'gmi' })` or `gmi()` has the block when its `soul` sets `hardLimits`: [`personaFromAgentOptions()`](https://github.com/framerslab/agentos/blob/master/src/api/runtime/gmiPersona.ts) takes them from the soul's front matter ([GMIs from agent()](../GMI.md#gmis-from-agent)). An agent with no soul has none.
0 commit comments