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
Andrej Karpathy describes a language model as the CPU of a new kind of computer, with the context window as its RAM. On that computer an agent is a program. On a classical computer the operating system decides what a program may use; for many agents, that is written only in their code. In A-Graph it is declared in the file, and the engine does part of the work of an operating system: it checks the whole file before the first call, and it reaches only the hosts the file lists. The README tells the whole idea.
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.
- 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.
- Reach only the hosts the file lists and keep the contents of the messages out of the log unless the passport allows them; from a graph sent over HTTP, refuse also programs and files outside its session.
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. The examples show it on small graphs.
What happens to the file
- 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
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.
--checkuses no network. - 3
Run
Sequences, groups that run one after the other or together or as batch jobs, a
reactloop with a controller, validation nodes that judge a result and can stop the run. - 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.
graph:
nodes:
- id: assistant
model: { id: local }
resources: { prompt: answer }
message:
input: { user_message: true }
output: { assistant_message: true }
edges:
- start: assistantOne node. A model answers the message. A graph of one node is its start alone. The whole file.
graph:
nodes:
- id: translator
model: { id: local }
resources: { prompt: translate }
message:
input: { user_message: true }
output: { assistant_message: true, node: true }
- id: shortener
model: { id: local }
resources: { prompt: shorten }
message:
input: { agent_message: true }
output: { assistant_message: true }
edges:
- start: translator
- end: shortenerTwo nodes in a row. The first translates, the second shortens what the first sends on. The whole file.
graph:
nodes:
- id: framer
model: { id: local }
resources: { prompt: frame }
message:
input: { user_message: true }
output: { node: true }
- id: editor
model: { id: local }
resources: { prompt: edit }
message:
input: { agent_message: true }
output: { node: true }
- id: explainer
model: { id: local }
resources: { prompt: explain }
message:
input: { agent_message: true }
output: { node: true }
- id: critic
model: { id: local }
resources: { prompt: criticize }
message:
input: { agent_message: true }
output: { node: true }
- id: summarizer
model: { id: local }
resources: { prompt: summarize }
message:
input: { agent_message: true }
output: { assistant_message: true }
edges:
- start: framer
- react:
controller: editor
max_iterations: 4
structured_output: api
components:
- worker: explainer
- worker: critic
- end: summarizerA controller and its workers. framer states the task, the controller editor calls explainer and critic until it is done, summarizer shortens its answer. The whole file.
What it does today
| Models | Anthropic, 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 Anthropic, OpenAI, Gemini and Mistral. Reasoning levels, JSON output schemas, batch jobs, images in, images and audio out. |
|---|---|
| Tools | Your programs over stdio, your services over http, MCP servers over stdio and Streamable HTTP, skills in the Agent Skills format. |
| Data | Qdrant and Chroma searched with an embedding model, a conversation memory in a JSON file with summaries, blackboards shared by nodes. |
| Utilities | Programs in any language that change the data of a node before or after the model, without the model knowing. |
| Service | a-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
reactinside areact. - The batch of Gemini and of Vertex AI with publisher google.
- A sandbox for the programs a graph starts.
Who makes it
A-Graph is built by Agens Research Labs, four people who work on models and agents, infrastructure, product and security.
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.



