Logo vun OmniCoreAgent

OmniCoreAgent

Organisatioun
omnirexflora-labs

Open Python agent harness for production AI apps: tools, MCP, memory, workspace, telemetry, subagents, background tasks, and OmniServe APIs.

Editeuromnirexflora-labs
Repositoryomnicoreagent
SproochPython
Forks
58
Stären
245
Disponibel Tools
0
Transporttypstdio
Kategorien
LizenzMIT
Linken
  • Tools mat KI-Workflows verbannen

    OmniCoreAgent stellt MCP-Funktioune bereit, déi vu kompatibele KI-Clienten a KI-Agente kënne benotzt ginn.

  • 0 disponibel Tools

    Kuckt Iech déi opruffbar Aktiounen hei drënner un, mat Nimm a Beschreiwungen, wa se vum Server geliwwert ginn.

  • Konfiguratioun fir ze kopéieren

    Benotzt d'Installatiounsbeispiller, fir dëse Server an Ärem bevorzugte MCP-Client ze konfiguréieren.

  • Indicateure fir Open Source

    245 Stären an 58 Forks aus dem verlinkte Repository.


What It Is

An LLM is not an agent by itself. The model provides intelligence; the harness gives that intelligence a working environment.

OmniCoreAgent is the application-facing harness layer around a model:

text
model
  + prompt contract
  + reasoning loop
  + local tools
  + MCP tools
  + parallel tool batches
  + structured observations
  + memory
  + context control
  + workspace files
  + tool-output offloading
  + guardrails
  + events
  + subagents
  + background tasks
  + REST/SSE serving

That is the difference between an agent harness and a generic agent library. A library gives you pieces to assemble. A harness gives you the runtime boundary that makes a model usable inside an application.

OmniCoreAgent keeps that boundary explicit:

LayerWhat It Owns
Agent harnessModel loop, prompt contract, tools, observations, memory, context, workspace, guardrails, events, subagents
Serving boundaryOmniServe REST/SSE APIs, request lifecycle, readiness, auth, rate limits, metrics
Background boundaryDurable scheduled/manual task execution with task state, run history, leases, retries, and workspace output
External tool boundaryMCP server tools and local Python tools exposed through one runtime surface

Start with the core harness. Turn on heavier production pieces only when the workload needs them.

If you prefer guided docs, start with the Quick Start. If you use AI coding tools, use the AI tools guide for Ask AI, /llms.txt, hosted docs MCP, Cursor, VS Code, ChatGPT, Claude, and Perplexity.


Quick Start

bash
pip install omnicoreagent
bash
export LLM_API_KEY=your_api_key
python
import asyncio
from omnicoreagent import OmniCoreAgent

agent = OmniCoreAgent(
    name="assistant",
    system_instruction="You are a helpful assistant.",
    model_config={"provider": "openai", "model": "gpt-4o"},
)

async def main():
    result = await agent.run(
        "Research the top 3 open-source agent runtimes and summarize them.",
        session_id="quickstart",
    )
    print(result["response"])
    await agent.cleanup()

asyncio.run(main())

That is the smallest path: one agent, one model, one stable session, the harness loop, session memory, guardrails, workspace files, error handling, and metrics around each run.

Context management, tool output offloading, BM25 tool retrieval, subagents, skills, cloud workspace storage, and production backends are opt-in so a small agent stays small.

Ready to go deeper? The Cookbook has progressive examples from hello world to production deployments.


Choose Your Path

GoalStart Here
Build your first agentQuick Start
Add Python toolsLocal tools cookbook
Connect MCP server toolsMCP tools cookbook
Manage memory and contextGetting started cookbook
Save files, artifacts, and large tool resultsTool offload cookbook
Build a production-shaped app harnessReal applications cookbook
Build multi-step workflowsWorkflows cookbook
Serve an agent over HTTP/SSEOmniServe cookbook
Use the docs inside AI toolsAI tools guide
Debug setup or configurationConfiguration guide
Understand the runtime internalsImplementation Map

What You Can Build

OmniCoreAgent is for application builders who need the agent runtime to hold together after the prototype works.

BuildHarness Pieces You Use
MCP-connected product agentsMCP tools, local tools, structured observations, guardrails, session memory
Research and analysis agentsParallel tool batches, workspace files, tool offloading, context management, artifact readback
Long-running worker agentsBackground tasks, durable task stores, run history, workspace output, retries, cancellation
Multi-agent task systemsDynamic subagents, shared workspace output, workflow orchestration, telemetry events
Agent APIsOmniServe REST/SSE, readiness, auth, request timeout, rate limits, metrics
Production app integrationsOptional Redis, MongoDB, SQL, S3, and R2 backends without making the core install heavy

The core idea is simple: one harness entry point, many application membranes. You bring the domain instructions, tools, and business logic. OmniCoreAgent provides the execution boundary around them.


Why It Matters

Most demos stop at "LLM plus tool loop." Production agents fail in the layer around that loop: slow sequential tool calls, noisy observations, repeated actions, context exhaustion, unsafe tool output, missing workspace state, uninspectable background work, and weak serving boundaries.

OmniCoreAgent exists for that layer.

1. Agents call tools in batches instead of forced sequences

The usual tool loop looks like this:

text
LLM -> call tool A -> wait -> result -> LLM -> call tool B -> wait -> result

OmniCoreAgent lets the model request independent tools together:

text
LLM -> [tool A + tool B + tool C in parallel] -> one structured observation -> LLM

The model gets one complete view of the batch before it reasons again. A failed tool is represented beside the successful tools instead of silently collapsing the whole step.

Native function calling alone is not the runtime. OmniCoreAgent uses its own tool-call contract, parser, resolver, parallel runner, and result formatter so the harness controls the full execution path.

2. Tool results become structured observations

Raw tool output is often too noisy for the next reasoning step. Large payloads, errors, irrelevant fields, and prompt-injection content can all distort the loop.

OmniCoreAgent routes tool results through an observation pipeline:

text
tool output -> parse -> format -> guardrail check -> offload when configured -> observation -> model

The model receives the signal it needs to continue the task, not an unbounded dump of every byte returned by a tool. When tool offloading is enabled, large outputs are written into the active workspace and the model receives a readable preview plus a path it can use later.

3. Loop detection uses signatures beyond step counts

max_steps is still useful, but it is a blunt instrument. It stops an agent that is making progress just as quickly as one that is stuck.

OmniCoreAgent tracks SHA256-backed tool-call signatures across the loop. Each signature is based on the tool name, input, and output for the call. The runtime detects:

  • Consecutive loops: the same tool call returns the same result repeatedly.
  • Pattern loops: the same tool repeats a small interaction pattern.

When the harness stops a loop, the agent gets a reason. That makes debugging the agent behavior much easier than "max iterations reached."

4. The harness is already assembled

OmniCoreAgent ships as a working harness, not a bag of disconnected pieces:

text
model + prompt + loop + tools + memory + context + workspace + guardrails + telemetry

Keep it small for simple agents, then turn on the heavier harness pieces when the workload needs them: MCP tools, BM25 tool retrieval, dynamic subagents, skills, cloud workspace storage, Redis/Postgres/MongoDB memory, telemetry events, and OmniServe.

5. Context is managed before the model call

When context management is enabled, OmniCoreAgent checks the active message history before every LLM request. If the configured threshold is crossed, the harness automatically applies the selected strategy before calling the model:

text
messages -> threshold check -> truncate or summarize+truncate -> LLM

The system prompt is preserved, recent messages are preserved, and older middle history is either summarized or removed depending on configuration. If you set the budget below your model's real context window, the harness acts before the provider rejects the request.


See It In Action

python
import asyncio
from omnicoreagent import MemoryRouter, OmniCoreAgent, ToolRegistry

tools = ToolRegistry()

@tools.register_tool("search_web")
def search_web(query: str) -> dict:
    """Search the web for information."""
    return {"results": [f"Result for: {query}"]}

@tools.register_tool("fetch_document")
def fetch_document(path: str) -> dict:
    """Fetch a domain document from an application-owned source."""
    return {"path": path, "content": f"Contents of {path}"}

agent = OmniCoreAgent(
    name="research-agent",
    system_instruction=(
        "You are a research assistant. Use tools in parallel when the calls are "
        "independent and you can reason over the results together."
    ),
    model_config={"provider": "openai", "model": "gpt-4o"},
    local_tools=tools,
    memory_router=MemoryRouter("in_memory"),
    agent_config={
        "max_steps": 20,
        "context_management": {"enabled": True},
        "tool_offload": {"enabled": True},
        "enable_subagents": True,
        "enable_advanced_tool_use": True,
    },
)

async def main():
    result = await agent.run(
        "Search for recent AI agent papers and fetch notes.md. Do both at once "
        "if neither depends on the other."
    )
    print(result["response"])
    await agent.cleanup()

asyncio.run(main())

The runtime accepts search_web and fetch_document in the same batch, returns both results together, and continues from one structured observation.


Install Only What You Need

bash
pip install omnicoreagent                    # Core runtime
pip install "omnicoreagent[redis]"           # Redis memory backend
pip install "omnicoreagent[postgres]"        # PostgreSQL / SQL memory
pip install "omnicoreagent[mongodb]"         # MongoDB memory
pip install "omnicoreagent[s3]"              # S3 / R2 workspace storage
pip install "omnicoreagent[serve]"           # OmniServe REST/SSE API
pip install "omnicoreagent[tokenizer]"       # Token-aware context budgeting
pip install "omnicoreagent[otel]"            # OTLP trace export
pip install "omnicoreagent[langsmith]"       # LangSmith trace export
pip install "omnicoreagent[opik]"            # Comet Opik trace export
pip install "omnicoreagent[all]"             # Everything

Production backends are installable extras. Install only what the agent actually uses.


Features

Core Runtime

FeatureWhat It Does
Parallel Batch Tool ExecutionExecutes independent tool calls concurrently and returns one combined observation to the model.
Structured Observation PipelineParses, formats, guardrail-checks, and offloads tool results when configured before the model sees them.
Signature-Based Loop DetectionDetects repeated SHA256-backed tool-call signatures and repeated tool interaction patterns beyond step-count exhaustion.
Local Tool RegistryRegisters Python functions as tools with inferred schemas and async/sync execution support.
Multi-Tier MemoryUses in-memory, Redis, MongoDB, or SQL-backed session history through the memory router.
Context EngineeringChecks context before each model call and automatically truncates or summarizes when the configured budget threshold is crossed.
Workspace FilesGives agents a local, S3, or R2-backed file workspace for notes, scratchpads, artifacts, and tool offloads.
Tool Output OffloadingWrites large tool results to workspace files and gives the model a preview plus a file reference.
GuardrailsAdds prompt-injection screening inside the observation path with configurable behavior.

Production Harness

FeatureWhat It Does
Dynamic SubagentsLets the main agent spawn focused workers with isolated context and shared workspace output.
Durable Background TasksRuns manual or scheduled agent work with task state, run history, retries, cancellation, and workspace output.
Workflow OrchestrationProvides sequential, parallel, and router agents for multi-step application workflows.
Telemetry and TracesEmits typed telemetry events, retrieves traces by exact trace_id, latest session, or run_id correlation, and exports traces to OTLP, LangSmith, Opik, or JSONL.
OmniServeTurns an agent into a REST/SSE service with lifecycle management, auth, rate limits, telemetry APIs, background APIs, and metrics.

Integrations

FeatureWhat It Does
MCP Native ToolsConnects MCP servers over stdio, SSE, and Streamable HTTP, including OAuth-capable remote servers.
Agent SkillsLoads packaged capabilities implemented with Python, Bash, or Node.js.
BM25 Tool RetrievalSelects relevant tools from large tool sets so the prompt stays focused.
Runtime Backend SwitchingSwitches memory backends at runtime when configured.
Universal ModelsSupports OpenAI, Anthropic, Gemini, Groq, Ollama, DeepSeek, Mistral, OpenRouter, Azure, and Cencori through the runtime model layer.

Implementation Map

OmniCoreAgent's capabilities are backed by concrete runtime modules:

CapabilityWhere It Lives
Parallel tool batchescore/tools/tool_batch_runner.py
XML tool-call contractcore/agents/xml_parser.py
Structured observationscore/tools/tool_observation.py
Tool output offloadingcore/workspace/artifacts.py
Automatic context controlcore/agents/llm_step.py, core/context_manager.py
Workspace filescore/workspace/tools.py, core/workspace/storage.py
Dynamic subagentscore/subagents.py
Loop detectioncore/agents/loop_detection.py
MCP server toolsmcp_clients_connection/client.py
OmniServeserve/

See the Agent Harness docs for the full implementation map.


Cookbook

All examples live in the Cookbook and are organized by use case.

CategoryWhat You'll Build
Getting StartedFirst agent, tools, memory, telemetry events, and traces
Real ApplicationsDue diligence, support operations, and workspace code review harnesses
WorkflowsSequential, Parallel, Router agents
Background AgentsScheduled autonomous tasks
ProductionGuardrails, serving, and production patterns

Configuration

Environment Variables

For the first run, most hosted model providers only need LLM_API_KEY. OmniCoreAgent defaults memory and events to in-memory storage, workspace files to local disk, and optional production integrations stay off until you configure them.

bash
export LLM_API_KEY=your_api_key

Add backend-specific variables only when you opt into Redis, MongoDB, SQL database storage, S3, R2, or OmniServe deployment settings.

Full Harness Config Example

The defaults keep the first agent small: workspace files and guardrails are on, conversation memory is in-memory, and advanced harness pieces stay off until you enable them. This example shows the production-style switches together.

python
agent_config = {
    "max_steps": 15,
    "tool_call_timeout": 30,
    "request_limit": 0,                  # 0 = unlimited
    "total_tokens_limit": 0,             # 0 = unlimited
    "memory_config": {
        "mode": "sliding_window",
        "value": 10000,
        "summary": {"enabled": False},
    },
    "enable_workspace_files": True,      # Default on
    "guardrail_mode": "full",            # Default
    "context_management": {"enabled": True},  # Default off
    "tool_offload": {"enabled": True},        # Default off
    "enable_advanced_tool_use": True,         # Default off
    "enable_subagents": True,                 # Default off
    "enable_agent_skills": True,              # Default off
}

When enable_subagents is true, workspace files are enabled automatically so subagents write outputs, notes, todos, and artifacts into the active workspace.

Full reference: Configuration Guide


Development

bash
git clone https://github.com/omnirexflora-labs/omnicoreagent.git
cd omnicoreagent

uv venv && source .venv/bin/activate
uv sync --dev

pytest tests/ -v
pytest tests/ --cov=src --cov-report=term-missing

Troubleshooting

ErrorFix
Invalid API keyExport LLM_API_KEY with the key for the provider selected in model_config.
ModuleNotFoundError for Redis / Postgres / MongoDB / S3Install the matching extra, for example pip install "omnicoreagent[redis]".
Redis connection failedStart Redis or use MemoryRouter("in_memory").
MCP connection refusedEnsure the MCP server is running before starting the agent.

More help: Basic Usage Guide


Contributing

bash
git clone https://github.com/omnirexflora-labs/omnicoreagent.git
cd omnicoreagent

uv venv && source .venv/bin/activate
uv sync --dev
pre-commit install

See CONTRIBUTING.md for guidelines. PRs are welcome.


License

MIT - see LICENSE.


Author

Built by Abiola Adeshina.

The OmniRexFlora Ecosystem

ProjectDescription
OmniMemorySelf-evolving memory for autonomous agents
OmniCoreAgentProduction agent harness (this project)
OmniDaemonEvent-driven runtime for running agents as supervised, autonomous infrastructure services

Built On

LiteLLM - FastAPI - Redis - Pydantic


Installatioun

TypingMind
Viraussetzungen:

Node.js 18+

{
  "mcpServers": {
    "abiorh001-omnicoreagent": {
      "command": "uvx",
      "args": [
        "omnicoreagent"
      ]
    }
  }
}

OmniCoreAgent MCP mat verschiddene KI-Modeller benotzen

TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Soubal OmniCoreAgent verbonnen ass, kënnt Dir et mat verschiddene KI-Modeller an TypingMind benotzen, amplaz et fir all Modell separat anzeriichten. Dës MCP-Integratioun leeft lokal iwwer den TypingMind-MCP-Connector op Ärem Apparat.

Ariichtungsuleedung fir de lokale Connector ze benotzen

Benotzt dës Optioun, wann den MCP-Server Zougrëff op lokal Fichieren, Appen oder privat Ressourcen op Ärem Computer brauch.

1

D'MCP-Astellungen opmaachen

Gitt an TypingMind op „Astellungen“, „Erweidert Astellungen“, dann op „Model Context Protocol“ a wielt „Connector ariichten“.

  1. Maacht TypingMind an Ärem Browser op.
  2. Klickt op d'Astellungssymbol.
  3. Gitt op „Erweidert Astellungen“.
  4. Maacht d'Sektioun „Model Context Protocol“ op.
  5. Klickt op „Connector ariichten“ a wielt „Dësen Apparat“.
Ariichtungsbildschierm vum TypingMind-MCP-Connector mat „Dësen Apparat“ ausgewielt
2

De Connector-Befeel ausféieren

Wielt „Dësen Apparat“, kopéiert de Befeel aus TypingMind a féiert en am Terminal aus. Loosst de Prozess lafen, wärend Dir MCP benotzt.

  1. Kopéiert den Ariichtungsbefeel, deen TypingMind uweist.
  2. Maacht Terminal op macOS oder Windows Terminal op Windows op.
  3. Pescht de Befeel an a féiert en aus.
  4. Bestätegt d'Installatioun vum Package, wann den Terminal Iech freet, ob Dir weiderfuere wëllt.
  5. Loosst den Terminal an de Prozess doranner lafen, wärend Dir MCP-Tools benotzt.
3

OmniCoreAgent als Server derbäisetzen

Wann de Connector-Status „Prett“ ass, klickt op „Serveren änneren“ a pescht d'MCP-Serverkonfiguratioun an.

  1. Waart, bis de Connector-Status „Prett“ weist.
  2. Klickt op „Serveren änneren“.
  3. Pescht d'MCP-Serverkonfiguratioun vu OmniCoreAgent an.
  4. Späichert d'Serverlëscht.
  5. Aktualiséiert, wann Dir kontrolléiere wëllt, ob de Connector nach ëmmer prett ass.
MCP-Astellunge vun TypingMind mat aktivem Server an dem Knäppchen „Serveren änneren“
{
  "mcpServers": {
    "abiorh001-omnicoreagent": {
      "command": "npx",
      "args": [
        "-y",
        "omnicoreagent"
      ]
    }
  }
}
4

D'Verbindung mat verschiddene Modeller benotzen

Späichert d'Serverlëscht, maacht „Plugins“ op an aktivéiert d'MCP-Tools vu OmniCoreAgent. Wielt dann e belibegen ënnerstëtzte KI-Modell an TypingMind a benotzt d'Tools am Chat oder weist se engem KI-Agent zou.

  1. Maacht d'Säit „Plugins“ an TypingMind op.
  2. Aktivéiert d'MCP-Tools vu OmniCoreAgent.
  3. Start e Chat a wielt de KI-Modell, deen Dir benotze wëllt.
  4. Benotzt d'MCP-Tools am Chat oder weist se engem KI-Agent zou.
  5. Wiesselt bei Bedarf op en anere KI-Modell, ouni MCP nei ze verbannen.
TypingMind-Chat mat aktivéierte MCP-Tools an engem ausgewielte KI-Modell
Hëlleft Dir mir bei dëser Aufgab mat OmniCoreAgent?
OmniCoreAgent
Jo. Ech hunn et gelies.
Dat hunn ech mat OmniCoreAgent fonnt.

Heefeg gestallte Froen

Fir wat gëtt de MCP-Server OmniCoreAgent benotzt?

OmniCoreAgent ass e MCP-Server, deen et kompatibele KI-Clienten erlaabt, sech mat externen Tools a Kontext ze verbannen. An TypingMind kënnt Dir dëse MCP-Server eemol derbäisetzen a seng Tools an Ärem KI-Aarbechtsberäich zur Verfügung stellen.

Kann ech OmniCoreAgent MCP mat méi KI-Modeller an TypingMind benotzen?

Jo. TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Sou kënnt Dir OmniCoreAgent mat verschiddene KI-Modeller wéi Claude, ChatGPT, Gemini oder anere Modeller benotzen, déi Dir an TypingMind konfiguréiert hutt, ouni de MCP-Server fir all Modell separat anzeriichten.

Firwat OmniCoreAgent MCP mat TypingMind benotzen?

TypingMind ass eng vun de beschte Benotzeruewerfläche fir LLM-Chat, well et méi KI-Modeller, Prompts, Plugins, KI-Agenten, API-Schlësselen a MCP-Tools an engem Aarbechtsberäich zesummebréngt. Wann OmniCoreAgent verbonnen ass, kënnt Dir seng MCP-Tools mat Äre bevorzugte Modeller benotzen a gläichzäiteg Är Chataarbecht an TypingMind organiséieren.

Wéi verbannen ech OmniCoreAgent MCP mat TypingMind?

OmniCoreAgent leeft iwwer de lokale MCP-Connector vun TypingMind. Dat eegent sech am beschten, wann de MCP-Server Zougrëff op lokal Fichieren, Desktop-Apps, Kommandozeilen-Tools oder privat Ressourcen op Ärem Computer brauch.

Wéi eng Tools stellt OmniCoreAgent MCP an TypingMind zur Verfügung?

OmniCoreAgent stellt MCP-Funktiounen zur Verfügung, déi Dir op der Plugins-Säit vun TypingMind aktivéiere kënnt, fir se am Chat ze benotzen oder KI-Agenten zouzeweisen.

Muss ech meng API-Schlëssele mat TypingMind deelen, fir OmniCoreAgent MCP ze benotzen?

Nee. TypingMind setzt op lokal Veraarbechtung a léisst Iech d'Kontroll iwwer Är Modellubidder, API-Schlësselen, Prompts a MCP-Konfiguratioun. Wann OmniCoreAgent eng Authentifizéierung verlaangt, setzt déi néideg Headeren, OAuth-Astellungen oder lokal Konfiguratioun fir dee MCP-Server derbäi, wann Dir d'Verbindung erstallt.

Änlech MCP-Serveren

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇