> For the complete documentation index, see [llms.txt](/llms.txt).
> A full single-fetch corpus is available at [llms-full.txt](/llms-full.txt).
---
last_verified: 2026-10-09
title: Getting started
description: Create a Go AGNT5 project, run it locally with agnt5 dev, and deploy it
category: SDK
hideRightSidebar: true
---

This page takes you from an empty directory to a running Go workflow. You need Go 1.26 or later and the [AGNT5 CLI](/docs/install-cli.md), signed in with `agnt5 auth login`.

## Create a project

```bash
agnt5 create my-agent --language go
cd my-agent
```

`agnt5 create` scaffolds the Go quickstart, a workflow that summarizes the top Hacker News stories, and links the directory to a new AGNT5 project. The project contains:

| File | Contents |
|---|---|
| `main.go` | The worker entry point, which registers every component |
| `src/quickstart/functions.go` | The functions the workflow runs |
| `src/quickstart/workflows.go` | The `digest` workflow |
| `agnt5.yaml` | The project manifest, including the command that starts the worker |
| `.env.example` | The environment variables the project reads |

## The worker

`main.go` creates a worker, registers each agent, function, and workflow, and runs it. A function can carry its own retry policy:

```go
worker := agnt5.NewWorker("quickstart", agnt5.WithServiceVersion("0.2.0"))

must(agnt5.RegisterAgent(worker, quickstart.Summarizer))
must(agnt5.RegisterFunction(worker, "fetch_top_ids", quickstart.FetchTopIDsFunction,
	agnt5.WithRetry(3, 500, 10000),
	agnt5.WithBackoff("exponential", 2.0),
))
must(agnt5.RegisterWorkflow(worker, "digest", quickstart.DigestWorkflow))

if err := worker.Run(context.Background()); err != nil {
	log.Fatal(err)
}
```

The workflow checkpoints each stage. `agnt5.Task` runs a registered function as a step, and `agnt5.Step` checkpoints a closure:

```go
ids, err := agnt5.Task(ctx, "fetch_top_ids", FetchTopIDsInput{Limit: limit}, FetchTopIDsFunction)
if err != nil {
	return DigestOutput{}, err
}

stories, err := agnt5.Step(ctx, "fetch_stories", func(c context.Context) ([]Story, error) {
	return fetchAllStories(c, ids)
})
```

`agnt5.yaml` tells the CLI how to start the worker:

```yaml
name: my-agent
language: go
worker:
  command: "go run ."
```

## Run it locally

Copy `.env.example` to `.env` and set one model key, `OPENAI_API_KEY` or `ANTHROPIC_API_KEY`; the summarizer agent uses whichever is present. Then start the worker:

```bash
agnt5 dev
```

In another terminal, list what the worker registered and run the workflow:

```bash
agnt5 components --dev
agnt5 run digest --type workflow --input '{"limit": 2}'
```

```json
{
  "count": 2,
  "digest": "# Hacker News digest\n\n1. **...**"
}
```

Open the `studio` link that `agnt5 dev` prints to see the run's trace. See [Local development](/docs/build/local-development.md) for hot reload, background mode, and the API.

## Deploy

```bash
agnt5 secrets set --name OPENAI_API_KEY --type api_key
agnt5 deploy
agnt5 run digest --type workflow --input '{"limit": 2}' --env preview
```

See [Deploying](/docs/run/deploying.md) for environments, promotion, and observing runs.

## Next steps

* [Functions](/docs/build/functions.md) and [Workflows](/docs/build/workflows.md): define your own steps and checkpoints.
* [Agents](/docs/build/agents.md): run a model with tools inside a workflow.
