Agent (server-side)

Overview

The older agent, whose loop runs on the platform. It exists for the case where nothing of yours is running — which is what a workflow step is.

no runtime option8 steps by defaulttools are api.tools
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

api.agents.create() without runtime builds this one. You give it model sessions, storages and tool declarations; it streams steps back while the platform performs them.

const writer = await api.models.create({ model: "gemini-3.5-flash" });

const agent = api.agents.create({
  model: { main: writer },
  storages: [database],
  tools: { search: api.tools.search, query_storage: api.tools.queryStorage },
  maxSteps: 8,
  budget: 200,
});

const result = await agent.run({
  inputs: [{ type: "text", content: "Which customers churned last month?" }],
  onStep: (step) => console.log(step.tool, step.summary),
});
writer = api.models.create(model="gemini-3.5-flash")

agent = api.agents.create(
    model={"main": writer},
    storages=[database],
    tools={"search": api.tools.search, "query_storage": api.tools.query_storage},
    max_steps=8,
    budget=200,
)

result = agent.run(
    inputs=[{"type": "text", "content": "Which customers churned last month?"}],
    on_step=lambda step: print(step.get("tool"), step.get("summary")),
)
modelobjectrequired

A model session, or a named set: { main, image, video, voice, music }.

storagesarray[]

ConnectedStorage objects this run may read.

toolsobject{}

api.tools declarations, keyed by the name the model sees.

outputsarraynull

What the run should produce.

maxStepsinteger8

Steps.

budgetinteger|nullnull

Credits.

Against the local engine

LocalServer-side
The loop runsin your processon the platform
Tools35, on your machineapi.tools declarations
Permissionyour callback, per callnone — the tool set is the boundary
Sessions, checkpoints, skillsyesno
Steps by default1008
Needs your process aliveyesno
Prefer the local engine when you have a process

This one has no permission callback, so the only boundary is which tools you declared and which storages you passed. That is a reasonable design for an unattended step; it is a poor one for an interactive agent.

It can still reach your machine

The four document-writing declarations and the document readers are performed through the package, on the machine that holds the key: the run asks, your process does the work, the answer goes back. So it works only while your process is listening.

It keeps its own history

Each run() appends the exchange to agent.history, and the next one sends it. Pass history explicitly to override, or [] to start fresh.