Skip to content

joggrdocs/funkai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 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, flowAgent 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 — Flow agent 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 { openai } from "@ai-sdk/openai";

const writer = agent({
  name: "writer",
  model: openai("gpt-4.1"),
  system: "You are a helpful writer.",
  tools: { search },
});

const result = await writer.generate({ prompt: "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 --includes "src/agents/**"

Packages

Package Description
@funkai/agents Lightweight agent, tool, and flow agent orchestration
@funkai/models Model catalog, provider resolution, and cost calculations
@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