Develop AI Agents With Type-Safe Precision

Content & code in perfect harmony. Build tool-calling loops, zero-latency guardrails, multi-agent handoffs, session memory, and streaming in seconds.

import { Agent, Runner } from '@kikoyu/core';

// 1. Build agent with Kikoyu API Key
const agent = Agent.builder()
  .setName('Assistant')
  .setInstructions('You are a helpful AI assistant that responds in concise sentences.')
  .setApiKey(process.env.KIKOYU_API_KEY!)
  .build();

// 2. Execute multi-turn loop
const runner = new Runner();
const result = await runner.run(agent, 'Hello! Who are you?');

console.log(result.text);
>_LIVE AGENT TERMINAL OUTPUT
STATUS: READY
Click "Run Agent" above to simulate real-time agent execution...
0ms
Cold-Start Overhead
100%
Type-Safe Zod Schemas
22 / 22
Verified Test Suite
ESM + CJS
Dual Target Output
Core SDK Architecture

Everything You Need to Build
Autonomous Systems

A comprehensive toolkit engineered for reliability, safety, and modern TypeScript workflows.

schema_v1.zod
location: z.string()
unit: z.enum([...])

Zod Tool Registry

Define tools with Zod schemas. Function arguments are strictly validated before execution with auto-generated JSON schema definitions.

Latency0.4ms
Filter 0ms (0%)

Concurrent Guardrails

Execute input safety filters in parallel with model requests for zero added latency. Abort malicious prompt injections cleanly.

A
B

Multi-Agent Handoffs

Decompose complex agent logic into specialized agents. Control transfers dynamically between triage routers and specialist agents.

MemoryStore#1042
turn_history: [5 turns]

Session Memory

Storage-agnostic session managers (MemoryStore) retain conversation turn history across multiple separate Runner.run() calls.

stream()
Active
"text_delta": "space..."

Async Generator Streaming

Stream token text deltas, tool call lifecycle events, and handoff transitions in real time directly to your user interface.

.setName('Assistant')
.setInstructions(...)
.build()

Fluent AgentBuilder

Construct immutable agent configurations using chainable builder methods with strict .build() validation.

Why Kikoyu Agent SDK?

Designed to eliminate complex framework boilerplate without sacrificing flexibility.

FeatureKikoyu SDKTraditional Frameworks
Type Safety100% Strict Zod InferencedPartial / Manual Casting
Guardrails Overhead0ms (Concurrent Parallel)Sequential (+500ms Latency)
Agent HandoffsBuilt-in First Class Tool PrimitivesCustom Graph Routing Boilerplate
API & HTTP StreamingNative Next.js App Router PackageManual Adapter Wiring