- ⚡ Functions all the way down —
agent, tool, workflow are functions returning plain objects.
- 🧩 Composition over configuration — Combine small pieces instead of configuring large ones.
- 🛡️ Result, never throw — Every public method returns
Result<T>.
- 🔒 Closures are state — Workflow state is just variables in your handler.
- 📐 Type-driven design — Zod schemas, discriminated unions, exhaustive matching.
npm install @funkai/agents @funkai/prompts
import { agent } from "@funkai/agents";
import { prompts } from "~prompts";
const writer = agent({
name: "writer",
model: "openai/gpt-4.1",
system: prompts("writer"),
tools: { search },
});
const result = await writer.generate("Write about closures");
---
name: writer
schema:
tone: string
---
You are a {{ tone }} writer.
npx funkai prompts generate --out .prompts/client --roots src/agents
| Package |
Description |
@funkai/agents |
Lightweight agent, tool, and workflow orchestration |
@funkai/prompts |
Prompt SDK with LiquidJS templating, Zod validation, and CLI codegen |
@funkai/cli |
CLI for the funkai prompt SDK |
MIT