Skip to content

joggrdocs/funkai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
funkai

A composable AI microframework built on ai-sdk, curried with funk-tional programming flair.

CI npm version License

Features

  • Functions all the way downagent, 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.

Install

npm install @funkai/agents @funkai/prompts

Usage

Create an agent

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");

Define a prompt

---
name: writer
schema:
  tone: string
---
You are a {{ tone }} writer.

Generate typed prompts

npx funkai prompts generate --out .prompts/client --roots src/agents

Packages

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

License

MIT

About

A composable AI microframework built on ai-sdk, curried with funk-tional programming flair.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Contributors

Languages