---
title: weft documentation
description: 'The documentation for weft v0.20.2, the Go framework for AI agents: where to start, and what each section holds — tutorials, concepts, guides, sessions, observability, testing, production and reference.'
url: https://weftgo.dev/docs/
type: index
sources:
  - weft/README.md:1-38 (what weft is; the package table; status)
  - weft/AGENTS.md (the API map)
  - docs-site/IA.md (sections and slugs)
---

# 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.

![weft Studio's runs list: each run's status, prompt and id, agent, steps, tokens, cost, start and duration, newest first, with a checkbox per row to pick runs to compare](https://weftgo.dev/docs/_astro/studio-runs.light.CFMu-KA1.webp)

## Where to start

- **New to weft:** [What is weft, and when should you not use it?](https://weftgo.dev/docs/get-started/what-is-weft/), then the [Quickstart](https://weftgo.dev/docs/get-started/quickstart/).
- **Ready to build:** [Your first agent: a support bot from a tool to Studio](https://weftgo.dev/docs/get-started/first-agent/).
- **Adding weft to a project:** [Install weft and choose a module](https://weftgo.dev/docs/get-started/install/).
- **Looking up a name:** [the reference](https://weftgo.dev/docs/reference/), and the Go API on [pkg.go.dev](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2).

## What is in these docs

The sidebar is the reading order:

| Section | What it holds |
|---|---|
| [Get started](https://weftgo.dev/docs/get-started/) | From nothing to a recorded run you can inspect, in order |
| [Concepts](https://weftgo.dev/docs/concepts/) | The ideas everything else builds on: agents, runs, tools, the loop, messages, models, errors, stopping |
| [Guides](https://weftgo.dev/docs/guides/) | One task per page: streaming, structured output, approvals, subagents, MCP, middleware, providers, … |
| [Sessions](https://weftgo.dev/docs/sessions/) | Durable multi-turn conversations with `weft/thread`: storage, turns, branching, compaction, approvals, pools |
| [Observe & debug](https://weftgo.dev/docs/observe/) | Recording runs, Studio, the playground, the devtools panel and the `weft` command |
| [Testing](https://weftgo.dev/docs/testing/) | Offline tests: scripted models, recorded fixtures, Studio runs as tests, provider conformance |
| [Production](https://weftgo.dev/docs/production/) | Deploying, securing Studio, content and privacy, retention, storage backends, upgrading |
| [Reference](https://weftgo.dev/docs/reference/) | Tables: the CLI, Studio's HTTP API, the record contract, environment variables, events, the glossary |
| [Explanation](https://weftgo.dev/docs/explanation/) | Why weft is shaped the way it is: architecture, design principles, decisions, comparisons |
| [Examples](https://weftgo.dev/docs/examples/) | Complete recipes: a support desk, a research team, flaky infrastructure, budget guards, … |

## Read these docs as Markdown

Every page has a Markdown twin at its URL with `.md` appended. [`/docs/llms.txt`](https://weftgo.dev/docs/llms.txt) lists them, and [`/docs/llms-full.txt`](https://weftgo.dev/docs/llms-full.txt) holds them all in one file.
