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 5ffc6a5
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/GMI.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
@@ -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`, 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 `learning.agentKey`, which names the brain and the learners: `gmi()` throws at construction naming `learning` without the option, and naming `learning.agentKey` without the key (for durable memory with no learning, set `learning: { agentKey, mode: 'off' }`). 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' }`). 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
**`memoryProvider`.**`memoryProvider.getContext()` runs once per turn, within `memoryProviderOptions.timeoutMs`, and its text goes into every model call of the turn as a system message after the leading system messages, where the legacy path puts it. In the sessions of an agent with cognitive memory on, the cognitive memory supplies the context and `getContext()` is skipped; a warning at construction says so. `observe()` runs after each turn that ends without error, for the user's text and the reply, except a structured send whose answer fails to parse. The turn does not wait for it, and a failure to record the turn leaves the turn's result as it is; it is logged with `console.warn` on the provider's first failure and then at its 10th, 100th, 1000th and so on.
"gmi(): a SQL learning.store needs learning.agentKey, the stable id of the agent's learners; two agents on one store would otherwise be one agent to the learning layer.",
@@ -564,7 +570,7 @@ export function gmi(opts: GmiOptions): GmiHandle {
564
570
* memory generation: `agent.close()` closes it, and the next use opens the file again. A host's adapter keeps one
"gmi(): memory.store needs learning.agentKey, the stable id of the agent's brain and its learners; two agents on one store would otherwise be one agent to the learning layer.",
261
+
"gmi(): memory.store needs learning.agentKey, the stable id of the agent's brain and its learners; two agents on one store would otherwise be one agent to the learning layer."+
262
+
(hasSoul ? " This agent's soul has no agentId and no name: set agentId in SOUL.md's front matter, and the soul's id names the brain." : ''),
"souledAgent: the soul has no agentId and no name, and the agent has no name; set agentId in SOUL.md's front matter so the agent's memory has one stable id",
261
+
);
262
+
}
256
263
257
264
// The markdown memory/ is source of truth; the sqlite is the rebuildable index.
0 commit comments