Cross-session long-term memory
Long-term memory keeps the caller’s profile, expression preferences, stable facts, and durable interests for later sessions. Data is isolated by workspace and caller identity: workspaces, IM users, and embed visitors each maintain personal memory.
Enable and use long-term memory
- Workspace Admin/Owner: Settings → Long-term memory, enable the switch (off by default).
- Choose Explicit memory only or Automatic extraction; in auto mode, optional extraction model (empty = conversation model).
- In personal memory management you can disable memory for yourself; an enabled workspace does not force it on you.
- In conversation, state clearly what to remember, or add manually via memory management; verify in another session.
- Review pending confirmation entries regularly: confirm, edit, or reject inferences; delete what is no longer valid.
| Mode | Behavior |
|---|---|
explicit_only | Records only what is explicitly requested; no background LLM distillation |
auto | Additional background extraction from conversations, merged per delay and minimum interval |
memory_enabled=false on an agent disables memory read/write for that agent; omitted = inherit workspace settings. IM/Embed follow the linked agent’s memory preferences; the API key must be full-access for personal memory management APIs. The feature depends jointly on workspace, personal profile, and request context.
Manage memory
| Action | Usage |
|---|---|
| Add / edit | Maintain profile, preferences, facts, tasks, or interests; manual edit is no longer overwritten by auto extraction |
| Confirm pending | Inferred entry goes from pending to usable; unconfirmed = not injected into the prompt. If inference modifies an existing entry, the old one stays active until confirmation then replacement; expired inference → confirmation fails, refresh the list |
| Reject / delete | Cancel wrong or obsolete memory; rejection leaves an inhibition trace to limit re-extraction |
| Topic elevation | Promote a recurring subject to durable interest immediately; stop tracking a theme |
| Document preferences | See often-cited documents; remove a personalized search preference that is no longer useful |
| Immediate consolidation | Merge close entries, archive due tasks, without waiting for background job |
| Export / clear | Download your memory JSON, or wipe your memory data |
Items cover profile, preferences, facts, tasks, and interests. A new fact on the same topic may replace the old one. Disabling profile suspends use; delete or clear removes data. Categories and statuses in the Memory API.
Impact on answers and retrieval
The system injects profile, preferences, and interests as permanent context (length budget), and recalls facts and tasks relevant to the question. With a configured vector model, semantic recall ranks all identity entries by question relevance, without relative importance; with pgvector on PostgreSQL sorting is in-database, otherwise computed in the service. In intelligent reasoning, active search in memory and history. Memory only affects understanding and context choice, not knowledge base access rights.
With retrieval personalization enabled, themes help interpret the question and often-cited documents rerank. The conversation timeline shows memory-related steps. Background jobs track extraction cursor and pending state per session: short bursts, batch truncation, or restart do not lose messages. If model output stays invalid on a segment, up to three retries then skip the segment without auto re-extraction of the skipped segment.
Troubleshooting: memory not applied
| Symptom | Check |
|---|---|
| Memory not used | Workspace, personal, and agent switches; workspace or identity change |
| No auto extraction | write_mode, extraction delay/interval, model and background jobs |
| Inference has no effect on answer | Still pending; usable only after confirmation |
| Stops citing a document | Remove in document preferences; KB rights remain independent |
| Immediate consolidation merges nothing | skipped reason in response (few items, no candidates) |
Shared memory: team and agent
Besides each person's own memory, a workspace can keep shared knowledge. There are two scopes, each configured separately in "Settings → Long-term memory → Shared memory" (admin):
| Scope | Content | Who benefits |
|---|---|---|
| Team | Decisions, conventions, customer or project context | Every member of the workspace |
| Per agent | An agent's own rules and knowledge | Everyone who talks to that agent |
For each scope:
| Setting | Effect |
|---|---|
| Off | Nothing is read or stored (default) |
| On request | Only notes added by an admin, or asked for in a conversation, are stored: "Remember for the team: …", "Remember for this agent: …" (or « Retiens pour l'équipe : … », « Retiens pour cet agent : … ») |
| Automatic | In addition, background extraction proposes shared notes from conversations |
| Admin approval | Proposed notes wait for approval before being used; a rejected note is not proposed again |
| Maximum notes / notes per answer | The scope's capacity and how many relevant notes are added to each question |
Shared memory is independent of the personal memory mode: for example, keep personal memory explicit-only while letting the assistant propose team notes automatically. Notes written by an admin are standing rules, added to every answer; other notes are added only when they concern the question. They are shown to the model separately from personal memory. An agent with memory turned off neither reads nor writes shared memory.
"Manage shared notes" lets admins add, edit, approve, reject or delete notes; for the agent scope, pick the agent first. API: /api/v1/memory/shared/{workspace|agent}/items (Admin role, ?ref=<agent id> for the agent scope).
Projects and themes
Two independent options, in "Settings → Long-term memory → Projects and themes" (admin), give the assistant the big picture beyond single notes.
Projects. An admin creates a project (name, description) and may link an agent: every conversation with that agent is linked to the project. The assistant keeps a Markdown project brief (goal, decisions, current status, next steps, open questions), updated after conversations when "Update briefs automatically" is on. The brief can be edited by hand, regenerated from all conversations, and is added to the context of every conversation of the project. An agent feeds only one project; deleting a project keeps its conversations.
Automatic themes. Like Agent Memory's "scenes", the assistant groups the notes of a memory space (each person, and the team when the Team scope is on) into a few themes, each with a short summary. Regrouping happens at most once per configured interval (24 h by default) or on demand ("Regroup now"). Themes related to the question are added to the context. Everyone sees their own themes in their personal memory; admins see the team's.
| Setting | Effect |
|---|---|
| Projects / Update automatically | Turns projects on; updates briefs after conversations |
| Automatic themes / Maximum / Interval | Turns themes on; caps them per space; minimum time between two regroupings |
| Model for briefs and themes | Empty: the memory extraction model, otherwise the workspace's |
API: /api/v1/memory/projects (read for members, changes for admins), /api/v1/memory/themes (personal themes), /api/v1/memory/shared/workspace/themes (team themes, admin).
Long-term profile
Ported from Agent Memory (layer 3, "persona"), set under "Settings → Long-term memory → Long-term profile" (admin). Two independent options, off by default:
- Profile of each person: at most 2,000 characters, in four layers: base facts, interests, how to answer them, how they decide. It is written from the person's themes and memories, inventing nothing and keeping no sensitive data.
- Team doctrine: at most 1,200 characters. These are the principles, routines, decision rules and boundaries the team keeps to, drawn from team memory. Project-specific facts, versions and progress stay out. It needs team memory to be on.
When the text is written. A first time once the space holds at least 4 memories. Then after each batch of new memories (10 by default, configurable). Before a rewrite, a quick check compares the new memories with the current text. It only rewrites when they contradict it, change the scope of a rule or add a rule. When they only confirm it or add nothing durable, the text stays as it is, with no paid rewrite.
Where to see it. Everyone sees, corrects or erases their profile in "My memory". Admins handle the team doctrine in the settings. A text edited by hand is no longer rewritten automatically, until someone clicks "Regenerate". The profile and the doctrine are added at the top of every conversation's context.
API: GET/PUT/DELETE /api/v1/memory/persona and POST /api/v1/memory/persona/rebuild for one's own profile; the same routes under /api/v1/memory/shared/workspace/persona for the team doctrine (admin).
Workspace configuration
Workspace admin manages switch, extraction mode, and model in settings. Config in memory_config, read/updated via GET/PUT /tenants/kv/memory-config; full fields in the Memory API.
| Name | Type | Default | Description |
|---|---|---|---|
enabled | bool | false | Workspace switch |
write_mode | string | explicit_only | explicit_only / auto; other values treated as explicit_only |
extract_model_id | string | empty | Extraction model; empty = conversation model |
extract_delay_seconds | int | 90 | Delay after reply before extraction, merges nearby turns; 5–3600 |
extract_min_interval_seconds | int | 300 | Minimum interval between two extractions for one person; messages in interval deferred; max 86400 |
extract_instructions | string | empty | Workspace-specific extraction rules, max 1000 characters |
max_items | int | 200 | Active item cap per identity, max 2000; 0 = default |
interest_threshold | int | 3 | Sessions a theme must appear before durable interest, max 20 |
embedding_model_id | string | empty | Vector model for memory recall; empty = lexical match only |
vector_recall | bool | omitted = on | Semantic recall when vector model configured |
retrieval_conditioning | bool | omitted = on | Allow memory to influence question and document ranking |
The extraction model is for background synthesis; the vector model for matching with the question. Memory increases model calls; deleting a model referenced by memory config shows dependencies.
Implementation reference
internal/application/service/memory/: scope, extraction, recall, themes, document preferences, consolidationinternal/handler/memory.go,internal/router/routes_memory.go: personal APIinternal/types/memory.go: models, budgets, states, and configfrontend/src/views/settings/MemorySettings.vue,MemoryWorkspaceSettings.vue