@chester-ai/sdk
v0.2.0
Published
TypeScript SDK for the Chester AI agent platform
Maintainers
Readme
@chester-ai/sdk
TypeScript SDK for the Chester AI agent platform. Build a consulting firm on an API.
Install
npm install @chester-ai/sdk
# or
pnpm add @chester-ai/sdkQuick Start
The high-level API uses consulting language that matches chester.ai:
import { Chester, Step, Gate } from "@chester-ai/sdk";
const chester = new Chester({
url: "http://localhost:8990",
apiKey: "cht_your_api_key_here",
});
// Deploy consultants
const analyst = await chester.consultant("market-analyst", {
identity: "You are a market sizing specialist.",
model: "claude-sonnet-4-20250514",
});
// Brief a consultant (async task)
const taskId = await analyst.brief("Estimate the TAM for AI consulting in 2026");
// Stream a conversation
for await (const text of analyst.chat("What methodology do you use?")) {
process.stdout.write(text);
}
// Persistent memory
await analyst.remember("Client prefers conservative estimates");
console.log(await analyst.recall());Practice Groups (Teams)
const practice = await chester.practice("dd-practice", {
coordinator: "dd-lead",
members: ["market-analyst", "fin-analyst", "legal-reviewer"],
});
const result = await practice.run("Conduct due diligence on TargetCo");Client Models (Digital Twins)
const typeId = await chester.clientModelType("enterprise-client", {
description: "Fortune 500 client model",
baseAgent: "analyst",
});
const acme = await chester.clientModel("Acme Corp", {
typeId,
externalId: "crm-12345",
});
await acme.learn("engagement_start", '{"deal_size": "500M"}');
const answer = await acme.query("What is this client's risk appetite?");Engagement Workflows
const templateId = await chester.engagement("due-diligence-flow", {
steps: [
Step({ instruction: "Market sizing", agent: "market-analyst" }),
Step({ instruction: "Financial review", agent: "fin-analyst" }),
Gate({ name: "partner-review" }),
Step({ instruction: "Executive summary", agent: "dd-lead" }),
],
});
await chester.runEngagement(templateId, { entityId: "acme-corp" });Project Boards, Objectives, Pricing
// Kanban board
const board = await chester.board("acme-pipeline");
await board.addCard("Market Sizing", { agentName: "market-analyst" });
await board.execute();
// Cognitive objective
const obj = await chester.objective("analyst", "Complete market sizing", {
budgetUsd: 5.0,
});
// Outcome pricing
await chester.pricingRule({
dimension: "deliverable",
rate: 2500,
notes: "Per market sizing report",
});Raw gRPC Access
The full 27-service gRPC API is available via chester.rpc:
// Escape hatch to any RPC
const { agents } = await chester.rpc.agents.listAgents({});
await chester.rpc.queue.sendTask({ agent: "bot", message: "hello" });
// Or use ChesterClient directly
import { ChesterClient } from "@chester-ai/sdk";
const client = new ChesterClient({ url: "http://localhost:8990", apiKey: "cht_..." });Requirements
- Node.js 18+ or modern browser
- Chester daemon running with gRPC-web enabled (default on port 8990)
