Introduction

Hankweave

A runtime for reliable, brownfield AI engineering.

Hankweave freezes ephemeral agentic behaviors into hanks—declarative, reproducible AI programs that execute deterministically. When your agent fails on run #47, you don't debug "emergent behavior." You trace the exact sequence of events, roll back to a checkpoint, and fix it.

Brownfield means working with existing systems—maintenance, evolution, the messy reality of production. Hankweave is built for AI systems that need to keep working six months from now.


How It Works

A hank is a JSON file that defines your agentic workflow. It's made of codons—atomic units of work, each with a prompt, a model, and tracked files. The runtime executes this workflow, creating checkpoints and detailed event logs along the way.

Text
┌──────────────────────────────────────────────────────────────────────────────┐
│  HANK: data-codebook                                                         │
├──────────────────────────────────────────────────────────────────────────────┤
│                                                                              │
│  ┌──────────┐   ┌──────────┐   ┌──────────┐   ┌──────────┐   ┌──────────┐    │
│  │ Observe  │──▶│  Schema  │──▶│  Enrich  │──▶│ Annotate │──▶│ Diagrams │    │
│  │ (gemini) │   │ (sonnet) │   │ (gemini) │   │ (sonnet) │   │ (sonnet) │    │
│  └──────────┘   └──────────┘   └──────────┘   └──────────┘   └──────────┘    │
│       │              │              │              │              │          │
│       ▼              ▼              ▼              ▼              ▼          │
│  observations   zod schemas    enriched      annotated     visualizations    │
│  + questions                    context       schemas                        │
│                                                                              │
└──────────────────────────────────────────────────────────────────────────────┘

Each codon runs in isolation with a fresh context window. Between codons, context can be passed forward or firewalled. When something fails, you debug that specific codon at that specific point—not "the agent."

Key features:

  • Checkpoints — Every codon completion creates a git commit. Roll back to any point.
  • Rigs — Deterministic setup scaffolding (copy files, run commands) that runs before each codon.
  • Loops — Iterate until a condition is met or context is exhausted.
  • Sentinels — Parallel agents that watch the event stream and intervene.
  • Failure Policies — Configure how codons handle failures: abort, retry, or ignore.
  • Extensions — Let codons continue until context is exhausted for unbounded exploration.
  • Multi-Model — Orchestrate Claude, Gemini, and OpenAI models in the same workflow.

Why Hankweave

Greenfield AI is easy. Brownfield AI—keeping it working six months later—is hard.

Agentic systems rely on "emergent behavior," which means you don't know exactly what happens next time. Hankweave provides structure that makes complexity linear instead of exponential:

  • Codon boundaries act like circuit breakers—problems in codon 3 don't leak into codon 7.
  • Checkpoints let you roll back and try different approaches.
  • Event logs show exactly what happened, tool call by tool call.
  • Sentinels catch issues in real time before they cascade.

When something breaks on run #101 that worked 100 times before, you have the tools to find and fix it.


Getting Started

For new users, we recommend this path to build foundational knowledge before diving into advanced topics.

Install Hankweave

Follow the Getting Started guide to install the CLI and run your first hank.

Understand the Building Blocks

Read Codons and Hanks to learn how programs are structured.

Build Something

Work through the Building a Hank tutorial to create your first complete program from scratch.

See a Real Example

Study the Data Codebook example for a complete, annotated reference implementation.


Documentation

Pick the track that fits your role.

For Operators: Running Hanks

Execute existing hanks, monitor progress, and debug when things go wrong.

For Authors: Writing Hanks

Design and build your own declarative AI programs.

For Integrators: Building on Hankweave

Integrate Hankweave into larger systems and build custom tooling.

For Contributors: Contributing to Hankweave

Understand internals to contribute effectively.


Further Reading

From the Southbridge blog:

Technical deep dives:


Brought to you by Southbridge (opens in a new tab). By using Hankweave, you agree to our Terms of Service (opens in a new tab). Fun fact: this documentation was built by Hankweave.