Agent mode
Multi-step investigations, cross-referencing, and how the loop is confined.
By default a request is one model turn with up to eight tool steps. Agent mode runs a coding-agent style harness instead: the model plans, gathers evidence across every relevant system, chases leads, verifies, saves what it learned, and answers once.
Ask for it with "memtro": {"mode": "agent"}, a :agent suffix on any model id (auto:agent, memtro:agent, anthropic/claude-opus-5:agent), or make it the default under Dashboard → Routing → Agent mode. The Chat page uses it by default.
Chat and agent, side by side
| Chat | Agent mode | |
|---|---|---|
| Shape | One model turn | Plan, gather, verify, answer once |
| Tool steps | Up to 8 | The configured budget, 30 by default |
| Sub-agents | — | memtro_delegate, running in parallel |
| Scripts | — | memtro_run_script, a read-only code mode step |
| Cross-referencing | When asked | By default, for any question about a record |
| Routing floor | None | Never below level 3, the middle rung |
| Thinking | Provider default | Each provider's deep-thinking setting |
| Ends with | The answer | The answer, then one line per system consulted |
Chat is the right shape for "who owns the billing migration?". Agent mode is the right shape for "why is this customer unhappy?", where the answer is in five systems and nobody has said which five.
What the agent does
- Cross-references by default. A question about one record (a ticket, deal, invoice, order, customer, email) is treated as a request for the full picture. After fetching it, the agent pulls out every identifier and looks them up in the other connected systems: the CRM for the customer and company, databases for orders and accounts (schema first, then SQL), billing for invoices, email and calendar for prior contact, docs for the relevant policy.
- Works in parallel and delegates:
memtro_delegatehands self-contained sub-tasks to worker agents with the same tools. - Scripts the mechanical parts. Where the work is list, filter, count or join, the agent can write one short read-only script that makes the calls and returns only the answer, instead of twenty steps that each drag every record through the conversation. See Code mode.
- Chases leads. A result that points at a thread, page, ticket or file worth reading gets opened. Exact records are preferred to summaries, and a fact from a single source is cross-checked where another source could confirm it.
- Stops when more calls would not change the answer, rather than spending the budget because it has one.
- Saves durable facts it learned with
memtro_remember, never secrets. - Answers once, conclusion first, with where each fact came from, and ends with one line per system it consulted, including the ones that had nothing.
Where the request is ambiguous but answerable under a reasonable assumption, the agent states the assumption and proceeds rather than stopping to ask — a question that comes back after four minutes of investigation is worse than an answer with its assumption on the front.
Delegates
A delegate is a worker agent with the same tools and a budget of its own, twelve steps by default. It has no memory of the conversation, so the lead agent has to hand it everything it needs in the task text — which is deliberate: a worker that could see the whole thread would drag the whole thread through its context window on every call.
Workers report back findings first, with the system and record ids behind them, then what they could not find. Several run at once when the sub-tasks are independent, which is how a sweep of eleven connected systems finishes in the time two of them would take in sequence.
Settings
Under Organisation → Routing → Agent mode (or a team's or your own, on Team → Routing and Profile → Routing):
| Setting | What it does |
|---|---|
| Request mode | Whether a plain request is a single reply or the multi-step agent. |
| Step budget | Tool steps per request, 30 by default. There is no upper limit: a long investigation is bounded by the request's own timeout, and a ceiling here would only cut off work somebody deliberately asked for. |
| Delegate model | What runs sub-tasks. Defaults to the request's own model; a cheaper one is often the right answer, since a worker is doing lookups rather than reasoning. |
| Show progress | Whether tool activity streams back as it happens. |
Organisations set it, teams inherit and may override it, and a person's own overrides sit on top — the same order as model routing. Agent-mode requests routed with auto never land below level 3, so a capable model drives the investigation even when the request is one line.
What runs the loop
Memtro's own loop runs agent mode. There is nothing to choose and no setting to get wrong.
The one exception is a subscription credential. A claude-code/* or codex/* model has no plain completions endpoint, so Memtro spawns that vendor's CLI for the request and hands it the same tools over MCP with a short-lived token. The credential decides this, not a setting. Client-declared tools are not available on those two model families; use an API key for those.
How the loop is confined
The model's only reach is Memtro's own tools, called with arguments checked against a schema, so there is no shell and no file access to contain. The one piece of model-written code the loop runs is a code mode script, and that runs in a WebAssembly JavaScript engine with nothing bound into it but the read tools: no process, no file system, no network, and every call it makes goes through the same checks as a call the model makes itself. Around that:
- The process. The service runs as a dedicated non-root user with every Linux capability dropped and the filesystem read-only apart from the application directory, its log directory and scratch space. Devices, kernel tunables, modules, logs, cgroups, the clock and other processes are all closed off.
- Outbound requests. Every connector call resolves its host first and is refused if it lands on loopback, cloud-metadata, private or carrier-NAT space. That applies to a connection's stored base URL and to any URL that arrived inside third-party content, so a connector cannot be steered into probing the machine Memtro runs on. A custom model endpoint has to be named in an operator allowlist.
- The CLIs. The two subscription CLIs never run on the server itself. Each request starts a throw-away container with all Linux capabilities dropped, a read-only root filesystem, no new privileges, tmpfs scratch space, and limits of 1 GB memory, one CPU and 512 processes. Nothing from the application or the host is mounted; the container sees only the generated prompt and config files and reaches Memtro through its MCP endpoint with a token minted for that user and that request.
What an action needs before the agent can take one
Agent mode changes nothing about permissions. Every connector reads; a tool that changes something in another system is marked as an action, granted by name per team on the Connections page, and used only when somebody asked for exactly that in the conversation — never on the agent's own initiative, and never more than once per request. An agent with no action grants is an agent that can only read, however many steps it has. See Teams and permissions.
Progress and results
Tool activity streams as reasoning_content deltas, which Open WebUI, Cherry Studio and most OpenAI-compatible UIs render as a collapsible "thinking" block, so a four-minute investigation shows its work rather than appearing to hang.
The final response carries:
memtro.tools— every tool call made, in order.memtro.citations— the records the answer drew on, as links into the systems that hold them.memtro.routing— the level, the ladder, the reason and the model that answered.
Facts learned during the run are extracted into memory, connector results are anchored into the graph, and any SQL that ran and returned rows is kept with the tables it touched, so the next person asking a similar question starts from a query that already worked.
Asking it like this
Why has Baltic Travel's ticket volume doubled this month?
What happened with the Acme renewal — the whole story, across every system?
Which of our top twenty customers has nobody spoken to since August?
Reconcile last month's invoices against what the warehouse says shipped.
Each of those is several lookups in different products, and none of them is a question a single connector can answer.
What it does not do
- It does not get a shell. No file system and no general code execution. The only scripts it writes are read-only code mode scripts that can call Memtro's read tools and nothing else. Database connectors query in a read-only transaction with a statement timeout and a row cap.
- It cannot see what is not connected. Every answer from memory names the categories with nothing connected, and an agent sweep lists the systems it could not look in — a gap you are told about is worth more than a gap you discover later.
- It is not cheaper than a chat reply. It is several model turns and many tool calls, which is why the routing floor and cost control exist, and why "every request is an agent request" is a choice rather than the default.
- It does not ask follow-up questions mid-run. It states its assumption and proceeds.
Also worth reading
- Model routing — the ladder the agent is held above.
- Cost control — token allowances per level and choice.
- Memory — what the agent retrieves from, and writes back to.
- Code mode — the read-only scripts the agent writes for mechanical work.
- Tools reference — every tool a run can call.