Agents
Ax agents are typed programs that act: they use tools, child agents, a live runtime session, context policies, memory, skills, and discovery — then return a final response your code can trust, in the shape your signature declared.
var helper = Ax.agent("question:string -> answer:string");One harness scales across every size of job. agent() with nothing but a signature and a couple of tools already runs the full pipeline — including a runtime session — with zero configuration. The bigger tiers are the same harness with more of it switched on, so an agent grows by adding config, never by rewriting.
Pick Your Size
| Tier | What it is | Reach for it when |
|---|---|---|
| Micro | One signature, a few tools, typed reply | A single job with a couple of lookups or actions |
| Standard | Namespaced tools, child agents, discovery, clarification | Real workflows with growing tool catalogs and specialists |
| Long-horizon | Large context, context policies, memory, skills, optimization | Bulky data, long runs, repeated work over the same material |
Grounded By Construction
The design bet behind Ax agents is simple: the model should compute on your data, not read it. Bulky inputs live in a runtime session; the model writes small code steps against them; only compact evidence and live variable summaries enter the prompt. So the prompt does not grow with your data, grounding does not degrade as inputs get larger, and small, cheap models stay exact — a small Flash-class model reproduces a 250-row ledger audit to the cent, repeatably, in the checked-in grounded-audit example. The Performance page shows the measurements and states exactly what we do and don’t claim.
The Pipeline
Every forward() runs three stages:
flowchart LR A[Original typed inputs] --> B[Distiller] B -->|executorRequest + evidence by reference| C[Executor] C -->|tool evidence, runtime state, final envelope| D[Responder] D --> E[Typed output]
- Distiller narrows large context down to the exact evidence the executor needs — reconnaissance, not execution.
- Executor runs the work: tool use, discovery, memory recall, child-agent calls, and final/clarification envelopes.
- Responder turns the executor evidence into the declared output signature.
The two runtime stages share one session, so evidence passes by reference and the executor’s prompt carries only a compact shape summary of it. This is why Ax agents work well with smaller models: each turn is one observable step against live state, not a re-read of a long transcript. Internals explains the stages, the context objects, and the research lineage.
When Not To Use An Agent
Use ax() when one structured generation is enough — classification, extraction, a single transformation. Use an agent when the model must decide what to do next: call a tool, inspect a result, delegate, or ask for clarification.
Where Next
- Micro Agents — the smallest thing that acts.
- Standard Agents — tools at scale, child agents, clarification.
- Long-Horizon Agents — large context, policies, memory, skills, optimization.
- Performance — measured grounding and model guidance.
- Internals — how it works and why it is shaped this way.
- Runnable code: agent examples, long-horizon examples, and Advanced Start.
Pages
- Micro Agents One signature and a few tools — the smallest agent, with the full harness by default.
- Standard Agents The workhorse: namespaced tools, child agents, and typed final outputs.
- Long-Horizon Agents Large context, evidence by reference, context policies, memory, skills, and optimization.
- Performance Measured grounding: reproducible audits, model guidance, and what we do not claim.
- Internals AxAgent stages, the four context objects, and the research lineage behind them.