ChatCortex
ChatCortex is a framework for automated synthesis and optimization of AI agent architectures — think AutoML for AI agents.
Instead of manually wiring LLM pipelines (retrieval → LLM → verifier → tool), ChatCortex treats agent design as a multi-objective architecture search problem and automatically discovers architectures that optimize cost, latency, and reliability simultaneously.
Task Specification → Architecture Search → Pareto-Optimal Architectures
Installation
pip install chatcortex
Or from source:
git clone https://github.com/siddharth1012/chatCortex
cd chatCortex
pip install -e .
Quickstart
from chatcortex import (
TaskSpecification,
BeamSynthesizer,
build_demo_registry,
)
# A registry of components with cost/latency/reliability tradeoffs
registry = build_demo_registry(
capabilities=("retrieval", "generation", "verification")
)
# The task: an ordered capability chain with hard constraints
task = TaskSpecification(
required_capabilities=["retrieval", "generation", "verification"],
max_cost=0.02,
max_latency=1500,
)
# Synthesize Pareto-optimal architectures
synth = BeamSynthesizer(registry, beam_width=5)
for arch in synth.synthesize(task):
print(
f"cost=${arch.total_cost:.4f} "
f"latency={arch.total_latency:.0f}ms "
f"reliability={arch.total_reliability:.3f}"
)
Or run the full demo comparing three synthesis strategies:
python examples/quickstart.py
To see the full loop — load a JSON registry, synthesize a frontier, execute one architecture, and calibrate the registry's metadata from real telemetry — run:
python examples/registry_from_json.py
To search over your own components, build a CapabilityRegistry and register
ComponentMetadata describing each model, tool, or verifier — see
examples/ for complete walkthroughs.
How It Works
ChatCortex is organized as a layered architecture synthesis system:
TaskSpecification → CapabilityRegistry → Synthesis Engine → AgentGraph (DAG)
→ Execution Engine → Telemetry → Evaluation Harness → Pareto Optimization
Core concepts:
- ComponentMetadata — declarative description of an agent component (model, retriever, tool, verifier, memory) with cost per call, latency, reliability score, and privacy level.
- CapabilityRegistry — stores components and filters candidates by capability and privacy constraints.
- TaskSpecification — the synthesis problem: an ordered capability chain plus hard constraints (max cost, max latency, privacy) and objective weights.
- AgentGraph — architectures represented as DAGs; cost is additive, latency sequential, reliability multiplicative.
- Synthesizers — search strategies that map a task to an (approximate) Pareto frontier.
Available synthesizers:
| Synthesizer | Strategy |
|---|---|
HeuristicSynthesizer |
Greedy deterministic construction |
RandomSynthesizer |
Random baseline |
BeamSynthesizer |
Budget-aware beam search |
ParetoPartialBeamSynthesizer |
Beam search with per-stage Pareto pruning |
ProgressiveParetoBeamSynthesizer |
Depth-aware beam widening (best Pareto recovery) |
ExhaustiveSynthesizer |
Exact Pareto frontier (small spaces) |
Approximation quality is measured with Pareto coverage, hypervolume loss, and average regret — see docs/BENCHMARKS.md.
Documentation
- Architecture — system design and component layers
- Benchmarks — experimental evaluation of synthesis strategies
- Examples — runnable demos and budget-sweep experiments
- Contributing — development setup and PR guidelines
- Changelog
Research Context
ChatCortex is a controlled experimental platform for studying automated agent architecture synthesis: multi-objective optimization, architecture search, reliability–cost tradeoffs, and AutoML-style agent design. Experiments cover 5-stage pipelines with Pareto frontiers up to 95 architectures and evaluation budgets from 20 to 180 evaluations; progressive beam widening shows improved Pareto recovery over static beam strategies.
If you use ChatCortex in your research, please cite it (see CITATION.cff).
Roadmap
- Component modeling, capability registry, task specification, DAG representation
- Exact Pareto frontier computation (exhaustive search)
- Budget-aware beam search with Pareto pruning and progressive widening
- Graph-structured (non-chain) agent synthesis
- Real model / tool integrations (OpenAI chat-completions backend already available behind the
chatcortex[real]extra; more backends planned) - Registry loading from JSON (
load_registry, with error messages naming the failing field); YAML planned
Status
Research framework under active development (alpha). APIs may change between minor versions.
License
MIT — developed by Siddharth Saraswat
Metadata
Release files for chatcortex 0.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| chatcortex-0.6.0.tar.gz | 42.4 kB | With provenance | Details for chatcortex-0.6.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| chatcortex-0.6.0-py3-none-any.whl | Python 3 | none | any | Details for chatcortex-0.6.0-py3-none-any.whl |
Total release size: 77.8 kB
Release files / chatcortex-0.6.0.tar.gz
| Download URL | chatcortex-0.6.0.tar.gz |
|---|---|
| Size | 42.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c4973f6321d82b0abf69f079f3baebe36fe3d39dcebc022cd933ed3f8ec10e1c
|
|
BLAKE2b-256 checksum How to use checksums |
975f01195d2f8945a3d0b17efabeff6c8fe7cb2885cfddd7eaf8927d4fb29a1a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.
Transparency logRelease files / chatcortex-0.6.0-py3-none-any.whl
| Download URL | chatcortex-0.6.0-py3-none-any.whl |
|---|---|
| Size | 35.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
495a699587192099427bcf2cad17ec7a86e173b1f771a532796ef764504c5a0b
|
|
BLAKE2b-256 checksum How to use checksums |
b83af4a382ad9cbe132323018dc041a5b3d5d288f165b4d1231caa0b80fe49d4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.
Transparency logSecurity for chatcortex 0.6.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for chatcortex-0.6.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.