Memory
Personal and team memory in chat — the curated document, dated notes, how the agent writes and recalls them, and where you manage them
Memory
Chat agents in MCintelligentplus keep memory: durable context that survives past a conversation and is loaded into every relevant turn. Memory lives in two scopes, and each scope stores two layers — a curated document the agent maintains, and dated notes the agent appends as it learns durable facts.
Two scopes: personal and team
| Scope | Who it belongs to | Who can see it |
|---|---|---|
| Personal | One user | Only that user — private |
| Team | One workspace | Every member of the workspace |
The conversation decides the scope, and the model never names a user or a workspace: a tool call in a private conversation reads and writes the caller's personal memory, and a tool call in a shared conversation targets that workspace's team memory. A call from workspace A can never touch workspace B, and personal memory is never written from someone else's thread.
Two layers: the curated document and notes
The curated memory document is a single Markdown document per scope that
the agent owns. The agent rewrites it with update_memory; every write is
validated against the size limits (currently 18,000 characters soft, 25,000
hard). When a write would cross the hard limit, the platform runs a compression
rewrite first, so the document cannot grow without bound.
Notes are short, dated, append-only entries. The agent appends one note
per fact with remember, and every note records the UTC day it was written
and its position within that day. Notes are long-term by design — nothing
expires, nothing is purged, and the nightly consolidation below only marks a
note as folded into the curated document. You can still delete an individual
note from the notes list if you want it gone.
How the agent writes and recalls memory
| Tool | What it does |
|---|---|
update_memory | Rewrites the curated document of the thread's scope (validated write: size limits, forced compression above the hard limit) |
remember | Appends one dated note to the thread's scope. The same content on the same day returns the existing note instead of storing a second copy |
recall | Searches the scope's notes (semantic search with a keyword fallback) and returns the curated document alongside the matches, so the agent can avoid repeating what it already knows |
recall takes a query and a number of notes to return (default 8, at most 20).
Recent notes ride along with every turn
Before each turn, the injected system prompt carries the scope's curated
document plus a <recent_memory_notes> block with today's and yesterday's
notes (UTC dates), newest first. The block is capped at 4,000 characters;
when it overflows, whole notes are dropped from the oldest end.
The notes block is one of the protected system-prompt prefixes, so context compaction preserves it verbatim: a note written earlier today is still in front of the model after the conversation has been summarized. If notes cannot be loaded, the turn proceeds with the existing memory block — note injection never blocks chat.
Nightly consolidation and the pre-compaction flush
Two maintenance paths keep the layers in sync. Neither one deletes anything.
Nightly consolidation folds notes older than a week (the default minimum
age) into the curated document. Each night the platform collects the
unconsolidated notes per scope and asks the deployment's default chat model
for the full updated document — the current document merged with the notes,
each note rendered with its date. The result is saved only through the same
validated path as update_memory (same limits, same forced compression), and
the included notes are then marked as consolidated; they stay searchable
afterwards. A group that fails leaves every one of its notes unmarked, so the
next night retries, and per-run caps (50 groups, 200 notes and 20,000
characters per group) leave any remainder for the following night.
Consolidation never rewrites or removes a note.
The pre-compaction flush captures a conversation's state just before it is
summarized to free context (see
Context Management). The platform asks
the model for one short note — at most 500 characters, covering what the
conversation is about and its open threads — and appends it to the thread's
scope, at most once per compaction event. The flush only appends notes: it
never rewrites the curated document and never calls update_memory. It is
best-effort — guarded by a 5-second timeout, and any failure just logs while
summarization proceeds. It is on by default; set SURFSENSE_MEMORY_FLUSH to
false (or 0 / no / off) to disable it.
Memory is long-term. Nothing in the memory system expires: consolidation never deletes a note, notes stay searchable after they are folded into the curated document, and there is no retention window.
Where you manage memory
- Team memory — Workspace settings → Team Memory
(
/dashboard/<workspace_id>/workspace-settings/team-memory). The Curated memory tab edits the workspace's document; the Recent notes tab lists the workspace's notes day by day, with search (semantic, keyword fallback), per-note delete behind a confirm dialog, and Load older paging by day. Team memory is team-owned: any member of the workspace can read it and delete a note. - Personal memory — MEMORY.md. Open the
MEMORY.mdentry in the sidebar (it also appears in the knowledge base) for your private memory panel, with the same Curated memory and Recent notes tabs.TEAM_MEMORY.mdin the same list opens the workspace's team memory.
Safety
Notes are model-written and re-injected into every turn, so the pipeline keeps them small and contained. A note can only be a bullet: writes reject empty text, reject headings, strip control characters and cap each note at 2,000 characters; the injected block is capped again at 4,000 characters, dropping whole notes rather than truncating mid-note; and the block is injected inside the protected system-prompt prefixes that compaction must keep verbatim. Combined with scope binding — the model never supplies a user or workspace id — a note cannot surface in another user's or another workspace's conversation.
See Context Management for the summarization path the flush hooks into, and Admin Portal for the System jobs page where consolidation runs.