SDK documentation is being finalized. Request early access to get notified when it's ready.
TypeScript SDK

Build Agents in TypeScript

Define agents, workflows, and deployments in type-safe TypeScript. Git-native. Version-controlled. Production-ready.

Installation

Get Started in Seconds

Install the SDK and CLI, then define your first agent.

terminal
# Install the SDK
npm install @orchstack/sdk

# Install the CLI globally
npm install -g @orchstack/cli

# Authenticate
orchstack login
Quick Start

Define Your First Agent

A complete agent definition in under 20 lines of TypeScript.

booking-agent.ts
import { Agent, Workflow, Tool } from '@orchstack/sdk';

const bookingAgent = new Agent({
  name:      'Booking Agent',
  model:     'claude-sonnet-4',
  tools:     [Tool.calendar(), Tool.payments()],
  memory:    { session: true, longTerm: true },
  knowledge: ['services-kb', 'faq'],
  guardrails: { pii: true, maxTokens: 4096 },
});

const workflow = new Workflow({
  name: 'Booking Flow',
  steps: [bookingAgent.classify(), bookingAgent.execute()],
});

await workflow.deploy();
// → Live on all configured channels
Key Concepts

Core SDK Primitives

Six building blocks that compose into any agent architecture.

Agent

The core primitive. An agent wraps an LLM with tools, memory, knowledge, and guardrails into a single deployable unit.

Workflow

Chain agents and actions into multi-step pipelines with conditions, loops, and human approval gates.

Tool

External capabilities your agent can invoke — APIs, databases, MCP servers, or custom functions with typed inputs/outputs.

Memory

Five memory tiers — session, long-term, entity, shared, and collective — all managed automatically by the runtime.

Knowledge

RAG-powered knowledge bases with hybrid search, chunking strategies, and source-attributed responses.

Guardrails

PII detection, content filtering, token limits, cost caps, and custom validation rules applied at every execution step.

CLI

Ship from the Terminal

Deploy, test, and manage agents without leaving your editor.

terminal
# Deploy agent to production
orchstack deploy ./booking-agent.ts

# Run test suite against agent
orchstack test --suite booking-tests

# Tail live agent logs
orchstack logs --agent booking-agent --follow

# List running agents
orchstack agents list --status active

# Roll back to previous version
orchstack rollback booking-agent --to v2
Features

Developer Experience First

Built for developers who want to ship agents, not fight tooling.

Type Safety

Full TypeScript type inference for agent configs, tool inputs/outputs, and workflow steps. Catch errors at compile time.

Git Native

Agent definitions are code. Branch, commit, PR, merge — use your existing Git workflow for agent development.

CLI Tools

Deploy, test, logs, rollback, and manage agents from the command line. CI/CD ready out of the box.

Hot Reload

Change your agent definition and see updates instantly in development mode. No restart required.

Test Suite

Write test cases for your agents in TypeScript. Run automated regression tests on every change.

Auto-deploy

Push to main and your agents deploy automatically. Zero-downtime blue-green deployments built in.

Frequently Asked Questions

Start Building Agents in Code

npm install @orchstack/sdk and ship your first agent today.

Now in early access · No credit card required