Prompt, knowledge and memory
What the reply agent sees on each model call, how a conversation is scoped to products, how knowledge is found and cited, and how long-term memory about a person is stored and recalled.
The reply agent works from four kinds of context: instructions written when the session starts, team rules read again at the start of every turn, a window of the session’s own conversation, and whatever its tools fetch from knowledge, memory and the CRM during a turn.
What the agent sees
| Part | Content | When it is read |
|---|---|---|
| Role and rules | Answer only about the company’s products; search knowledge before stating a product fact; check memory; no pricing or financial arithmetic; end every turn by submitting a reply with an honest confidence, or by handing off; CRM records are the agent’s own assessment; short plain-text replies in the customer’s language | When the session is built |
| Recent history | The last 10 messages with this person, each with its time and marked as customer or team | When the session is built |
| Products | The products the conversation is about, with their names and descriptions (600 characters each), and an instruction to hand off questions about other products | When the session is built |
| Team rules | The rules from the AI Agent Behavior page: up to 10, of 280 characters each, under a header saying they never override the instructions above | At the start of every turn |
| Conversation | The last 40 messages of the session, including tool calls and results, with long tool results cut | Every model call |
Because team rules are read at the start of every turn, an edit on the Behavior page reaches a running session at its next turn. Older turns fall out of the 40-message window; the instructions tell the agent to use memory for them.
Product scope
When a session starts, the agent decides which products the conversation is about:
- Products whose Sends from accounts include the account that received the message narrow the list. With no such links, every product is in scope.
- If the person’s latest campaign run is still going, or started in the last 30 days, that campaign’s products narrow it further. Campaign products outside the list from step 1 are ignored.
The scope holds for the whole session. With every product in scope, the prompt has no product section. A knowledge search for a product outside the scope searches the scoped products instead, and listing products shows only the scoped ones. When exactly one product is in scope and it has its own model, the session runs on that model; see Models and evals.
Finding knowledge and memory
Knowledge documents and memories are stored with embeddings: lists of numbers that place a text by meaning, so that texts about the same thing sit close together. A search turns the question into an embedding the same way and returns the nearest stored texts.
The session's product scope was decided when it started. Every search stays inside it.
The search keeps scanning past rows its filters drop, so a busy index still returns 5 passages. PDFs are split page by page, so every passage knows its page. Changing the workspace’s embedding model re-embeds its documents and memories; until that finishes, passages and memories from the old model are left out of searches.
Sources
The passages a search returned are kept per session until the turn ends. When the agent submits a reply:
- the sources are the passages it named that were retrieved in this turn, or, when none of those are usable, the 3 closest passages it retrieved;
- each document page appears once;
- the list is cleared for the next turn.
Each source keeps the document, product and page. They are saved on the sent message or the Draft, which is where the source chips in the Inbox come from; a hand-off clears them without saving.
Long-term memory
Each person has a memory store that outlives sessions:
| Kind | Written by |
|---|---|
| Fact, plan | The agent’s Remember tool, one sentence each |
| Summary | Lead scoring, which keeps one rolling summary per person and replaces it on every run |
Remember embeds the sentence with the workspace embedding model. Without one, the memory is still saved and shows on the person page, but recall cannot find it.
Recall memory embeds the agent’s query and returns the person’s 5 closest memories that were embedded by the current model. Lead scoring reads the summary back as its existing note on the next run, so the summary carries what the agent learned from one scoring to the next.