Quick Start ⚔️
Zoro SDK is a sharp, production-grade AI Agent framework built from scratch in TypeScript, inspired by the strength and precision of Roronoa Zoro.
Define agents, attach typed tools, add guardrails, and run multi-agent workflows with total type safety.
Installation
npm install zoro-sdk zod
Environment Setup
Create a .env file in your project root:
DEEPSEEK_API_KEY="your-deepseek-api-key"
Your First Agent
import 'dotenv/config';
import { Agent, DeepSeekProvider, InMemoryProvider, Tool } from 'zoro-sdk';
import { z } from 'zod';
// 1. Define a tool with Zod schema
const weatherTool = new Tool({
name: 'getWeather',
description: 'Get current weather for a location',
schema: z.object({ location: z.string() }),
execute: async ({ location }) => {
return { temperature: 72, condition: 'Sunny', location };
}
});
// 2. Create an agent
const agent = new Agent({
name: 'ZoroBot',
instructions: 'You are a helpful AI assistant.',
model: new DeepSeekProvider({ model: 'deepseek-v4-flash' }),
memory: new InMemoryProvider(),
tools: [weatherTool],
});
// 3. Execute
const result = await agent.run('What is the weather in San Francisco?', 'session-1');
console.log(result.output);
// → "The weather in San Francisco is 72°F and Sunny!"
Core Architecture
| Component | Description |
|---|---|
| Agent | The core orchestrator holding instructions, model, tools, and memory |
| Tool | A typed, Zod-validated function executable by the agent |
| MemoryProvider | Session history backend (InMemoryProvider or SQLiteProvider) |
| ModelProvider | Unified model API abstraction (DeepSeekProvider, OpenAIProvider) |
| Guardrail | Validates input/output before or after model execution |
| Handoff | Seamlessly transfers control from one agent to another |
| AgentEmitter | Real-time event stream powering full observability |