MCPOmni Connect

A universal command-line interface (CLI) gateway to the MCP ecosystem, integrating multiple MCP servers, AI models, and transport protocols.

OmniCoreAgent Logo

🚀 OmniCoreAgent

The AI Agent Framework Built for Production
Switch memory backends at runtime. Manage context automatically. Deploy with confidence.

PyPI Downloads PyPI version Python Version License

Quick StartSee It In Action📚 CookbookFeaturesDocs


🎬 See It In Action

import asyncio
from omnicoreagent import OmniCoreAgent, MemoryRouter, ToolRegistry

# Create tools in seconds
tools = ToolRegistry()

@tools.register_tool("get_weather")
def get_weather(city: str) -> dict:
    """Get current weather for a city."""
    return {"city": city, "temp": "22°C", "condition": "Sunny"}

# Build a production-ready agent
agent = OmniCoreAgent(
    name="assistant",
    system_instruction="You are a helpful assistant with access to weather data.",
    model_config={"provider": "openai", "model": "gpt-4o"},
    local_tools=tools,
    memory_router=MemoryRouter("redis"),  # Start with Redis
    agent_config={
        "context_management": {"enabled": True},  # Auto-manage long conversations
        "guardrail_config": {"strict_mode": True},  # Block prompt injections
    }
)

async def main():
    # Run the agent
    result = await agent.run("What's the weather in Tokyo?")
    print(result["response"])
    
    # Switch to MongoDB at runtime — no restart needed
    await agent.switch_memory_store("mongodb")
    
    # Keep running with a different backend
    result = await agent.run("How about Paris?")
    print(result["response"])

asyncio.run(main())

What just happened?

  • ✅ Registered a custom tool with type hints
  • ✅ Built an agent with memory persistence
  • ✅ Enabled automatic context management
  • ✅ Switched from Redis to MongoDB while running

⚡ Quick Start

pip install omnicoreagent
echo "LLM_API_KEY=your_api_key" > .env
from omnicoreagent import OmniCoreAgent

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

result = await agent.run("Hello!")
print(result["response"])

That's it. You have an AI agent with session management, memory, and error handling.

📚 Want to learn more? Check out the Cookbook — progressive examples from "Hello World" to production deployments.


🎯 What Makes OmniCoreAgent Different?

FeatureWhat It Means For You
Runtime Backend SwitchingSwitch Redis ↔ MongoDB ↔ PostgreSQL without restarting
Cloud Workspace StorageAgent files persist in AWS S3 or Cloudflare R2 ⚡ NEW
Context EngineeringSession memory + agent loop context + tool offloading = no token exhaustion
Tool Response OffloadingLarge tool outputs saved to files, 98% token savings
Built-in GuardrailsPrompt injection protection out of the box
MCP NativeConnect to any MCP server (stdio, SSE, HTTP with OAuth)
Background AgentsSchedule autonomous tasks that run on intervals
Workflow OrchestrationSequential, Parallel, and Router agents for complex tasks
Production ObservabilityMetrics, tracing, and event streaming built in

🎯 Core Features

📖 Full documentation: docs-omnicoreagent.omnirexfloralabs.com/docs

#FeatureDescriptionDocs
1OmniCoreAgentThe heart of the framework — production agent with all featuresOverview →
2Multi-Tier Memory5 backends (Redis, MongoDB, PostgreSQL, SQLite, in-memory) with runtime switchingMemory →
3Context EngineeringDual-layer system: agent loop context management + tool response offloadingContext →
4Event SystemReal-time event streaming with runtime switchingEvents →
5MCP ClientConnect to any MCP server (stdio, streamable_http, SSE) with OAuthMCP →
6DeepAgentMulti-agent orchestration with automatic task decompositionDeepAgent →
7Local ToolsRegister any Python function as an AI tool via ToolRegistryLocal Tools →
8Community Tools100+ pre-built tools (search, AI, comms, databases, DevOps, finance)Community Tools →
9Agent SkillsPolyglot packaged capabilities (Python, Bash, Node.js)Skills →
10Workspace MemoryPersistent file storage with S3/R2/Local backendsWorkspace →
11Sub-AgentsDelegate tasks to specialized agentsSub-Agents →
12Background AgentsSchedule autonomous tasks on intervalsBackground →
13WorkflowsSequential, Parallel, and Router agent orchestrationWorkflows →
14BM25 Tool RetrievalAuto-discover relevant tools from 1000+ using BM25 searchAdvanced Tools →
15GuardrailsPrompt injection protection with configurable sensitivityGuardrails →
16ObservabilityPer-request metrics + Opik distributed tracingObservability →
17Universal Models9 providers via LiteLLM (OpenAI, Anthropic, Gemini, Groq, Ollama, etc.)Models →
18OmniServeTurn any agent into a production REST/SSE API with one commandOmniServe →

📚 Examples & Cookbook

All examples are in the Cookbook — organized by use case with progressive learning paths.

CategoryWhat You'll BuildLocation
Getting StartedYour first agent, tools, memory, eventscookbook/getting_started
WorkflowsSequential, Parallel, Router agentscookbook/workflows
Background AgentsScheduled autonomous taskscookbook/background_agents
ProductionMetrics, guardrails, observabilitycookbook/production
🏆 ShowcaseFull production applicationscookbook/showcase

🏆 Showcase: Full Production Applications

ApplicationDescriptionFeatures
OmniAuditHealthcare Claims Audit SystemMulti-agent pipeline, ERISA compliance
DevOps CopilotAI-Powered DevOps AutomationDocker, Prometheus, Grafana
Deep Code AgentCode Analysis with SandboxSandbox execution, session management

⚙️ Configuration

Environment Variables

# Required
LLM_API_KEY=your_api_key

# Optional: Memory backends
REDIS_URL=redis://localhost:6379/0
DATABASE_URL=postgresql://user:pass@localhost:5432/db
MONGODB_URI=mongodb://localhost:27017/omnicoreagent

# Optional: Observability
OPIK_API_KEY=your_opik_key
OPIK_WORKSPACE=your_workspace

Agent Configuration

agent_config = {
    "max_steps": 15,                    # Max reasoning steps
    "tool_call_timeout": 30,            # Tool timeout (seconds)
    "request_limit": 0,                 # 0 = unlimited
    "total_tokens_limit": 0,            # 0 = unlimited
    "memory_config": {"mode": "sliding_window", "value": 10000},
    "enable_advanced_tool_use": True,   # BM25 tool retrieval
    "enable_agent_skills": True,        # Specialized packaged skills
    "memory_tool_backend": "local"      # Persistent working memory
}

📖 Full configuration reference: Configuration Guide →


🧪 Testing & Development

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

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

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

🔍 Troubleshooting

ErrorFix
Invalid API keyCheck .env: LLM_API_KEY=your_key
ModuleNotFoundErrorpip install omnicoreagent
Redis connection failedStart Redis or use MemoryRouter("in_memory")
MCP connection refusedEnsure MCP server is running

📖 More troubleshooting: Basic Usage Guide →


📝 Changelog

See the full Changelog → for version history.


🤝 Contributing

# Fork & clone
git clone https://github.com/omnirexflora-labs/omnicoreagent.git

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

# Submit PR

See CONTRIBUTING.md for guidelines.


📄 License

MIT License — see LICENSE


👨‍💻 Author & Credits

Created by Abiola Adeshina

🌟 The OmniRexFlora Ecosystem

ProjectDescription
🧠 OmniMemorySelf-evolving memory for autonomous agents
🤖 OmniCoreAgentProduction-ready AI agent framework (this project)
⚡ OmniDaemonEvent-driven runtime engine for AI agents

🙏 Acknowledgments

Built on: LiteLLM, FastAPI, Redis, Opik, Pydantic, APScheduler


Building the future of production-ready AI agent frameworks

⭐ Star us on GitHub🐛 Report Bug💡 Request Feature📖 Documentation

Máy chủ liên quan