title: Agent optimization slug: agent-optimization audience: end-user category: agents
Agent optimization
Optimization makes a saved agent faster, cheaper, and more accurate on the ERP instance you use it with. You run it once per instance; from then on every conversation with that agent skips the warm-up work and gets straight to your request.
When to use it
Optimize an agent when:
- It's a custom agent you've written instructions for and plan to use regularly.
- Its instructions name specific things in your ERP — products, customers, stores, document types, warehouses, etc.
- You've noticed the first turn of every new conversation feels slow, or the agent asks back questions it should already know the answer to.
You don't need to optimize one-off or purely conversational agents.
Heads up — optimization uses AI credits. A typical run consumes around 15–20 credits (more for agents with long instructions or many referenced entities). It pays for itself quickly on agents you'll run many times, but it's not worth doing on agents you'll only use once or twice.
How to optimize
- Pick the ERP instance you want to optimize for from the top bar.
- Open the agent in the editor and go to the Optimization tab.
- Click Optimize next to the current instance. A new chat opens and runs on its own — you don't need to type anything.
- Wait for it to finish. When the row flips to Optimized, you're done.
That's it. Every later conversation with that agent on that instance will use what was learned.
How to control it
- One instance at a time. Optimization is stored per ERP instance, because the same item can have different IDs in different instances. Switch instance in the top bar to optimize for a different one. An agent can be optimized for instance A and not for instance B — that's fine.
- Re-run when it's worth it (see the guidance below — you don't need to re-run after every small change).
- Clear it. Use the trash icon to remove an optimization. The agent simply falls back to its normal first-turn discovery — nothing breaks.
- View what was learned. Click the eye icon to see the resolved names, IDs, and notes the agent will use.
- Other instances are visible but read-only. Optimizations done on instances you're not currently on show up below, for reference. To re-run or clear one, switch to that instance first.
When (and how often) to re-run
A stale optimization never breaks the agent. If you added new instructions, named a new product, or something in your ERP changed since the last run, the agent will simply gather those new specifics live on each conversation — exactly like an un-optimized agent would. Everything that was captured still works and still saves time.
Use that to decide whether to re-run:
- Re-run when the agent's instructions changed substantially, you added several new named items (products, customers, document types…), or you notice it repeatedly looking up the same new things at the start of every chat.
- Don't bother re-running for small instruction tweaks, one new item, or a renamed entity here and there — the cost of re-running (15–20 credits) is usually higher than the small per-conversation overhead you'd save.
- As a rule of thumb, optimize once when you finish writing an agent, then re-run only after a meaningful round of changes — not after each edit.
If a stored ID later disappears from your ERP (deleted customer, removed document type…), the agent notices on the next call and recovers automatically. Re-running just tidies things up.
Dynamic memory
Once an agent is optimized for an instance, it also gets a small dynamic memory for that instance — a short notebook where it can jot down broadly-useful things it learned during a run, so its future self benefits on later conversations. Think query patterns that worked well, schema quirks, recurring naming conventions, "things I wish I knew on turn 1".
- On by default, per optimized instance. Turn it off with the switch on the Optimization tab if you don't want the agent writing to its own memory.
- Scoped to one instance. Notes saved while running on instance A are not used on instance B.
- Owner-only writes. If others use your shared agent, their runs still benefit from your agent's notes, but only your runs can add or remove them.
- Self-pruning. The notebook is small on purpose (a few dozen short notes). Old notes are dropped automatically when it fills up, and the agent itself can delete notes it later considers wrong.
- Review and clean. The Optimization tab shows every note with its timestamp; remove individual ones or clear them all.
Dynamic memory is only available for agents you've optimized — running optimization is what creates the notebook. It's a different layer from the main optimization artifact: clearing notes does not clear your optimization, and re-running optimization does not erase notes.
Good to know
- Safe by design. The optimization session can only read from your ERP. It can't create, update, or delete anything, and it can't send email or place orders.
- Self-checking. If the run misses something important, it's automatically asked to fill the gap and try again in the same session, so optimization may take a few turns.
- Already on, no setup. There's nothing to enable — the Optimization tab is on every saved agent.