Metadata-Version: 2.4
Name: chatcortex
Version: 0.4.0
Summary: Framework for multi-objective synthesis and optimization of AI agent architectures under bounded evaluation budgets
Author: Siddharth Saraswat
License: MIT
Project-URL: Homepage, https://github.com/siddharth1012/chatCortex
Project-URL: Repository, https://github.com/siddharth1012/chatCortex
Project-URL: Issues, https://github.com/siddharth1012/chatCortex/issues
Keywords: automl,multi-objective-optimization,agent-architecture,llm-agents,pareto-optimization,architecture-search,beam-search,ai-systems
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: networkx>=2.8
Requires-Dist: numpy>=1.23
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: black>=23.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Provides-Extra: viz
Requires-Dist: matplotlib>=3.7; extra == "viz"
Dynamic: license-file

# ChatCortex

**ChatCortex** is a framework for **automated synthesis and optimization
of AI agent architectures**.

Instead of manually wiring LLM pipelines such as:

retrieval → LLM → verifier → tool

ChatCortex treats agent design as a **multi-objective architecture
search problem** and automatically discovers architectures that
optimize:

-   **Cost**
-   **Latency**
-   **Reliability**

The project can be viewed as **AutoML for AI Agents**.

------------------------------------------------------------------------

# Vision

Modern AI agents are typically constructed through manual orchestration
of:

-   Large Language Models
-   Retrieval systems
-   Tools and APIs
-   Verification modules
-   Memory systems

This approach is often:

-   brittle
-   expensive
-   difficult to optimize
-   difficult to reproduce

ChatCortex introduces a **formal synthesis framework** where agent
architectures are **automatically generated from task specifications**
and evaluated under system constraints.

Long-term goal:

> Automated synthesis of reliable AI agents from high-level intent.

------------------------------------------------------------------------

# Key Idea

Instead of designing agent pipelines manually:

Engineer → Manual Pipeline Design

ChatCortex enables:

Task Specification → Architecture Search → Pareto-Optimal Architectures

Architectures are evaluated across multiple objectives:

-   **minimize cost**
-   **minimize latency**
-   **maximize reliability**

------------------------------------------------------------------------

# Architecture Overview

ChatCortex is organized as a layered architecture synthesis system.

TaskSpecification\
↓\
CapabilityRegistry\
↓\
Synthesis Engine\
↓\
AgentGraph (DAG)\
↓\
Execution Engine\
↓\
Telemetry\
↓\
Evaluation Harness\
↓\
Pareto Optimization

Each layer isolates a specific concern in automated agent architecture
synthesis.

------------------------------------------------------------------------

# Core Components

## ComponentMetadata

Formal representation of agent components such as:

-   language models
-   retrieval systems
-   tools
-   verification modules
-   memory modules

Each component defines:

-   capabilities
-   cost per call
-   latency
-   reliability score
-   privacy level

Components are immutable and purely declarative.

------------------------------------------------------------------------

## CapabilityRegistry

Central registry responsible for:

-   component registration
-   capability filtering
-   privacy constraint enforcement

The registry **does not perform optimization** --- it only provides
valid components for synthesis.

------------------------------------------------------------------------

## TaskSpecification

Defines the architecture synthesis problem.

Example:

``` python
from chatcortex import TaskSpecification

task = TaskSpecification(
    required_capabilities=[
        "retrieval",
        "generation",
        "verification"
    ],
    max_cost=0.01,
    max_latency=2000
)
```

------------------------------------------------------------------------

## Synthesizers

ChatCortex includes multiple architecture synthesis strategies.

-   **HeuristicSynthesizer** --- Greedy deterministic architecture
    construction.
-   **RandomSynthesizer** --- Random baseline for stochastic
    exploration.
-   **BeamSynthesizer** --- Budget-aware approximate architecture
    search.
-   **ExhaustiveSynthesizer** --- Computes the exact Pareto frontier.
-   **ProgressiveParetoBeamSynthesizer (v0.4.0)** --- Depth-aware beam
    widening improving Pareto recovery.

------------------------------------------------------------------------

# AgentGraph

Agent architectures are represented as **Directed Acyclic Graphs
(DAGs)**.

Aggregated metrics:

-   total cost (additive)
-   total latency (sequential assumption)
-   reliability (multiplicative model)

------------------------------------------------------------------------

# Execution Engine

Two execution modes:

### Deterministic Mode

Used for structural validation and reproducible testing.

### Probabilistic Mode

Simulates real-world reliability using component success probabilities.

------------------------------------------------------------------------

# Evaluation Harness

Supports:

-   multiple tasks
-   multiple synthesizers
-   stochastic trials
-   reproducible experiments

Outputs:

-   average cost
-   average latency
-   success rate

------------------------------------------------------------------------

# Multi-Objective Evaluation Metrics

-   **Pareto Coverage**
-   **Hypervolume Loss**
-   **Average Regret (cost, latency, reliability)**

------------------------------------------------------------------------

# Example

``` python
from chatcortex import TaskSpecification, BeamSynthesizer

task = TaskSpecification(
    required_capabilities=[
        "retrieval",
        "generation",
        "verification"
    ]
)

synth = BeamSynthesizer(beam_width=5)

architectures = synth.synthesize(task)

for arch in architectures:
    print(arch.total_cost(), arch.total_latency())
```

------------------------------------------------------------------------

# Installation

``` bash
pip install chatcortex
```

------------------------------------------------------------------------

# Research Context

ChatCortex is a **controlled experimental platform for studying
automated AI agent architecture synthesis**.

Research areas:

-   multi-objective optimization
-   architecture search
-   AI agent systems
-   reliability-cost tradeoffs
-   AutoML-style agent design

------------------------------------------------------------------------

# Experimental Validation

Tested on dense architecture spaces:

-   5-stage synthesis pipelines
-   up to 95-point Pareto frontiers
-   budget sweeps from 20 → 180 evaluations
-   beam width sweeps from 3 → 15

Progressive Pareto Beam Widening demonstrates improved Pareto recovery
compared to static beam strategies.

------------------------------------------------------------------------

# Roadmap

### Phase 1 --- Foundations

-   component modeling
-   capability registry
-   task specification
-   agent graph representation

### Phase 2 --- Exact Optimization

-   exhaustive architecture search
-   exact Pareto frontier computation

### Phase 3 --- Budget-Aware Search (Complete)

-   beam search synthesis
-   Pareto-aware pruning
-   progressive beam widening

### Future Directions

-   graph-structured agent synthesis
-   real model / tool integrations
-   enterprise optimization layers

------------------------------------------------------------------------

# Status

ChatCortex is currently a **research framework under active
development**.

------------------------------------------------------------------------

# License

MIT License

------------------------------------------------------------------------

Developed by **Siddharth Saraswat**
