Describe the agents. Check the file. Run it.

a-graph runs a graph of agents written in a YAML file. Models, prompts, tools, data and the edges between the nodes live in one file, checked before any model is called. A command line and a small HTTP service, written in Rust. MIT license.

$ a-graph --check graph.yml
[validation] graph.edges[1].end (unknown_ref): node `shortner` is not declared
no model called

$ a-graph --check graph.yml
(no output: the file is valid, exit 0)

$ a-graph graph.yml "A mutex is a lock that lets only one thread use a shared resource at a time."
▶ translator · local
▶ shortener · local
{"items":[{"node":"translator","message":"Un mutex è un blocco che permette a un solo thread di utilizzare una risorsa condivisa alla volta."},
          {"node":"shortener","message":"Il mutex blocca l'accesso condiviso per evitare race conditions."}]}

From examples/02-sequence: two nodes, one local model. The first transcript shows an error of the file as the checker reports it: phase, path, rule, message.

In plain words

What it does

You write in one file who the agents are, what each one must do, which model it uses, which programs it may call and in which order they run. a-graph reads the file, tells you what is wrong before any model is called, then runs it and gives you the result as JSON. The same file runs from a terminal or behind an HTTP service that other programs call.

The file holds the problem of the agents: the models, what each node reads, the prompts, the order and the patterns. a-graph holds the problem of the software: the API of each provider, structured output, batch jobs, the network, the secrets. Your own programs stay outside the graph, behind a small JSON contract.

What it can do

  • Chain several models, from different providers or from your own machine, each with its own prompt.
  • Let a model call your programs and your services, and the tools of an MCP server, with a limit on the calls and on the time.
  • Keep a memory between runs, share notes between nodes, search your documents in a vector database.
  • Read images and produce images and audio.
  • Run nodes one after the other, together, or as batch jobs; loop with a controller; stop the run when a judge says the result is not good enough.
  • Refuse at the door what the file does not allow: hosts, programs, files, data that must not leave.

What it is for

Any work that is a sequence of steps a model can do and a program must keep under control: reading and classifying what comes in, drafting and checking a text, answering with your own data, calling the systems you already have. The file says what happens; the program makes sure only that happens.

What happens to the file

  1. 1

    Declared

    One file: the passport with the hosts the graph may reach, the models, the prompts with their placeholders, tools and MCP servers, vector databases and memory, blackboards, nodes and edges.

  2. 2

    Checked

    Shape, links between ids, order of the edges, then the rules of each block. Every error at once, with its phase, its path and a rule with a stable code. --check uses no network.

  3. 3

    Run

    Sequences, groups that run one after the other or together or as batch jobs, a react loop with a controller, validation nodes that judge a result and can stop the run.

  4. 4

    Traced

    A JSON log on the standard error, a file or a URL; a timeline sent as OpenTelemetry at the end of the run; a live display. Each node has its own events (tokens, duration, calls, answers checked against a schema), to measure how stable each agent is, where it fails and why. Message contents only if the passport allows it.

Three small graphs

The graph block of three files. Each file also names its model and its prompts; the whole files are in examples.

One node

A model answers the message. A graph of one node is its start alone.

graph:
  nodes:
    - id: assistant
      model: { id: local }
      resources: { prompt: answer }
      message:
        input: { user_message: true }
        output: { assistant_message: true }
  edges:
    - start: assistant

Two nodes in a row

The first translates, the second shortens what the first sends on.

graph:
  nodes:
    - id: translator
      model: { id: local }
      resources: { prompt: translate }
      message:
        input: { user_message: true }
        output: { node: true }
    - id: shortener
      model: { id: local }
      resources: { prompt: shorten }
      message:
        input: { agent_message: true }
        output: { assistant_message: true }
  edges:
    - start: translator
    - end: shortener

Two opinions at once, one verdict

A group alone is a whole graph: framer states the claim, for and against run together, judge weighs them.

graph:
  nodes:
    - id: framer
      model: { id: local }
      resources: { prompt: frame }
      message:
        input: { user_message: true }
        output: { node: true }
    - id: for
      model: { id: local }
      resources: { prompt: pro }
      message:
        input: { agent_message: true }
        output: { node: true }
    - id: against
      model: { id: local }
      resources: { prompt: con }
      message:
        input: { agent_message: true }
        output: { node: true }
    - id: judge
      model: { id: local }
      resources: { prompt: weigh }
      message:
        input: { agent_message: true }
        output: { assistant_message: true }
  edges:
    - parallel:
        - in: framer
        - fan:
            - next: for
            - next: against
        - out: judge

What it does today

ModelsAnthropic, OpenAI, Gemini, Mistral, Amazon Bedrock, Google Vertex AI, Microsoft Foundry, Ollama, and any server that speaks the Ollama contract; a gateway or a proxy in front of the cloud providers. Reasoning levels, JSON output schemas, batch jobs, images in, images and audio out.
ToolsYour programs over stdio, your services over http, MCP servers over stdio and Streamable HTTP, skills in the Agent Skills format.
DataQdrant and Chroma searched with an embedding model, a conversation memory in a JSON file with summaries, blackboards shared by nodes.
UtilitiesPrograms in any language that change the data of a node before or after the model, without the model knowing.
Servicea-graph --serve service.yml: a caller sends a graph and a message over HTTP. Programs, files outside the session and hosts not allowed are refused before anything is built. A run joins the trace of its caller (traceparent). No authentication of its own.

Not yet

  • A blackboard kept at a URL.
  • Search, and a memory kept in a vector database.
  • Audio and video in.
  • A react inside a react.
  • The batch of Gemini and of Vertex AI with publisher google.

Who makes it

a-graph is built by Agens Research Labs, four people who work on models and agents, infrastructure, product and security.

  • Fabio GagliardiAI researcher. The author of the engine.
  • Daniele BarbaroProduct and integrations.
  • Luigi SimeoneApplied AI and Data Science.
  • Enrico ZimuelTechnical advisor.

Install

git clone https://github.com/agens-research-labs/a-graph
cd a-graph
cargo install --path . --locked
ollama pull qwen3.5:4b
cd examples/01-hello
a-graph graph.yml "What is a mutex?"

You need Rust. The examples run against a local Ollama and need no key. Built and tested on Linux and macOS. Everything else is in the documentation.