Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

docs: update documentation for engines, mascot, model routing, privacy mode, and token compression

Steven Enamakeldfdab439a172
diff --git a/gitbooks/developing/engines.md b/gitbooks/developing/engines.md
index e8aeb2d20f..0313c658c6 100644
--- a/gitbooks/developing/engines.md
+++ b/gitbooks/developing/engines.md
@@ -45,7 +45,7 @@ Routing](../features/model-routing/README.md).
## Embeddings
-Memory Tree embeddings route through a separate provider selection
+Embeddings route through a separate provider selection
(`embeddings.update_settings` over RPC, or `embeddings_provider` for
per-workload override), independent of the chat provider:
@@ -55,10 +55,8 @@ per-workload override), independent of the chat provider:
- **OpenAI**: cloud embeddings via the OpenAI API.
- **Cohere**: the Cohere embed API with your own key.
- **Ollama**: a local model the user has pulled, `bge-m3` recommended
- (`ollama pull bge-m3`). The Memory Tree's on-disk
- vector format is fixed at 1024 dimensions, so a smaller embedding model
- (`all-minilm`, 384 dimensions, or `nomic-embed-text`, 768) fails the
- dimension check at embed time.
+ (`ollama pull bge-m3`). Memory v2 does not use these; the memory engine
+ embeds on its own side.
- **Custom**: any OpenAI-compatible embeddings endpoint.
Implementation: `crates/openhuman-core/src/inference/embedding_host/` (`mod.rs`
@@ -67,118 +65,34 @@ lists the providers; `factory.rs` builds the client; `schemas.rs` defines the
## Memory
-The memory contract (`tinymemory-api`, vendored at `vendor/tinymemory/`)
-defines a driver-neutral `MemoryProvider` trait. Engines are built by
-`tinymemory::factory` (`list_engines`, `build_provider`), and
-`tinymemory::migrate::copy_all` copies a store from one to another: the keyed
-records, then whatever families both engines serve (document titles and tags,
-goals, the learned profile, the conversation history) and the ingested
-content, re-sent raw so the new engine rebuilds its own summaries.
+Memory v2 (`docs/specs/memory-v2.md`) is Recall, Fetch and Store over a
+pluggable engine. The contract is `tinymemory-api` (vendored at
+`vendor/tinymemory/`): a `MemoryEngine` trait with `recall`, `fetch`, `store`,
+`forget`, `list` and `health`, plus an `EngineDescriptor` that declares whether
+the engine is hosted, needs an endpoint or key, and which fetch modes it
+supports. `tinymemory::list_engines` and `build_engine` are the registry.
-What the user can pick (Settings > Memory Engine, or `openhuman.memory_engine_*`
-over RPC):
+Two engines ship, both from the `tinymemory-cortex` crate:
| id | what | endpoint | key |
| --- | --- | --- | --- |
-| `tinymemory` | the compiled local TinyCortex module (default, nothing leaves the device) | none | none |
-| `tinyhumans` | CortexDB hosted by the TinyHumans backend, billed in credits | the backend origin, forced | the signed-in session (or API key), read live on every call |
-| `supermemory`, `mem0`, `cognee`, `cortex`, `agentmemory` | the user's own service | from the form | from the form, kept in the OS keychain |
-
-The switch is applied in process: `memory::ops::engine` validates the request,
-stores any key under the keychain entry `memory-<id>`, writes
-`[subsystems.memory] driver` plus `drivers.<id>` (`class = "external"`,
-`transport = "http"`, `credential_ref = "keychain:memory-<id>"`,
-`trust_state = "trusted"` because the user chose it in the UI), and calls
-`memory::binding::rebind`, which drops the stale bindings, re-points the
-context and publishes `MemoryDriverChanged`. Bindings already held by a running
-agent session or the learning facet cache keep the previous engine until that
-session or the app restarts (derived contexts that keep the parent's memory
-config share its binding handle, so they follow a switch; one with its own
-`[subsystems.memory]` keeps that override). Every switch runs under one process-wide
-lock, `engine_set` is refused while a migration runs, and the commit reloads the
-config fresh and patches only `[subsystems.memory]`. Migration (`engine_migrate`) copies first and
-switches only after a clean copy; the source is never modified, and a failed
-run leaves the active engine alone. The job reports each step it runs
-(`step`, `steps`), and a step one engine cannot serve is skipped and named
-rather than failed. Re-sending content is the user's choice
-(`replay_content`, on by default, since hosted memory bills for what it reads
-again); a piece the new engine refuses is reported in the job's `note` instead
-of holding the switch back, because the old engine keeps it and its sync can
-bring it again. When the host syncs sources into the new engine itself (hosted
-memory), reader-based sources (`mem_src:` ids) are left out of the replay: the
-host's own sync sends them from scratch. A running copy can be cancelled (`engine_migrate_cancel`, between pages), is
-bounded by `OPENHUMAN_MEMORY_MIGRATE_TIMEOUT_SECS` (default 2 hours) and fails, not
-hangs, if its task panics. Records written while a copy runs may be missing from
-the new engine; the job result carries a `note` saying so, and this migration does not provide a second-pass delta copy. `OPENHUMAN_MEMORY_DRIVER` pins the engine and makes the switch RPCs
-refuse.
-
-`binding::admit` admits `tinymemory` (with `tinycortex` kept as a legacy
-alias), `null`, the first-party `tinyhumans` (no `drivers` entry, implicitly
-trusted) and any factory engine configured `class = "external"` with
-`trust_state = "trusted"`. An untrusted external driver, or an id the factory
-does not know, is still refused, and a build without the `memory-remote` gate
-refuses every external driver ("external driver transport is not implemented
-yet"). A driver that fails to build falls back to `null` with the reason
-surfaced in `memory.engine_get` and on the event bus, never silently. It falls
-back to `null`, not to the local module, so nothing is written locally while the
-user chose a remote engine; the UI says memory is paused. A construction failure
-(keychain locked, transport not installed yet) is retried on the next resolve after
-30 seconds; an admission refusal stays cached.
-
-On a remote engine the mandatory-surface fallbacks are bounded: recency reads at
-most two `export_page` calls of `min(limit*4, 200)` records, and the document list
-scans at most 10 namespaces and returns at most 200 documents with a `truncated`
-flag. The proper fix is a bounded `recent(namespace, limit)` on the tinymemory
-contract, an upstream follow-up. Hosted 402 and 401 errors from ordinary memory
-RPCs read `INSUFFICIENT_CREDITS:` and `SESSION_EXPIRED:` too; a 403 (a credential
-the engine refuses, such as an API key without the memory scope) reads
-`MEMORY_FORBIDDEN:` and never signs the user out, and a timeout, refused
-connection, 429 or 5xx that outlasts the retries reads `MEMORY_UNREACHABLE:`.
-
-Not every engine advertises every capability family, and the RPCs of a family
-an engine lacks answer a clean "does not support" error (see the
-[`memory/driver` README](../../crates/openhuman-core/src/memory/driver/README.md)
-for the full table).
-
-- **Hosted engine.** It serves `goals`, `tool_memory`, `documents`, `sources`
- (the sink connector sync writes to), `maintenance` (a health report),
- `retrieval`, `ingest`, `profile`, `episodic`, `scoring` and `tree`.
- Connector sync, goals, tool rules, documents, episodic memory and the learned
- profile work there, the memory doctor reports the hosted service's health,
- and the Brain graph draws the facts, beliefs and concepts the server derived
- from what was written.
-- **Direct CortexDB engine.** It serves none of those.
-- **Neither.** No remote engine serves `graph`, `chunks`, `entities`,
- `source_sync` or `coding_sessions`.
-
-Brain's sync panels (activity and history) need `sources`, its coding-sessions
-card needs `coding_sessions`, and the controls and status that work on a local
-chunk store (reset, rebuild, vault, pipeline status) need `chunks`. Each shows
-"Not available", or is left out, on an engine without its family. Hosted memory
-runs no source pipeline of its own, so the host syncs local folder, GitHub, RSS
-and web-page sources itself: it reads them and sends the items through the
-engine's sink, from the Sync button, Apply all, and a daily schedule
-(`memory/sources/hosted_sync.rs`, `hosted_periodic.rs`). The host records what
-the sink accepted, so a run sends only new or changed items and one stopped by
-its budget carries on where it stopped. A file removed from a synced folder
-stays in memory, and removing the source keeps what it synced, as on the local
-engine; deleting the source's memory forgets all of it.
-
-Hosted CortexDB ranks its recall without scoring it: a hit carries its rank and
-no signal (no similarity, keyword, graph, episodic or freshness), with or
-without the retrieval family. Auto-recall keeps such notes in the engine's
-order, its first three, behind the same gate that decides whether a message
-needs memory at all, and hybrid search keeps the engine's order. Situational
-preferences and the contradiction check need a measured similarity and stay
-empty there. Summaries need a model the hosted engine does not reach, so a
-segment's recap is the heuristic one. A lookup the engine refuses (out of credits, session not accepted,
-credential refused, unreachable) puts a one-line reason in the recall block
-instead of an empty result, so the model says memory is unavailable rather than
-that something was never stored.
-
-Related pages: [Memory](../features/memory.md) and its
-sub-pages for what TinyCortex actually does (memory tree, scoring, retrieval,
-git-backed diffs).
+| `tinyhumans` | CortexDB hosted behind the TinyHumans backend (`/memory/*`) | the backend origin | the signed-in session or API key, resolved per request through the host credential seam |
+| `cortexdb` | the user's own CortexDB (direct `/v1/*`) | `[memory.engines.cortexdb] endpoint` (default `https://api-v1.cortexdb.ai`) | stored in the OS keychain as `memory-cortexdb` |
+
+Select one with `[memory] engine` or from Connections > Memory > Engine
+(`openhuman.memory_engine_set`). `memory::engine::resolve` binds it: signed out
+with no CortexDB key means **memory is off** (the `memory` tool is not
+registered, ingestion is a no-op and RPCs answer `MEMORY_OFF`). Built engines
+are cached by a fingerprint of engine id, endpoint and credential identity, so
+changing any of them rebuilds the engine on the next call. There is no engine
+migration: switching engines starts empty, and the one-time import of a v1
+store uploads to whichever engine is selected, after explicit consent.
+
+Both engines declare `fetch_modes = [hybrid]` because the CortexDB recall wire
+has no keyword/vector switch; asking for another mode fails with `UNSUPPORTED`.
+
+Related pages: [Memory](../features/memory.md) and
+[Memory architecture](architecture/memory.md).
## Web search
diff --git a/gitbooks/features/mascot/README.md b/gitbooks/features/mascot/README.md
index f4614d755e..231d9df234 100644
--- a/gitbooks/features/mascot/README.md
+++ b/gitbooks/features/mascot/README.md
@@ -32,7 +32,7 @@ It is meant to feel alive, not animated-on-rails.
### It remembers you
-The mascot is the visible part of an agent that has the [Memory Tree](../memory.md) underneath it. It remembers what you've talked about, who the people in your life are, what's open on your plate, what's been decided, and what's outstanding, across every source you've connected. When it greets you in the morning, it isn't starting from zero.
+The mascot is the visible part of an agent that has [memory](../memory.md) underneath it. It remembers what you've talked about, what you prefer, what's in your documents and what's been decided, across the sources you've added. When it greets you in the morning, it isn't starting from zero.
That memory is what makes the personality consistent over weeks and months. The mascot you talk to today knows what the mascot you talked to last Tuesday knows.
@@ -42,9 +42,9 @@ Even when you've stopped typing, work can keep happening on your behalf: [schedu
### It dreams
-When you're away long enough, the mascot enters a dreaming state. Dreaming is the agent's offline consolidation pass, distilling the day's chunks into longer-horizon summaries, refreshing topic trees for the entities that have heated up, surfacing patterns that didn't fit any single source. The mascot animates differently while dreaming so you can tell at a glance: it's not idle, it's processing.
+When you're away long enough, the mascot enters a dreaming state. Dreaming is the agent's offline consolidation pass, where the brief in `context.md` is recompiled from what memory holds. The mascot animates differently while dreaming so you can tell at a glance: it's not idle, it's processing.
-When you come back, the dreams have already been folded into the Memory Tree. The mascot wakes up smarter than it went to sleep.
+When you come back, the refreshed brief is ready for your next new chat. The mascot wakes up smarter than it went to sleep.
## Why have a mascot at all?
@@ -59,5 +59,5 @@ The mascot exists because:
## See also
- [Native Voice](../native-tools/voice.md), the STT / TTS plumbing the mascot rides on.
-- [Memory Tree](../memory.md), what the mascot remembers, and how.
+- [Memory](../memory.md), what the mascot remembers, and how.
- [Chromium Embedded Framework](../../developing/cef.md), the camera-into-Meet pipeline (developer reference).
diff --git a/gitbooks/features/model-routing/README.md b/gitbooks/features/model-routing/README.md
index c08b53ea61..39d29438ce 100644
--- a/gitbooks/features/model-routing/README.md
+++ b/gitbooks/features/model-routing/README.md
@@ -37,7 +37,7 @@ The router wraps several pre-created providers (Anthropic, OpenAI, Google, Groq,
| `hint:reasoning` | A strong reasoning model | Multi-step planning, math, code-heavy turns |
| `hint:fast` | A fast/cheap model | UI helpers, autocompletes, small classification calls |
| `hint:vision` | A vision-capable model | Screenshots, image attachments, OCR |
-| `hint:summarize` | A model good at compression | Memory tree summary builders |
+| `hint:summarize` | A model good at compression | Background summarization |
| `hint:code` | A code-tuned model | Native coder turns |
| `hint:burst` | A high-throughput, low-cost model | Cheap, latency-tolerant work for high-fanout agents |
diff --git a/gitbooks/features/model-routing/local-ai.md b/gitbooks/features/model-routing/local-ai.md
index 9c4489febf..d42084ad66 100644
--- a/gitbooks/features/model-routing/local-ai.md
+++ b/gitbooks/features/model-routing/local-ai.md
@@ -75,8 +75,6 @@ The legacy `local_ai.usage.*` booleans are kept only so older configs migrate. T
| Workload | Configured by | Notes |
| ------------------------------------ | ----------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| **Chat, reasoning, coding, agentic** | `chat_provider`, `reasoning_provider`, ... | Any local prefix from the table above. |
-| **Memory embeddings** | `embeddings_provider = "ollama:bge-m3"` | Used by the [Memory Tree](../memory.md). Needs a 1024-dimension model; `bge-m3` fits. You pull it. |
-| **Summary-tree building** | `local_ai.runtime_enabled` + `local_ai.chat_model_id` | With local AI on, summaries fold on that Ollama model. With it off, they need `memory_tree.cloud_summarization_opt_in = true`. |
| **Learning / reflection** | `learning_provider` | `crates/openhuman-core/src/agent/learning/reflection.rs`. |
| **Vision** | `vision_provider`, `local_ai.vision_model_id` | Must be a vision-capable model. See [Local vision](#local-vision). |
@@ -123,7 +121,6 @@ Vision is a separate capability from chat, and most small local models cannot do
- **Provider will not save, or the model list is empty.** The runtime is not reachable at the endpoint. Start it and check the port. For Ollama, run `curl http://localhost:11434/api/tags`.
- **The runtime reports the model is missing.** The model is not pulled or loaded. Run `ollama pull <model>`, or load it in LM Studio, then retry.
-- **Embeddings fail with a dimension error.** The Memory Tree needs 1024-dimension vectors. Use `bge-m3`.
- **LM Studio on a different port.** Set `local_ai.base_url` or `OPENHUMAN_LM_STUDIO_BASE_URL`. Load the model in LM Studio before OpenHuman calls it.
- **Ollama context too small for agent turns.** Set `local_ai.num_ctx` to send `options.num_ctx` with each Ollama chat request.
@@ -131,6 +128,6 @@ Vision is a separate capability from chat, and most small local models cannot do
- [Use OpenHuman with a local model](../../guides/local-model.md). Step-by-step setup.
- [Local models & bring your own key](local-and-byok-models.md). Per-model capability table and BYOK setup.
-- [Memory Tree](../memory.md). What local embeddings and summarization power.
+- [Memory](../memory.md). Memory is stored by its engine, not by a local model.
- [Automatic Model Routing](README.md). How lightweight chat hints prefer the local provider.
- [Privacy Mode](../privacy-mode.md). Enforcing local-only inference.
diff --git a/gitbooks/features/model-routing/local-and-byok-models.md b/gitbooks/features/model-routing/local-and-byok-models.md
index e967ae5de1..05da671adc 100644
--- a/gitbooks/features/model-routing/local-and-byok-models.md
+++ b/gitbooks/features/model-routing/local-and-byok-models.md
@@ -62,14 +62,14 @@ This is the part that bites people. A model that only does text will still **acc
| `moondream:1.8b-v2-q4_K_S` | 1.7 GB | Minimal | **Yes** | No |
| `llava:7b` | 4.7 GB | Minimal | **Yes** | No |
| `bge-m3` | 1.2 GB | No | No | **Yes**, 1024 dim |
-| `all-minilm:latest` | 0.05 GB | No | No | 384 dim, too small for Memory Tree |
+| `all-minilm:latest` | 0.05 GB | No | No | 384 dim |
Two traps worth calling out:
- **Gemma 3 is split by size.** The 270M and 1B builds are text-only. Vision starts at 4B. Picking `gemma3:1b-it-qat` for vision gets you a text-only model.
- **`gemma3n` is not `gemma3`.** Despite the name, Gemma 3n is a separate, text-only model on Ollama. It is a fine chat model and a bad vision model.
-For embeddings, prefer **`bge-m3`**. The Memory Tree stores vectors in a fixed 1024-dimension on-disk format, so a 384-dimension model such as `all-minilm` or a 768-dimension model such as `nomic-embed-text` will fail the dimension check at embed time.
+For embeddings, prefer **`bge-m3`** (1024 dimensions). Memory v2 does not use local embeddings; the memory engine embeds on its own side.
### 3. Point OpenHuman at it
@@ -168,8 +168,6 @@ reasoning_provider = "anthropic:claude-sonnet-4"
**Vision answers look plausible but describe the wrong image.** You are almost certainly on a chat-only model. Check `vision_model_id` against the capability table above. Current builds refuse this routing and fall back to a vision-capable model, so this points at an older build or a provider outside the local path.
-**Embeddings fail with a dimension error.** The Memory Tree needs 1024-dimension vectors. Use `bge-m3`.
-
## See also
- [Local AI (optional)](local-ai.md). Supported runtimes, endpoints, and the opt-in flags.
diff --git a/gitbooks/features/privacy-mode.md b/gitbooks/features/privacy-mode.md
index 8139ad476e..4e3c94a2b4 100644
--- a/gitbooks/features/privacy-mode.md
+++ b/gitbooks/features/privacy-mode.md
@@ -48,7 +48,7 @@ Local-only mode is designed to work with [Local AI](model-routing/local-ai.md).
- Chat and reasoning on a runtime you run (**Ollama, LM Studio, MLX, OMLX**, or another OpenAI-compatible server), with the models you pulled, added as a provider under **Connections → LLM**.
- **Piper** text-to-speech, if you install the Piper binary and a voice yourself and set `PIPER_BIN`.
-- Local embeddings for [Memory Tree](memory.md) retrieval, for example `embeddings_provider = "ollama:bge-m3"` after `ollama pull bge-m3`.
+- Memory stays on a CortexDB endpoint you run yourself; the hosted TinyHumans engine is a cloud call and is blocked by local-only mode.
With local-only on, a workload routed to a runtime that isn't running, or to a model you haven't pulled, fails instead of falling back to the cloud.
diff --git a/gitbooks/features/token-compression.md b/gitbooks/features/token-compression.md
index 381723d732..698ed1692c 100644
--- a/gitbooks/features/token-compression.md
+++ b/gitbooks/features/token-compression.md
@@ -165,12 +165,12 @@ Everything lives under the `[tokenjuice]` config block (`crates/openhuman-core/s
Agents live or die by their context budget. A single working session can fan out across dozens of tool calls: greps, builds, test runs, `git` output, and large [web-fetch / scrape](native-tools/web-scraper.md) results the agent pulls down. TokenJuice sits on that tool-execution path and compacts each result before it lands in context, so an agent can sweep a noisy repo or a long web page without each step ballooning the window. The savings compound across a session and are metered in real dollars (see [Billing, Cost & Usage](billing-and-usage.md)).
-> **Scope note.** TokenJuice runs on the agent's **tool results**, not on the background [auto-fetch](memory.md) ingestion pipeline. The 20-minute sync that builds the [Memory Tree](memory.md) has its own canonicalization and chunking and does not route payloads through TokenJuice today.
+> **Scope note.** TokenJuice runs on the agent's **tool results**, not on [memory](memory.md) ingestion. Source sync converts documents itself and does not route payloads through TokenJuice.
---
## See also
- [Available Tools](native-tools/README.md): most heavy tool output flows through TokenJuice.
-- [Memory Tree](memory.md): the downstream consumer of compressed output.
+- [Memory](memory.md): ingestion has its own document conversion and scrubbing.
- [Billing, Cost & Usage](billing-and-usage.md): where token savings show up as real money.