# Is gvn for you?

This page shows where gvn fits: who it suits, how it differs from other ways of building
agents, and what a team learns to use it. It ends with [a reading path](#evaluate-gvn) through
the pages that hold the evidence, with a time for each step.

<video controls playsinline preload="none" width="1280" height="720" style="display:block;width:100%;height:auto;aspect-ratio:16/9" aria-label="Why gvn" poster="../media/why-gvn/poster.png">
  <source src="../media/why-gvn/why-gvn.mp4" type="video/mp4">
  <track kind="captions" src="../media/why-gvn/captions.vtt" srclang="en" label="English">
  <a href="../media/why-gvn/why-gvn.mp4">Watch Why gvn</a>
</video>

[Read the video transcript](media/why-gvn/transcript.txt)

## Who it is for

gvn is for Python developers whose harnesses need to grow without exposing every
component's internal state. A workflow hosts actors with agreed inputs and outcomes. Each
actor owns its state, can be tested on its own, and can serve more than one workflow. gvn
checks each declared machine and how the workflow routes its stages' outcomes. This structure
also supports agents whose effects need approval or recovery across processes.

You can start small. For one agent with tools, [`run_agent`](guides/shortcuts.md) runs it in
one call, as the [quickstart](quickstart.md) shows. When you need a workflow of several
actors, you define how the parent routes their outcomes. Approval and recovery also work
with the built-in actors. If you write your own actor, you define its states and inputs and
give it a [`Dto`](reference/glossary.md#dto), the plain-data form in which its state is saved.

You install it with `pip install gvn`. gvn requires Python 3.12 or newer, and the core
package has no runtime dependencies. A vendor's model, OpenTelemetry tracing and PostgreSQL
each come as an [optional extra](install.md#optional-extras) that adds one dependency.

The ready-made [tools](tools/index.md) confine themselves to a workspace and to allow-lists
of programs and hosts. Isolating the machine they run on is the job of the container or VM
you run the harness in. A tool whose results may hold text written outside your control (a
web page, an issue, an email) says so, and the agent records when a result from that tool
joins the transcript. The policy and approver can use that exposure to decide whether to
require approval.
[Trust: what the model read and who answered](concepts/trust.md) explains it.

## How gvn compares

Agent frameworks answer the same design questions in different ways. The table compares gvn
with common approaches by category. For example, the OpenAI Agents SDK configures a runner
with tools and handoffs and can pause for tool approval. LangGraph organizes execution as
nodes and edges and can persist graph state with checkpoints. gvn's verifier checks coverage
over declared states and inputs and can check allowed undo paths in a workflow definition.
[OpenAI Agents SDK](https://openai.github.io/openai-agents-python/agents/),
[tool approval](https://openai.github.io/openai-agents-python/human_in_the_loop/),
[LangGraph Graph API](https://docs.langchain.com/oss/python/langgraph/graph-api),
[checkpoint persistence](https://docs.langchain.com/oss/python/langgraph/persistence),
[gvn's compensation checks](guides/compensation.md#what-the-verifier-proves-and-what-you-declare).

- **Graph of functions with a shared state dict**: nodes are functions, edges are chosen by
  functions that read a shared dictionary or typed record.
- **Prompt-chained loops**: a loop calls the model, runs whatever tools it asked for, and
  repeats until the model stops asking.
- **Role-based multi-agent crews**: agents with roles and goals hand tasks to each other
  under a coordinating process.
- **Durable-execution engines**: general workflow engines that record the steps of ordinary
  code so it can be replayed after a failure.

| Question | gvn | Common approaches |
|---|---|---|
| How is control flow expressed? | As a finite state machine: states, input symbols, a transition table and outputs. Composition is by hosting one machine inside a state of another. | As ordinary code (loops, functions, callbacks), as a graph whose edges are chosen by functions, or as task hand-offs between role agents. |
| Is it checked before running? | The verifier rejects missing routes for declared inputs in non-final states, overlapping transitions, unreachable states, dead ends, and unrouted declared decision outcomes. Workflow plans are also checked as a whole. | Checks depend on the framework's control model. A graph compiler can validate its node and edge declarations. Branches implemented inside a function also need tests that exercise the function's behavior. |
| Where does state live, and how is it persisted? | Inside the actor, with an explicit, validated `Dto`. The runtime journals input events and takes actor snapshots. Runtime wiring such as model clients and tools stays outside the saved actor. | Commonly a shared dict or typed record passed between steps and checkpointed whole; or the conversation history itself; or the call stack of code that an engine records. |
| How does branching happen? | A Decision answers with one symbol from a declared, finite set; the machine must route each one. | A function returns the name of the next node, a model's choice decides, or an `if` in code decides. The set of possible branches is often implicit. |
| What happens after a crash? | Rebuild the actor from its latest snapshot plus the journaled events after it, then resume. Work that was in flight is re-issued with the same [request id](reference/glossary.md#request-id) ([at-least-once](reference/glossary.md#at-least-once)). The same rebuild, stopped at any earlier record and copied into another journal, is a [fork](guides/forking-a-run.md): from there the run does real work again, for example after a different answer from the person. | Ranges from starting over, to resuming from the last checkpoint of the shared state, to deterministic replay of recorded steps in durable-execution engines. |
| How is a human brought in? | Waiting for a human is a state. The request is declared external (answered from outside the process), the run returns a waiting result and holds no process; the human's answer is the next input event. The answer carries who gave it, as your entry point authenticated them; an entitlement decision (ordinary code with declared outcomes) can say whether that person may answer, and who answered is journaled with the event. | A callback or a blocking prompt inside a tool, an interrupt that pauses a graph at a node, or a separate approval service. |
| How are vendors isolated? | The `Model` port keeps vendor SDKs outside the harness. Configure a shared throttle for model wrappers that need to use one account's limits. A model answer records the provider when known, and traces use the OpenTelemetry GenAI names. | Often a shared model abstraction, sometimes with vendor types leaking into state or tool definitions. |
| How do I watch a run? | The Governor reports each [signal](reference/glossary.md#signal) (an event handled, a request started, a fragment of model text, the run waiting or finishing) to one `Output` port. The shipped outputs turn the signals into structured log records through the standard `logging` module, OpenTelemetry spans (with the `otel` extra), and a live stream your code reads with `async for`. A `Fanout` sends one run to several outputs at once. The journal stays the durable record; the output is for watching. See [Logs, traces and streams](guides/observability.md). | Callbacks or hooks registered on the runner, a tracing integration, or log statements written in each step. |
| How is it tested offline? | Every source of nondeterminism is a port with a [fake](reference/glossary.md#fake) in `gvn.testing` (scripted model, manual clock, memory journal, recording output). Each fake passes the same contract suite as the real adapters. A crash can be injected at every journal write. | Mocking the model client, recording HTTP traffic, or running against a live model. |

The machine decides, and the Governor journals events and starts the resulting work.
An allowance sets an interruption threshold for recorded model usage. The reference agent
suspends and can resume under a larger allowance. A custom actor must support `interrupted`
to run under an allowance and defines its own response. See [Runtime guarantees](reference/runtime-guarantees.md)
for recovery, spending, and the requirements for an authenticated answer.

## What your team learns, and when

What an engineer needs to know grows with what they build. Each row names the pages that
teach it, with the time each page states.

| To do this | An engineer needs to know | Taught by |
|---|---|---|
| Run one agent with `run_agent` | How to write a tool as a Python function with a name, a description and its arguments; that a policy decides which tool calls run and which wait for a person; how to read the run that comes back. | The [quickstart](quickstart.md) (about 10 minutes) and [The short path: `run_agent`](guides/shortcuts.md) (about 15 minutes). |
| Compose a workflow | What a state machine is and what the verifier checks; how a machine branches through a Decision; that an actor asks and the Governor does the work; how a workflow's stages host other actors and how the parent routes their outcomes. | Tutorials [1](tutorials/first-machine.md) (10 min), [2](tutorials/decisions-and-branching.md) (15 min), [3](tutorials/first-agent.md) (10 min) and [8](tutorials/workflow.md) (15 min), then the concept page [Workflows](concepts/workflows.md) (about 25 minutes). Tutorials 4 to 7 between them teach tools (15 min), a policy with approval by a person (20 min), the journal (15 min) and the output (10 min). |
| Write their own actor | How to own a machine and declare its states and inputs; how to keep its data in durable objects with a `Dto`; the `Actor` interface, where `handle` takes an event and `pending` says which requests the actor now wants; how to test an actor with no runtime. | The concept pages [Machines](concepts/machines.md) (about 20 minutes), [Decisions](concepts/decisions.md) (about 10), [Durable objects](concepts/durable-objects.md) (about 15) and [Actors and events](concepts/actors-and-events.md) (about 15, ending with [writing your own actor](concepts/actors-and-events.md#deeper-writing-your-own-actor)); tutorial [11](tutorials/testing.md) on testing (15 min); and the [interface contract map](reference/interfaces.md) (about 10 minutes) for what an implementation must promise. |

The [tutorials](tutorials/index.md) list all twelve with their times.

## Evaluate gvn: a reading path {#evaluate-gvn}

This path goes through the pages that hold the evidence, in order. Each step has a time
and the question it answers. Steps 1 to 3 are the 10-minute version; all nine take about
36 minutes. For the hands-on version, see
[Try it in an afternoon](paths.md#try-it-in-an-afternoon).

| Step | Read | Minutes | The question it answers |
|---|---|---|---|
| 1 | This page: [Who it is for](#who-it-is-for) and [How gvn compares](#how-gvn-compares) | 5 | Is this the kind of framework we need, and how does it differ from the ones we know? |
| 2 | [Runtime guarantees](reference/runtime-guarantees.md) | 2 | What does the runtime do after a crash, at an approval and at a spending threshold, and what does our application supply? |
| 3 | [Scale benchmark](reference/scale.md): the opening summary | 2 | How many agents does one process drive, what does a waiting run cost in memory, and how fast is recovery? |
| 4 | [The one idea](concepts/index.md#the-one-idea), then Architecture: [The thesis](reference/architecture.md#the-thesis) and [the four layers](reference/architecture.md#four-layers-from-the-inside-out) | 5 | What is the design, and how is the code layered? |
| 5 | Running gvn as a service: [Where this fits](guides/running-as-a-service.md#where-this-fits) and [what the service layer guarantees and what you supply](guides/running-as-a-service.md#what-the-service-layer-guarantees-and-what-you-supply) | 5 | How does it run on several processes that share one database? |
| 6 | Domains: [What a domain harness is made of](domains/index.md#what-a-domain-harness-is-made-of), then [Customer service](domains/service.md) | 8 | What does a complete harness look like, from the plan to its evaluation? |
| 7 | Testing your harness: [The shape of it](concepts/testing.md#the-shape-of-it) | 2 | How do we test a harness with no model and no network? |
| 8 | The openings of [Using a vendor model](guides/vendors.md) and [Logs, traces and streams](guides/observability.md), then the [summary of the live runs](reference/live-runs.md#summary) | 4 | Which model services does it reach, how do we watch a run, and what happened on real models? |
| 9 | Stability: [The short version](reference/stability.md#the-short-version) and [The public API](reference/stability.md#the-public-api) | 3 | What happens to stored runs and to our code when gvn changes? |
