Skip to content

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

chore: files changed gitbooks/features/memory.md

Steven Enamakela0dec0c68f5e
diff --git a/gitbooks/features/memory.md b/gitbooks/features/memory.md
index 7ffd9d4b31..c3e171a899 100644
--- a/gitbooks/features/memory.md
+++ b/gitbooks/features/memory.md
@@ -1,7 +1,8 @@
---
description: >-
- Memory v2: a pluggable engine that stores your documents, conversations and
- learnings, answers questions with citations, and keeps a brief for new chats.
+ Memory: a pluggable engine that stores your documents, conversations and
+ learnings, recalls what matters before every turn, and answers questions
+ with citations.
icon: brain
---
@@ -9,7 +10,18 @@ icon: brain
OpenHuman's memory lets the agent remember you across chats: what you are working on, what you prefer, what is in your documents. Memory is a feature of the app, not a hidden database. You pick who stores it, see what is stored, and delete anything.
-Open it from **Connections → Memory**. It has seven tabs (chips): **Engine**, **Ask**, **Explorer**, **Learnings**, **Conversations**, **Documents** and **Context**. The old `/brain` and `/settings/memory-engine` addresses redirect there.
+Open it from **Connections → Memory**. It has eight tabs (chips): **Engine**, **Ask**, **Explorer**, **Learnings**, **Conversations**, **Brain**, **Background** and **Settings**. The old `/brain` and `/settings/memory-engine` addresses redirect there.
+
+## How the agent uses memory
+
+Memory works around every turn, without the agent having to ask:
+
+- **Before the model answers**, OpenHuman logs what you said and recalls a short, token-budgeted *memory pack* for the turn: relevant learnings (and beliefs the engine has built from them), documents from your brain, this agent's earlier conversations and, briefly, other agents'. The pack is added to the model request for that turn only. It is never written into the chat, so the conversation itself stays exactly as you had it.
+- **After the answer**, the reply is logged together with a one-line result for each tool it used.
+- **When a long chat is compacted**, OpenHuman recalls what the folded-away turns covered and adds it to the summary that replaces them.
+- **In the background**, every few minutes, the engine builds beliefs from what was stored ("the user prefers short answers", "deploys happen on Fridays").
+
+The answer's memory chips show which stored items the pack cited. To see what a turn would get, open **Ask → Pack preview**.
## Engines
@@ -30,34 +42,36 @@ Pick one on the **Engine** tab. If you are signed out and have no CortexDB key,
## What gets stored
-### Documents
+### The brain: documents
-Add a **source** on the **Documents** tab. A source is one of:
+The **Brain** tab holds documents every agent shares, filed by source type: `pdf`, `markdown`, `notion`, `github`, `web`, and one per other source (`gmail`, `docx`, …). It shows how many documents each source holds, lets you search them, add one (pasted text or a file on your computer), and forget a whole source.
-| Kind | Target |
-| --- | --- |
-| `folder` | A folder on your computer |
-| `file` | A single file |
-| `link` | A web page |
-| `github` | A repository (`owner/repo`) |
-| `rss` | A feed URL |
-| `composio` | A connected integration (Composio toolkit) |
+Below that, **Synced sources** keep the brain up to date. A source is one of:
+
+| Kind | Target | Filed under |
+| --- | --- | --- |
+| `folder` | A folder on your computer | `pdf`, `web` (HTML) or `markdown` by file type |
+| `file` | A single file | as for a folder |
+| `link` | A web page | `web` |
+| `github` | A repository (`owner/repo`) | `github` |
+| `rss` | A feed URL | `web` |
+| `composio` | A connected integration (Composio toolkit) | the toolkit (`notion`, `gmail`, …) |
Sources sync when you press sync and on a schedule you set per source. An unchanged file that syncs again is not stored twice. Removing a source can also forget the items it produced.
### Conversations
-After a few committed turns in a thread, or once a thread has been idle for a while, OpenHuman stores the recent turns as one conversation item. Defaults are every 4 turns or 120 seconds idle; change them on the **Conversations** tab, which also lets you turn it off. Tool calls are stored by name and id only, never their arguments. Anything still buffered is flushed when you quit the app, within a short time limit.
+Every turn is logged as it happens: your message before the model runs, the reply after. Each agent's turns are kept apart. Tool calls are stored by name and id with a one-line result, never their arguments. Turn logging can be switched off on the **Conversations** tab, which also lists each agent's stored turns.
### Learnings
-A learning is one durable statement: a preference, fact, procedure or correction. The agent saves them with its `memory` tool (`learn` action), and you can add or delete them on the **Learnings** tab.
+A learning is one durable statement: a preference, fact, procedure or correction. The agent saves them with its `memory` tool (`learn` action), and you can add or delete them on the **Learnings** tab. Beliefs the engine built are listed there too, marked **Built belief**.
Everything is scrubbed for secrets and personal identifiers before it leaves your machine.
### Past conversations
-Chats from before automatic saving was turned on are not in memory until you sync them. The **Conversations** tab shows how many chats and turns are still unsynced; **Sync past conversations** uploads them (after you confirm) in the same form as new conversations, without tool arguments. You can close the page while it runs, and syncing again later only sends what is new.
+Chats from before turn logging are not in memory until you sync them. The **Conversations** tab shows how many chats and turns are still unsynced; **Sync past conversations** uploads them (after you confirm) in the same form as new turns, without tool arguments. You can close the page while it runs, and syncing again later only sends what is new.
## Exploring what memory holds
@@ -67,30 +81,29 @@ On a very large memory the counts may cover only the items scanned so far; the t
## Each agent's own memory
-Memory is shared where it should be and private where it should be:
-
-- **Shared (root).** What the main assistant learns, your synced documents, and your imported and past conversations. Every agent can read it.
-- **One node per agent.** Every other agent (a specialist, a team member, an agent you run through OpenHuman as a library) keeps its own learnings, documents and conversations in its own node. A sub-agent's node sits under the agent that started it, and a team member's under its team, so teammates share the team's node.
+Memory is organised the way a team works:
-An agent reads its own memory and everything shared above it, never another agent's. When an agent learns something everyone should know, it stores it as shared (`learn` with `share: true`). Each agent also gets its own `context.md`, built from what it can read.
+- **Shared by every agent:** learnings and the brain.
+- **Each agent's own:** its conversations. The pack an agent gets leads with its own history; other agents' turns appear only briefly.
+- **Teams and tenants:** an agent team gets a memory of its own, below its own root (`team:<id>`), apart from everyone else's.
-In `config.toml`, `[memory] root_agents` lists the agents that use the shared node (the main assistant by default), and `[memory.agents.<id>]` can pin an agent to a particular node (`namespace = "project:q4"`), stop it reading shared memory (`inherit = false`) or switch its `context.md` off (`context = false`). A document source can be stored at an agent's node with its `namespace`. In the **Explorer**, group by **Memory node** to see what each agent holds.
+By default an agent's memory id is its definition id. In `config.toml`, `[memory.agents.<id>]` can give a definition another memory id (`agent_id`), another root (`root`), or switch its per-turn pack off (`recall = false`). A host that runs OpenHuman agents as part of something larger (an AI company, a multi-agent product) binds each agent to its own memory: `[memory] agent_id` and `root` on that agent's config, or `AgentSpec::memory(MemoryBinding::new("employee-7").root("team:acme"))` through the [embedding library](../developing/embedding.md).
## The agent's memory tool
The agent has one tool, `memory`, with four actions: `recall`, `fetch`, `learn` and `forget`. OpenHuman's own [MCP server](../developing/mcp-server.md) exposes the same abilities to other apps as `memory.recall`, `memory.fetch`, `memory.list`, `memory.learn` and `memory.forget`.
-## context.md
+## Settings and background work
-Every six hours (and on demand from the **Context** tab) OpenHuman asks the engine for a short brief about you: who you are, active work, preferences and standing instructions, recent important events, plus your learnings. It is saved as `<workspace>/memory/context.md`, trimmed to a token budget (default 2000), and placed at the start of **new** chats only. Every other agent gets its own brief from its own memory plus what is shared with it (`<workspace>/memory/context/agent-<id>/context.md`); pick the agent's memory node on the **Context** tab to read or regenerate it. A chat you resume keeps the prompt it started with, so it does not see a newer brief. Interval, budget and an on/off switch are on the **Context** tab.
+The **Settings** tab sets the pack's shape: on or off, its size in tokens, how many learnings, documents and turns it holds, and how often beliefs are built. The **Background** tab lists queued belief builds and recent runs, with **Run now**. With the TinyHumans engine, beliefs are built on the service's own schedule.
## Importing your previous memory
If OpenHuman finds memory from the earlier (v1) version, the Memory page offers a one-time import. It uploads that data to the engine you selected, so it only starts after you explicitly consent. It resumes if interrupted.
-## Removed in v2
+## Removed
-The memory tree, graph view, goals list, people and contacts, learning profile, `MEMORY.md` and `PROFILE.md`, the Obsidian vault, the local TinyCortex engine and the Supermemory, Mem0, Cognee and agentMemory engines are gone, as is engine migration. See the [spec](https://github.com/tinyhumansai/openhuman/blob/main/docs/specs/memory-v2.md).
+The memory tree, graph view, goals list, people and contacts, learning profile, `MEMORY.md` and `PROFILE.md`, the Obsidian vault, the local TinyCortex engine and the Supermemory, Mem0, Cognee and agentMemory engines are gone, as is engine migration. The compiled `context.md` brief is replaced by the per-turn memory pack. See the [spec](https://github.com/tinyhumansai/openhuman/blob/main/docs/specs/memory-v2.md).
## See also