Fan-Out/Fan-In agentic orchestration framework with multi-provider LLM support and MCP tool integration.
Project description
Cortex Agent FrameworkBuild production-grade AI agents in a single YAML file.Fan-out / fan-in orchestration, multi-LLM routing, MCP tool servers, quality validation, and delta learning — all driven by cortex.yaml.
|
Overview • Architecture • Features • Getting Started • Use Cases • Config • CLI • Deployment • FAQ
Why Cortex?
Every production AI agent eventually needs the same plumbing: task decomposition, parallel tool execution, streaming, validation, retries, session management, multi-provider routing, MCP integration, deployment. Most teams rebuild this stack three times before they ship.
Cortex is that stack, pre-built and configuration-driven. Define your agent once in cortex.yaml, call framework.run_session(), and get a production-ready agent with parallel tool execution, quality scoring, session persistence, hot-reload, and deployability as a Docker service, Python package, or MCP server.
agent:
name: ResearchAgent
description: Searches the web and writes reports
llm_access:
default:
provider: anthropic
model: claude-sonnet-4-5
api_key_env_var: ANTHROPIC_API_KEY
task_types:
- name: web_research
capability_hint: web_search
output_format: md
- name: write_report
capability_hint: document_generation
depends_on: [web_research]
from cortex.framework import CortexFramework
framework = CortexFramework("cortex.yaml")
await framework.initialize()
result = await framework.run_session(
user_id="user_1",
request="Research the latest vector DB benchmarks and write a report",
)
print(result.response)
That's the whole agent. Fan-out, tool calls, dependency resolution, synthesis, validation — all handled.
What you get out of the box
| 8 LLM providers | Anthropic, OpenAI, Gemini, Grok, Mistral, DeepSeek, AWS Bedrock, Azure AI — swap with one YAML line |
| Fan-out / fan-in | Primary agent decomposes into a dependency graph, tasks run in parallel, results synthesised automatically |
| MCP-native | First-class support for SSE, stdio, and streamable-HTTP MCP tool servers |
| Multi-agent mesh | Publish any agent as an MCP server — other agents consume it as a tool. Compose specialist agents into an orchestrator |
| Quality validation | Every response scored on intent match, completeness, coherence. Enforced threshold floor |
| Delta learning | Agent proposes new task types from usage patterns; human-in-the-loop review before apply |
| Streaming | Typed event stream (StatusEvent, ResultEvent, ClarificationEvent) wires cleanly into FastAPI SSE |
| Session persistence | Memory / SQLite / Redis backends with WAL replay and resumable sessions |
| Dev ergonomics | Browser setup wizard, hot-reload, dry-run validation, session replay, config migration |
| Deployability | One command publishes as Docker image, Python wheel, or MCP server |
Get started in 5 minutes
git clone <repo-url>
cd cortex-agent-framework
python -m venv .venv && source .venv/bin/activate
pip install -e .
export ANTHROPIC_API_KEY=sk-ant-...
cortex setup # browser wizard at localhost:7799
cortex dry-run "Hello" # validates config, no LLM calls
cortex dev # run in hot-reload mode
Full walkthrough → docs/GETTING_STARTED.md
Documentation
| Document | Read this if you want to… |
|---|---|
| Overview | …understand what Cortex is, who it's for, and why it exists |
| Architecture | …see the internals: primary agent, task graph compiler, MCP agents, validation, learning |
| Features | …scan the full feature matrix before committing |
| Getting Started | …build your first agent with working code examples |
| Use Cases | …see real-world scenarios and reference architectures |
| Configuration | …look up every cortex.yaml field |
| CLI Reference | …look up every cortex subcommand |
| Deployment | …ship to production (Docker, wheel, MCP, multi-agent mesh) |
| FAQ | …find answers to common questions and gotchas |
| Contributing | …report bugs or submit pull requests |
Community & support
- Issues: file bugs and feature requests on GitHub Issues
- Discussions: ask questions and share configs on GitHub Discussions
- Security: please report vulnerabilities privately, not in public issues
License
MIT — see LICENSE. Use it in commercial products, fork it, modify it, ship it.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cortex_agent_framework-1.0.0.tar.gz.
File metadata
- Download URL: cortex_agent_framework-1.0.0.tar.gz
- Upload date:
- Size: 145.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c39406523335d3e81b3bfbf5688cd469a0a64683c8ef101ac6bffd212322b08
|
|
| MD5 |
993932f300805e01abb74cb927933d7f
|
|
| BLAKE2b-256 |
a581f5ef522a7d375ea6b3eace0c609a6719b17303a14844981ca36ed638e7fa
|
Provenance
The following attestation bundles were made for cortex_agent_framework-1.0.0.tar.gz:
Publisher:
publish.yml on kritird/Cortex-Agent-Framework
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cortex_agent_framework-1.0.0.tar.gz -
Subject digest:
4c39406523335d3e81b3bfbf5688cd469a0a64683c8ef101ac6bffd212322b08 - Sigstore transparency entry: 1317361941
- Sigstore integration time:
-
Permalink:
kritird/Cortex-Agent-Framework@9a1d424a0a51a20fbe7bb32626823b10e44ecf06 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/kritird
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9a1d424a0a51a20fbe7bb32626823b10e44ecf06 -
Trigger Event:
release
-
Statement type:
File details
Details for the file cortex_agent_framework-1.0.0-py3-none-any.whl.
File metadata
- Download URL: cortex_agent_framework-1.0.0-py3-none-any.whl
- Upload date:
- Size: 173.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e9339a56ee37dc4a40ad06e9a0fb328d206ca4ea0294d3e3ad1220b0092f0886
|
|
| MD5 |
26c4c0818903ec0000eec4a3e8e7e4b2
|
|
| BLAKE2b-256 |
46aca37f773f06e82cf6743b46f7a712b76ae61a650784b711d7197178fe9fd3
|
Provenance
The following attestation bundles were made for cortex_agent_framework-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on kritird/Cortex-Agent-Framework
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cortex_agent_framework-1.0.0-py3-none-any.whl -
Subject digest:
e9339a56ee37dc4a40ad06e9a0fb328d206ca4ea0294d3e3ad1220b0092f0886 - Sigstore transparency entry: 1317361952
- Sigstore integration time:
-
Permalink:
kritird/Cortex-Agent-Framework@9a1d424a0a51a20fbe7bb32626823b10e44ecf06 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/kritird
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9a1d424a0a51a20fbe7bb32626823b10e44ecf06 -
Trigger Event:
release
-
Statement type: