Skip to content

siddharth1012/chatCortex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

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

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

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