Skip to content

Patterns Overview

tama has 13 built-in patterns. Every pattern is a pre-wired composition of LLM calls; you declare the pattern and write the prompts — tama handles the control flow.

PatternComplexityRequired filesBest for
oneshot(none)Simple transformations, classification, formatting
react⬤⬤(none)Tool use, research, multi-step reasoning
scatter⬤⬤⬤reduce.mdParallel research, batch processing
parallel⬤⬤(none)Independent analyses, voting
fsm⬤⬤⬤(none)Custom workflows, conditional routing
critic⬤⬤draft.md, critique.md, refine.mdWriting quality, iterative improvement
reflexion⬤⬤⬤reflect.mdSelf-correcting agents, performance improvement
constitutional⬤⬤critique.md, revise.mdSafe generation, principle-adherent output
chain-of-verification⬤⬤⬤verify.md, check.md, revise.mdFactual accuracy, claim verification
plan-execute⬤⬤⬤execute.md, verify.mdComplex tasks with verifiable sub-steps
debate⬤⬤⬤(none — uses named agents)Balanced analysis, decision-making
best-of-n⬤⬤⬤judge.mdHigh-quality generation through selection
human⬤⬤⬤resume.mdHuman-in-the-loop approval, interactive tasks

Under the hood, all patterns are combinations of two primitives:

FSM — sequential steps with routing
Parallel — concurrent steps with collection

The named patterns are pre-wired compositions so you don’t have to write the FSM YAML yourself:

critic = FSM: draft → critique → refine
scatter = FSM(map) → Parallel(workers) → FSM(reduce)
best-of-n = Parallel(N variants) → FSM(judge)
debate = FSM: position-a → position-b → judge

Use fsm directly when none of the named patterns fit your workflow.

Start simple. Most tasks fit oneshot or react:

  • Need just an LLM response? → oneshot
  • Need to use tools or reason in multiple steps? → react
  • Need to improve quality iteratively? → critic or reflexion
  • Need to process many items in parallel? → scatter
  • Need factual accuracy? → chain-of-verification
  • Need a complex custom workflow? → fsm

Patterns with multiple steps load system prompts from separate .md files. These files live alongside AGENT.md in the agent directory and can optionally include their own call: frontmatter to override the model or tools for that specific step:

agents/
essay-critic/
AGENT.md ← pattern: critic, shared config
draft.md ← system prompt for the draft step
critique.md ← system prompt for the critique step
refine.md ← system prompt for the refine step

Each step file can optionally include frontmatter:

---
call:
model:
name: anthropic:claude-opus-4-6
temperature: 0.2
---
You are a meticulous critic. Identify the three most significant weaknesses...

See Step files reference for details.