Dashboard|

Agents SDK

Build agents in code: tools, handoffs, guardrails and approvals, on any model, on Cencori's durable runtime.

cencori/agents is a code-first SDK for building agents. You define agents and tools in TypeScript, your tools run in your process, and every run lives in a Cencori session: durable, traced, and able to wait hours for a human.

import { Agent, run, tool } from 'cencori/agents';
import { z } from 'zod';
 
const getOrder = tool({
    name: 'get_order',
    description: 'Look up an order by id.',
    parameters: z.object({ id: z.string() }),
    execute: async ({ id }) => db.orders.find(id),
});
 
const support = new Agent({
    name: 'Support',
    instructions: 'Help customers with their orders. Be brief.',
    tools: [getOrder],
});
 
const result = await run(support, 'Where is order 1042?');
console.log(result.finalOutput);

Why build on Cencori

What you get
Any modelEvery model in the catalog: OpenAI, Anthropic, Gemini, open-weight models. Change model and nothing else.
Your tools stay yoursTools run in your process, with your database and secrets. Cencori never sees them.
Durable runsA run is a session. Approvals can wait hours; the state survives restarts.
Human reviewneedsApproval pauses a run until someone decides. Approvals land in your governance ledger.
TracesEvery turn, tool call, handoff and model call in Observability → Traces.
Billing and limitsPer-user quotas, end-user billing, budgets and PII rules from the gateway apply to every model call.
UIAgent UI: a chat where the agent answers with charts, tables and forms.

What's in the SDK

PieceUse it forRead next
AgentA model, instructions, tools and behaviourAgent definitions
tool()Functions the agent can callTools
run()Running an agent, streaming, continuing a conversationRunning agents
handoffs, asTool()Several agents working togetherOrchestration
Guardrails, needsApproval, RunStateChecking input and output, human reviewGuardrails and approvals
widgets, createAgentChatHandlerA chat UI the agent can draw inAgent UI

Install

npm install cencori zod

Set CENCORI_API_KEY to a secret project key (csk_...). zod is optional: tools also accept JSON Schema or any Standard Schema library.

Next: the quickstart.