Python SDK for the Chester AI agent platform
Project description
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)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
chester_ai-0.1.4.tar.gz
(123.3 kB
view details)
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
chester_ai-0.1.4-py3-none-any.whl
(107.7 kB
view details)
File details
Details for the file chester_ai-0.1.4.tar.gz.
File metadata
- Download URL: chester_ai-0.1.4.tar.gz
- Upload date:
- Size: 123.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a23729fedcf5a77a2c4cd233f7ba6b4fc7d9501dfd0bae101cd7ae23cebcf27f
|
|
| MD5 |
d761010294d8c1a19e51270e5b8e1371
|
|
| BLAKE2b-256 |
1e9c54b54c377e2b4542c02f6830eb2ff8831ce59e1480c3e0f552f9dc526d2c
|
File details
Details for the file chester_ai-0.1.4-py3-none-any.whl.
File metadata
- Download URL: chester_ai-0.1.4-py3-none-any.whl
- Upload date:
- Size: 107.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3185b3abb3786ebdf9b664be152ecadb794cb1272c93332269207e481095f45d
|
|
| MD5 |
4c98ba0159838b7a1d18beb21be95625
|
|
| BLAKE2b-256 |
922ce0d80f04d35510d85b6246753664a434738209a0695ebe9110a73ec1c900
|