weft documentation
weft is an open-source Go framework for AI agents. A tool is a plain Go function, an agent is a value you build once and run many times, and the loop calls the model and your tools until the model answers. The same module records every run with otel.Install and opens it in Studio, its web inspector. These pages document weft v0.20.2, which is pre-1.0: a minor release can break.


Where to start
Section titled “Where to start”- New to weft: What is weft, and when should you not use it?, then the Quickstart.
- Ready to build: Your first agent: a support bot from a tool to Studio.
- Adding weft to a project: Install weft and choose a module.
- Looking up a name: the reference, and the Go API on pkg.go.dev.
What is in these docs
Section titled “What is in these docs”The sidebar is the reading order:
| Section | What it holds |
|---|---|
| Get started | From nothing to a recorded run you can inspect, in order |
| Concepts | The ideas everything else builds on: agents, runs, tools, the loop, messages, models, errors, stopping |
| Guides | One task per page: streaming, structured output, approvals, subagents, MCP, middleware, providers, … |
| Sessions | Durable multi-turn conversations with weft/thread: storage, turns, branching, compaction, approvals, pools |
| Observe & debug | Recording runs, Studio, the playground, the devtools panel and the weft command |
| Testing | Offline tests: scripted models, recorded fixtures, Studio runs as tests, provider conformance |
| Production | Deploying, securing Studio, content and privacy, retention, storage backends, upgrading |
| Reference | Tables: the CLI, Studio’s HTTP API, the record contract, environment variables, events, the glossary |
| Explanation | Why weft is shaped the way it is: architecture, design principles, decisions, comparisons |
| Examples | Complete recipes: a support desk, a research team, flaky infrastructure, budget guards, … |
Read these docs as Markdown
Section titled “Read these docs as Markdown”Every page has a Markdown twin at its URL with .md appended. /docs/llms.txt lists them, and /docs/llms-full.txt holds them all in one file.