Skip to main content

chester-ai

Python SDK for the Chester AI agent platform. Build a consulting firm on an API.

Install

pip install chester-ai
# or
uv add chester-ai

Quick Start

The high-level API uses consulting language that matches chester.ai:

from chester_ai import Chester, Step, Gate, PricingRule

chester = Chester(url="localhost:8990", api_key="cht_your_api_key_here")

# Deploy consultants
analyst = chester.consultant("market-analyst",
    identity="You are a market sizing specialist.",
    model="claude-sonnet-4-20250514")

researcher = chester.consultant("researcher",
    identity="You are a research analyst.",
    model="claude-sonnet-4-20250514")

# Brief a consultant (async task)
task_id = analyst.brief("Estimate the TAM for AI consulting in 2026")

# Stream a conversation
for text in analyst.chat("What methodology do you use for market sizing?"):
    print(text, end="")

# Persistent memory
analyst.remember("Client prefers conservative estimates with 95% confidence intervals")
print(analyst.recall())

Practice Groups (Teams)

# Create a due diligence practice
practice = chester.practice("dd-practice",
    coordinator="dd-lead",
    members=["market-analyst", "fin-analyst", "legal-reviewer"])

# Run an engagement
result = practice.run("Conduct due diligence on TargetCo — $500M acquisition")

# Shared practice memory
practice.memory = "This practice focuses on tech M&A in the $100M-$1B range"

Client Models (Digital Twins)

# Define a client model type
type_id = chester.client_model_type("enterprise-client",
    description="Fortune 500 client model",
    base_agent="analyst")

# Create a persistent client model
acme = chester.client_model("Acme Corp",
    type_id=type_id,
    external_id="crm-12345")

# Feed it knowledge
acme.learn("engagement_start", '{"deal_size": "500M", "sector": "tech"}')

# Query the model
answer = acme.query("What is this client's risk appetite?")

Project Boards (Kanban)

board = chester.board("acme-dd-pipeline", description="Due diligence tracker")
board.add_card("Market Sizing", agent_name="market-analyst")
board.add_card("Financial Model", agent_name="fin-analyst")
board.execute()  # agents start working

Objectives (Cognitive Goals)

obj = chester.objective("market-analyst",
    "Complete market sizing for Acme deal",
    budget_usd=5.0,
    acceptance_criteria="TAM/SAM/SOM with confidence intervals")

# The agent works autonomously, escalating when it needs human input
for esc in obj.escalations:
    obj.resolve_escalation(esc.id, "Proceed with conservative estimate")

Outcome Pricing

# Compose pricing rules
chester.pricing_rule(PricingRule(
    dimension="deliverable", rate=2500.0,
    entity_name="market-analyst", notes="Per market sizing report"))

chester.pricing_rule(PricingRule(
    dimension="month", rate=8000.0,
    notes="Monthly retainer for ongoing advisory"))

# Check margins
report = chester.margin_report(days=30)

# Generate invoice
chester.generate_invoice("2026-04")

Engagement Workflows

# Define a reusable engagement template
template_id = chester.engagement("due-diligence-flow",
    description="Full commercial DD workflow",
    steps=[
        Step(instruction="Market sizing analysis", agent="market-analyst"),
        Step(instruction="Financial model review", agent="fin-analyst"),
        Gate(name="partner-review"),  # human approval
        Step(instruction="Risk assessment", agent="legal-reviewer"),
        Step(instruction="Executive summary", agent="dd-lead"),
        Gate(name="client-delivery"),
    ])

# Run it
chester.run_engagement(template_id, entity_id="acme-corp")

Human-in-the-Loop

# Review pending decisions across all consultants
for decision in chester.pending_decisions():
    print(f"{decision.agent}: {decision.question}")
    chester.decide(decision.decision_id, "Approved")

Raw gRPC Access

The full 27-service gRPC API is available as an escape hatch:

# Via the Chester high-level client
chester.rpc.agents.ListAgents(proto.ListAgentsRequest())
chester.rpc.queue.SendTask(proto.SendTaskRequest(agent="bot", message="hello"))

# Or directly
from chester_ai import ChesterClient, proto
client = ChesterClient(url="localhost:8990", api_key="cht_...")
client.agents.ListAgents(proto.ListAgentsRequest())

Requirements

  • Python 3.10+
  • Chester daemon running (default port 8990)

Metadata

Release files for chester-ai 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for chester-ai 0.1.4
File Size Uploaded
chester_ai-0.1.4.tar.gz 123.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for chester-ai 0.1.4
File Interpreter ABI Platform
chester_ai-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 231.0 kB

Release files / chester_ai-0.1.4.tar.gz

Download URL chester_ai-0.1.4.tar.gz
Size 123.3 kB
Tags Source
SHA-256 checksum
How to use checksums
a23729fedcf5a77a2c4cd233f7ba6b4fc7d9501dfd0bae101cd7ae23cebcf27f
BLAKE2b-256 checksum
How to use checksums
1e9c54b54c377e2b4542c02f6830eb2ff8831ce59e1480c3e0f552f9dc526d2c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.3

Release files / chester_ai-0.1.4-py3-none-any.whl

Download URL chester_ai-0.1.4-py3-none-any.whl
Size 107.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3185b3abb3786ebdf9b664be152ecadb794cb1272c93332269207e481095f45d
BLAKE2b-256 checksum
How to use checksums
922ce0d80f04d35510d85b6246753664a434738209a0695ebe9110a73ec1c900
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.3

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page