This guide creates the smallest useful OmniCoreAgent: one model, one harness
runtime, one task, one local tool, and one stable session.The core install stays light. Redis, PostgreSQL, MongoDB, S3/R2, OmniServe, and
background scheduling install as extras when the agent needs them.
1
Install
pip install omnicoreagent
2
Set API Key
Export the model key for the provider you choose:
export LLM_API_KEY=your_api_key_here
OmniCoreAgent uses LLM_API_KEY as the single public API-key variable.
Choose the provider with model_config["provider"]. See
Model Support for supported provider names.
3
Create Your First Agent
Create hello_agent.py:
import asynciofrom omnicoreagent import OmniCoreAgentasync def main(): agent = OmniCoreAgent( name="my_agent", system_instruction="You are a helpful assistant.", model_config={"provider": "openai", "model": "gpt-4o"}, ) result = await agent.run("Hello, what can you do?") print(result["response"]) await agent.cleanup()if __name__ == "__main__": asyncio.run(main())
4
Run It
python hello_agent.py
You now have an agent with the core harness loop, session memory, workspace
files, guardrails, events, metrics, and cleanup lifecycle.
Agents keep continuity when you provide a stable session_id:
await agent.run("My name is Abiola.", session_id="user_123")result = await agent.run("What is my name?", session_id="user_123")print(result["response"])
The default memory backend is in-memory and works for local development. Use
Redis, MongoDB, or SQL database storage when conversation history must survive
process restarts.
MCP servers are external tool providers. OmniCoreAgent connects to them and loads
their tools into the same runtime view as local tools.This optional example uses Node.js and npx because the filesystem MCP server is
published as an npm package:
MCP connects external MCP server tools into OmniCoreAgent’s tool runtime. Those
tools run beside local tools, workspace tools, artifact tools, skills, and
harness tools.
For longer tasks, enable the heavier harness features explicitly: automatic
context control before each model call, tool output offloading into the
workspace, BM25 tool retrieval, subagents, and skills.
agent = OmniCoreAgent( name="research_agent", system_instruction=( "Use tools in parallel when the calls are independent. Write useful " "notes and outputs to the workspace when the task is long." ), model_config={"provider": "openai", "model": "gpt-4o"}, local_tools=tools, agent_config={ "max_steps": 20, "context_management": {"enabled": True}, "tool_offload": {"enabled": True}, "enable_advanced_tool_use": True, "enable_subagents": True, "enable_agent_skills": True, },)
When enable_subagents is true, workspace files are enabled automatically so
workers write outputs that the lead agent reads back.