Agents & tools
Place model reasoning inside typed, testable workflows.
Configure a provider
Providers are ordinary actor dependencies. OpenAI, Anthropic, and Google ship with typed model catalogs and read TW_OPEN_AI_KEY, TW_ANTHROPIC_KEY, and TW_GOOGLE_AI_KEY. Use Provider for custom OpenAI-compatible hosts.
import { Actor, Anthropic } from "taskwish"; export const { actor } = Actor("Researcher") .use(Anthropic);
Agent steps
Agents can reason and call declared tools while deterministic steps prepare inputs, validate results, and produce side effects. Their streamed lifecycle is visible in Console.
import { Agent, Step } from "taskwish"; import { actor } from "./researcher"; export const { research } = actor() .on("Command", "research") .input({ question: "string" }) .run( Agent({ model: "anthropic/claude-sonnet-4-6", instructions: "Answer with concise, cited findings.", }), Step("answerQuestion", function () { return this.agent.generate({ prompt: this.input.question }); }), ) .meta({ description: "Research a question with Claude", });
Start from a working architecture
The agent-loops template includes 18 patterns such as ReAct, reflection, evaluator-optimizer, supervisor-worker, and human approval. The agent-graphs template includes six topologies for routing, parallel work, map-reduce, hierarchy, and fallback.
bunx @taskwish/create-project my-agents --template agent-loopsNote
Unit tests inject mock agents, so your test suite does not need a model server or API credentials.