Memory
Every memory system answers the same question: when an agent handles a message, how does it pull the right context at the right time? Publicus answers it in layers. Each layer differs in two ways: where the memory lives, and how it reaches the model. Short-lived context is loaded automatically every turn; durable knowledge is stored once and recalled only when it is relevant.
This page explains the layers and how they fit together. For step-by-step wiring, see How to build an AI agent.
Memory is wired, not configured
Section titled “Memory is wired, not configured”In Publicus, memory is a node on the canvas, not a setting on the Agent. The memory nodes (Chat Thread, Governed, Summary) live under AI in the node picker. A memory node sits beside the Agent node and connects its output to the agent’s MEMORY handle: the stacked discs on the Agent node’s bottom edge, second of its four icons, between the Tools handle (wrench) and the Model handle (chip). On every turn the agent asks each connected memory node for context before calling the model (recall), and hands the exchange back afterwards (record).


Double-click any memory node to open its settings; every field also accepts an expression, so identities and tags can come from the run’s data.
This has three consequences:
-
An agent with no memory node is stateless. Each run starts from a blank slate.
-
Memory is visible. Anyone reading the flow can see exactly what the agent remembers and where it comes from.
-
Memory composes. You can attach more than one memory node to the same agent (for example a Chat Thread for the conversation plus a Governed memory for durable facts), and their contributions are combined in connection order.


The layers at a glance
Section titled “The layers at a glance”| Layer | What it holds | How the agent gets it |
|---|---|---|
| Instructions | The agent’s standing rules and persona | Always in context, every turn |
| Conversation | Recent turns of the current conversation, verbatim | Loaded automatically every turn |
| Summaries | Older conversation, condensed | Folded into the conversation and into durable memory |
| Governed memory | Durable facts, constraints, decisions, preferences | Recalled by relevance each turn |
| Knowledge bases | Reference documents you ingested | Searched on demand via a tool |
| Cross-tool memory | The same governed memory, from outside Publicus | Read and written over MCP |
The layers stack. A production agent typically uses instructions plus a conversation layer, and adds governed memory once it needs to remember things across conversations.
Instructions: what is always in context
Section titled “Instructions: what is always in context”The Agent node’s system prompt is the first layer of memory: rules, persona, and standing context that load on every single turn. Because it is always in context, it also always costs tokens, so keep it lean. Durable facts that are only sometimes relevant do not belong in the system prompt; store them in governed memory, where they are recalled only when they matter.
Conversation memory: Chat Threads
Section titled “Conversation memory: Chat Threads”A Chat Thread node gives an agent a conversation transcript. Messages are stored verbatim, with roles and token usage, keyed by a stable identity you configure on the node: channel, conversationId, and optionally userId. Before each model call the agent loads the most recent twenty messages of the matching thread; after a successful reply it appends the new user and assistant messages. The node’s Write policy select controls when that happens: EveryTurn (the default) writes inline, Queued defers the write to a background job.
The node’s Carry forward select decides what an earlier turn brings into the next. What was said (the default) brings the conversation alone. What was said and done also brings the tools each assistant turn called and what they returned, so an agent that works through its tools continues from what it found instead of looking it up again. It costs more tokens per turn, and it carries everything a tool returned forward, so never use it for a flow that answers the public.
Either way, the conversation keeps a record of which tools each turn called, for you to read. In What was said that record is the tool’s name and the arguments the agent gave it, with passwords, secret values and ask links masked, and without what the tool returned: that stays on the run. The agent never reads this record back.
This is short-term, high-fidelity memory: exactly what was said, in order, for the conversation at hand. You can inspect any transcript under Conversations, including per-message token usage and the tool calls of each assistant turn.


Summaries: keeping long conversations affordable
Section titled “Summaries: keeping long conversations affordable”Loading an entire long conversation into the model every turn would burn the context window. Publicus handles this with compaction: once a conversation has been idle for a while (one hour by default), the platform summarizes its older messages into a single summary message and removes the originals. The next time the conversation continues, the agent sees the summary plus the recent verbatim turns.
Compaction condenses the thread, but it does not erase it: the original messages are archived rather than deleted, so the exact wording of a compacted conversation stays findable through the search_conversations tool (see Cross-tool memory), even when only the summary remains in the agent’s window.
Compaction also writes a bridge: the summary is stored as a durable item in governed memory (tagged as a chat summary). That way the essence of a compacted conversation survives even outside the thread itself, and can surface later through governed recall.
There is also a Summary memory node that writes a short summary of every turn (queued, so it never slows the reply) and recalls the most recent summaries into the system prompt. Configure it with a namespace (the scope key its summaries are stored under) and optionally maxSummaries (how many recent summaries to recall; five by default). It is a lightweight option when you want rolling notes without the full governed pipeline.
Governed memory: durable, typed, reviewed
Section titled “Governed memory: durable, typed, reviewed”Governed memory is the long-term layer. Instead of raw transcripts it stores discrete, typed memory items:
- Fact — something true about the world or the business.
- Constraint — a rule the agent must respect.
- Decision — something that was decided and should stay decided.
- Pattern — a recurring approach that works.
- Failure — something that did not work, kept so it is not repeated.
- Preference — how a person or team likes things done.
Each item carries tags, an authority weight, a confidence score, and a validity window. Items can supersede older items, so memory evolves without losing its history.
Recall: the right items at the right time
Section titled “Recall: the right items at the right time”Attach a Governed memory node to the agent and configure it:
- Tags — a JSON array of tag strings, for example
["support", "policies"]. Tags are the primary filter: only items carrying at least one matching tag are considered, so an agent only ever sees the part of memory you scoped it to. - Query — an optional search string for semantic ranking. When omitted, the agent’s current prompt is used.
- Kinds — an optional JSON array to restrict by kind, for example
["constraint", "decision"]. - Limit — the maximum items injected per turn (ten by default, capped at fifty).
On each turn the node recalls the most relevant active items and injects them into the system prompt as a labelled block. Within the tag-narrowed set, relevance is a blend of three signals:
- Priority — how strongly the item should steer behaviour (0 to 10).
- Semantic similarity — how close the item’s meaning is to the query.
- Recency — newer items gradually outrank stale ones.
Writing: episodes, curation, and review
Section titled “Writing: episodes, curation, and review”Agents do not write directly into durable memory. After each turn the Governed node records an episode: a raw observation of what happened, deduplicated by content so a retry never writes the same observation twice. Curation then runs in the background (once twenty episodes are pending, and on a fifteen-minute sweep for the remainder): it extracts a candidate item from each episode, discards exact and near duplicates, and checks new items against existing ones for contradictions. A genuine contradiction either supersedes the older item (when the new one carries enough priority) or flags both for review; it never silently deletes anything.
An agent that serves many people can keep what it learns from each of them apart. The Governed node’s Keep memories about specific things separate setting says who a memory can be about: a memory about one person, customer, or ticket is read back only for that same one, and comparisons for duplicates and contradictions stay among memories the same people can read. See Memories about one person, customer, or ticket.
Crucially, everything an agent or model writes starts as a learned note: visible, searchable, offered only when it looks relevant, and never enforced. Only rules, items confirmed by a human (or imported from a trusted source), are given to the agent on every reply and enforced.


The review surface lives in the Data section:
-
Memory lists every item with its kind, statement, priority, what it is used as, review status, tags, validity, and supersession state, opening on the Active view (you can also filter by kind, Used as, review status, Needs review, Stale candidates, or In conflict). Each row’s menu carries its actions: Promote to instruction (confirms the item and makes it prompt-eligible), Reject (hides it from all recall and enforcement, kept for audit), and Expire (ends its validity window now, so it leaves recall and stays in history). Open an item and a read-only Recall traces table at the bottom shows where it was recalled, with the source (agent or MCP), the run, and the rank and component scores it earned.




-
Memory → Inbox is the curation inbox, showing each episode’s content, status, and when it was recorded. Pending episodes carry Promote and Reject actions, individually or as a Promote selected batch.
Memory also flags its own dead weight. A low-authority evidence item that has not been recalled for around ninety days is automatically marked as a stale candidate, which is what the Stale candidates filter surfaces. The flag is advisory: it never changes an item’s review status, and it clears itself as soon as the item is recalled again. A human decides whether a flagged item is retired.


This is the same human-in-the-loop pattern Publicus uses for tool approvals: the agent can learn continuously, but a human decides what it is allowed to act on.
Enforcement: memory that can say no
Section titled “Enforcement: memory that can say no”Constraints and decisions are not just context; they can gate a flow. The Enforce node (under Other in the node picker) is a regular control-flow node, not a memory attachment: wire it into the flow path ahead of any irreversible step you want governed memory to protect. Configure it with:
- Proposed action — the action or text to evaluate, for example the draft of an outbound message (typically an expression like
{{ $prev->content }}). - Tags — a JSON array narrowing which constraints apply; an empty array evaluates all of them.
- Fail on block — when enabled, a blocked decision stops the flow branch with an error.
The node’s output is a JSON decision: allow, warn, or block, plus reasons and the IDs of the violated items, so downstream nodes can branch on it.


Portability: memory items travel
Section titled “Portability: memory items travel”Governed memory is not locked to one environment. Memory carries Export and Import header actions, plus an Export selected bulk action for moving a chosen subset. Exports are plain JSON and never include embeddings; on import the vectors are recomputed locally, so items move cleanly between environments. Imported items arrive with the trusted imported status, which makes them instruction-eligible without further review, and items that duplicate an existing active item are skipped. Flow templates can also ship seed memory items alongside their graph, so a template can install with its policies already in place.


Knowledge bases: reference material, not memory
Section titled “Knowledge bases: reference material, not memory”A knowledge base holds reference documents you ingested: manuals, articles, transcripts, product data. In Publicus you build one with the RAG nodes (under AI in the node picker): Read a File as Text reads a source, Split Text chunks it, Embed turns the chunks into vectors, and Knowledge Base Insert stores them in a knowledge base (managed under Knowledge bases). The Knowledge Base Query node searches one, and because it is usable as a tool, you can connect it to an agent’s Tools handle so the agent can search the knowledge base itself mid-conversation.


A knowledge base answers “what does the documentation say?”. Memory answers “what did we decide, learn, or prefer?”. The distinction matters because the two are maintained differently: knowledge bases are rebuilt from sources, while memory accumulates and is curated. An agent can have both at once, and they attach differently: the knowledge-base Query node connects to the Tools handle, memory nodes connect to the MEMORY handle.
Cross-tool memory: one brain over MCP
Section titled “Cross-tool memory: one brain over MCP”Governed memory is not locked inside Publicus. The platform’s MCP server exposes three tools:
- recall_memory — search memory items with the same relevance ranking agents use. Takes
tags(required), and optionalquery,kinds, andlimit(1 to 50, default 10). Each returned item includes its statement, kind, authority, tags, and itsgradeandreview_status, so the caller can see an item’s trust posture. - record_memory — write a new observation (
content, plus optionalsource_typeandsource_idfor provenance, and optionaltags: the item made from it carries every tag given, so a memory node whose tags name one recalls it). It lands as a pending episode and flows through the same curation and review pipeline; recording identical content with the same tags twice within a week returns the existing episode with adeduplicatedflag instead of writing a twin. - search_conversations — search the verbatim conversation record, including messages that compaction has archived. Takes a
query(matched case-insensitively against the exact message text), plus optionalchannel,conversation_id, andfrom/untildate filters, and alimit(1 to 50, default 10). Each hit comes back word for word with its thread identity and timestamp, so “what exactly did we agree three weeks ago?” stays answerable even after the conversation has been summarized.
Any MCP-capable tool (Claude Code, Claude Desktop, Cursor, or your own application) can connect with an API token and share the same tenant-scoped memory your agents use. A fact recorded from your editor is recallable by a flow agent on its next turn, and vice versa. Because external writes go through curation and human review like everything else, cross-tool access widens who can contribute without weakening governance. Recalls made over MCP also show up in an item’s Recall traces table, marked with their mcp source.
See MCP access for connecting MCP clients to Publicus.
Choosing your layers
Section titled “Choosing your layers”- A simple chat agent needs a Chat Thread node. That covers continuity within a conversation, and compaction keeps long threads affordable automatically.
- An agent that works across conversations (a support agent, an operations agent) adds a Governed node: decisions and preferences persist no matter which conversation they came from.
- An agent with rules it must not break stores those rules as confirmed Constraints and places an Enforce node before its side-effecting steps.
- A team using multiple AI tools connects them over MCP so every tool reads and writes the same memory.
Related
Section titled “Related”- Chat Threads — the conversation memory store and its transcript viewer.
- Llm / Agent — the Agent node and its MEMORY handle.
- How to build an AI agent — wiring memory, tools, triggers, and replies end to end.
- Add human approval — the sibling human-in-the-loop pattern for tool calls.