QuickStart Guide
Welcome to the Kikoyu Agent SDK QuickStart! This comprehensive guide will take you from zero to building, extending, and orchestrating multi-agent systems with type safety, tool calling, and autonomous handoffs.
Project Setup
Get started by initializing a Node.js TypeScript project and installing @kikoyu/core.
1. Initialize Project & Install Dependencies
Create a project directory and install @kikoyu/core along with TypeScript and dotenv:
2. Configure TypeScript (tsconfig.json)
Create a tsconfig.json in your project root:
3. Environment Configuration (.env)
Create a .env file containing your API key:
Create your first agent
In Kikoyu, agents are constructed using the fluent Agent.builder() API. This pattern ensures immutability, type safety, and compile-time validation.
Create a file named index.ts:
Run your first agent
To execute an agent run, instantiate a Runner and call runner.run(agent, prompt).
Add execution logic to index.ts:
Run the script:
Give your agent tools
Tools allow agents to call external APIs, run calculations, or query databases. Define type-safe tools using createTool with Zod parameters.
Add a few more agents
Build specialized domain agents to handle specific responsibilities in your application.
Define your handoffs
Handoffs enable autonomous agent delegation. When an agent determines another specialist is better suited for a task, it transfers execution seamlessly via createHandoff.
Run the agent orchestration
Execute multi-agent workflows through the entry-point router agent. Runner handles tool execution and agent handoffs automatically.
Putting it all together
Here is the complete, runnable single-file TypeScript script combining project setup, custom tools, specialist agents, handoffs, and multi-agent orchestration:
HTTP API (@kikoyu/api)
The optional Next.js package exposes /api/agents/run and /api/agents/stream.
Operational notes:
- Set
API_KEYin production; without it, authenticated routes return401. - Registered
agentIdvalues use an in-process registry and are cleared when the server restarts. sessionIduses a shared in-memory store per API process; useRedisStoreorFileStorefrom@kikoyu/corefor durable or multi-instance deployments.