OmniCoreAgent
OmniCoreAgent is the object you build. You give it a model, instructions and
the tools it may use; it runs the loop, keeps the conversation, guards the
input, and records every run. This page shows what goes into it, what comes out,
and what is already switched on before you ask for anything.
New to OmniCoreAgent? The quickstart builds
your first agent in five minutes. Every output on this page is what the code
printed when it was run; the model’s wording will differ on yours.
Build one and look inside
The agent below has one tool of yours. Before it runs, ask it which tools the model will be offered; then run it and read the result.ls to grep), and the *_artifact tools that read
back a tool result too large to put in the conversation. Nobody asked for them;
they are on by default.
The run made two model calls: one that chose get_weather, one that answered
with its result. No session_id was given, so the run made one. Pass your own to
continue a conversation (basic usage).
Switch something on, see what changes
Most of the runtime is switched on by one setting. This asks the agent for its tools under a few settings, without running the model:execute tool whose commands run in the sandbox,
not on your machine; sub-agents give it spawn_subagents. Turning the workspace
off removes its ten file tools; the artifact tools stay, because large tool
results still need somewhere to go.
list_all_available_tools() lists your tools, MCP tools, the built-in ones and a
delegate_<name> tool per sub-agent. The tools_retriever tool that
enable_advanced_tool_use adds is offered inside the run and does not appear in
this list.How it works
- Constructing is cheap and checks everything.
OmniCoreAgent(...)opens no connection and calls no model, but it validates every setting: a typo inagent_configfails here, not halfway through a run. - The first run sets it up. The model connection, memory, guardrail and tools
are built on the first
run()(orlist_all_available_tools(), orawait agent.initialize()). That is whenLLM_API_KEYis read. - Each
run()is one request. It loads the session’s history, calls the model, runs the tools it asks for (independent calls in one batch), and repeats until the model answers or a limit is reached. It saves the conversation, a durable record of the run, and a trace of every step. - It returns instead of raising. A provider error, a limit or a blocked input
comes back as a result with
status"error"and atermination_reason. Setup and storage problems (a missing key, a bad setting, an unreachable database) raise. cleanup()closes what it opened: MCP connections and sub-agent workers.
On before you ask
Every one of these is a key in
agent_config; the
agent settings reference has each with its
default. Configuration shows how they fit
together.
What it takes
The rest (
telemetry_store, telemetry_recorder, telemetry_stream,
telemetry_payload_store, prompt_builder) replace built-in parts; see the
OmniCoreAgent reference.
What you can ask of it
Every method, with its signature, is in the
OmniCoreAgent reference.
When things go wrong
ValueError: Unknown agent_config setting 'max_step'. Did you mean 'max_steps'?
ValueError: Unknown agent_config setting 'max_step'. Did you mean 'max_steps'?
Raised by the constructor for any key it does not know, with the closest
match and the full list of settings:A key that 0.3 accepted and 0.4 removed says what replaced it; see
Upgrading.
ValueError: sub_agents must be a list of agents, e.g. sub_agents=[researcher]
ValueError: sub_agents must be a list of agents, e.g. sub_agents=[researcher]
sub_agents takes a list of agent objects, even for one:
sub_agents=[researcher], not sub_agents=researcher or a name.ValueError: LLM_API_KEY not found in environment variables
ValueError: LLM_API_KEY not found in environment variables
Raised by the first
run(), not by the constructor: the key is read when
the agent is set up. Export it in the shell that runs the script. See the
quickstart.AttributeError: 'NoneType' object has no attribute 'switch_memory_store'
AttributeError: 'NoneType' object has no attribute 'switch_memory_store'
switch_memory_store() was called before the agent was set up, so it has no
memory router yet. Pass the store you want to the constructor
(memory_router=MemoryRouter("redis")), or call await agent.initialize()
before switching.The run returned status error instead of an answer
The run returned status error instead of an answer
Read
termination_reason: provider_error (the model call failed; the
response says why), max_steps or resource_limit (a limit in
agent_config), safety_guard (the guardrail blocked the input). The
basic usage page shows each.Next
Basic usage
Sessions, streaming, reading a run back, and handling failures.
Configuration
Model, agent, memory, workspace and telemetry settings in one place.
The harness
What the runtime does around the model, piece by piece.
Take the tour
A policy that asks a person, a sandbox, a budget.