Skip to content
These docs cover Strata 0.9.0-preview.1.It is a preview, and the API can still change before 1.0.

Quickstart

In this quickstart you build the smallest useful graph: a typed state, two nodes joined by one edge. You compile it, run it, and read the result. It takes about five minutes.

Before you start, check the requirements for your language.

Create a console app and add Strata:

Terminal window
dotnet new console -n Quickstart
cd Quickstart
dotnet add package Datalium.Strata.Hosting --version 0.9.0-preview.1

Replace the program with this code. It builds a graph that writes a greeting in two steps: Compose writes Hello, <name>, and Punctuate adds an exclamation mark.

In Program.cs:

using Datalium.Strata.Graph;
using Datalium.Strata.Interruption;
using Datalium.Strata.Storage;
var graph = new StateGraph<Greeting>()
.AddNode("Compose", state => state with { Message = $"Hello, {state.Name}" })
.AddNode("Punctuate", state => state with { Message = state.Message + "!" })
.AddEdge("Compose", "Punctuate")
.Compile();
var store = new InMemoryCheckpointStore();
var result = await graph.RunAsync("greeting-1", new Greeting("Ada", ""), store);
if (result is GraphExecutionResult<Greeting>.Completed completed)
{
Console.WriteLine(completed.State.Message);
}
else
{
Console.WriteLine("The run did not complete.");
}
public sealed record Greeting(string Name, string Message);
Terminal window
dotnet run

It prints:

Hello, Ada!

The state is Greeting. Every node receives the current state and returns a new one. In C# a record with with makes that a one-liner. In Rust the state must be Clone, Serialize and Deserialize, so Strata can save it.

The nodes are Compose and Punctuate. The first node you add is the graph’s entry point, where every run starts.

The edge from Compose to Punctuate says what runs next. Punctuate has no outgoing edge, so the run ends after it.

Compiling checks the graph’s structure before anything runs. Try deleting the edge line and running again. Compiling fails in both languages, with the same error code and message:

Compile() throws a GraphCompilationException:

Unhandled exception. Datalium.Strata.Validation.GraphCompilationException: Graph compilation failed:
[STRATA_ERR_ORPHAN] Node 'Punctuate' is isolated and unreachable from the entry point 'Compose'.

Running takes a thread ID (greeting-1), the initial state and a checkpoint store. The thread ID names the thread. When a run pauses, you use the ID to resume or inspect the thread later. The store is where Strata saves the thread when a run stops before the end, for example to wait for a person. This graph runs straight through, so by default nothing is saved. InMemoryCheckpointStore keeps everything in memory, which suits development and tests.

The result says how the run ended:

Result Meaning
Completed The run reached the end. It carries the final state.
Interrupted The run paused at an interrupt boundary or a wait, and the thread was saved.
Failed The run failed, for example because a node failed and no retry or fallback recovered it, or the run passed its hop limit.
Cancelled The run stopped early, for example because it was cancelled, its deadline passed, or the thread was ended.

The demo repositories have 29 small, runnable projects, the same in both languages. Each one shows one feature: tools, approvals, durable execution, agents, model routes, long-term memory, hosting and more. Most run without an API key.

To build on it, follow a guide: pause for approval, define tools, call a model or build an agent.

To understand what you just built, read how graphs, state and threads and checkpoints work, and how a graph pauses for a person.

Before you build something real, read the Known limitations.