agentmat

Self-hosted multi-agent workflow platform

AI agent workflows, defined in YAML, run on a minimal stack with Postgres.

Describe a team of agents in one file, give them skills and tools, and run them as jobs through a REST API. Every agent run, LLM call and tool call is recorded, so you can see exactly what happened and what it cost.

How it works

  1. 1

    Define the agents

    One YAML file describes the tree: a single agent, a supervisor with specialists, a router, or stages in sequence or in parallel. It's validated when you upload it.

  2. 2

    Teach them with skills

    Skills are Markdown files uploaded with the workflow: a runbook, a style guide, a resume. Each agent gets only the skills you give it.

  3. 3

    Run and inspect

    Submit a job with POST /jobs. A worker picks it up from Postgres and runs the tree. Poll for the answer, and read every step with its input, output, duration and tokens.

Workflow patterns

Every workflow is one tree of agents. These are the shapes it can take, and they combine: a stage in a pipeline can be a supervisor, and a specialist can run its own pipeline.

request summarizer skill house-style answer
name: summarizer
kind: llm
model: claude-sonnet-5-5
instruction: Summarize the text you are given.
skills: [house-style]

Pattern 1

Single agent

One LLM agent with an instruction, and optionally tools and skills. The request goes in, the answer comes out.

  • Skills add your team's guidance, like a style guide or a runbook, without touching the instruction.
  • Tools such as http_get let it fetch what it needs.

Use it when the task is one well-defined job: summarise, classify, extract, rewrite.

analyst current_time call · answer page_researcher summarizer http_get
name: analyst
kind: llm
model: claude-sonnet-5-5
instruction: Answer the question. Delegate web
  pages to page_researcher.
tools: [current_time]
agent_tools:
  - name: page_researcher
    description: Reads one page, answers a question.
    kind: llm
    model: claude-sonnet-5-5
    instruction: Fetch the URL, answer briefly.
    tools: [http_get]
  - name: summarizer
    description: Summarizes text it is given.
    kind: llm
    model: claude-sonnet-5-5
    instruction: Summarize as asked.

Pattern 2

Supervisor with agent tools

A supervisor calls specialist agents as if they were tools, reads their answers and keeps working until it can reply.

  • Each specialist starts with a fresh context and sees only the request it's given.
  • Noisy tools like web fetches stay with the specialist, so the supervisor's context stays small and cheap.
  • The supervisor can call any specialist as often as it needs.

Use it when a task breaks into research or sub-tasks whose results you combine.

request support_desk hands off to one billing tech final answer
name: support_desk
kind: llm
model: claude-sonnet-5-5
instruction: Route the request to the right
  specialist. Do not answer it yourself.
sub_agents:
  - name: billing
    kind: llm
    model: claude-sonnet-5-5
    instruction: You handle billing questions.
  - name: tech
    kind: llm
    model: claude-sonnet-5-5
    instruction: You handle technical issues.

Pattern 3

Supervisor with handoffs

A router reads the request and hands it to the right specialist. The specialist's answer becomes the final answer.

  • The router sees each specialist as a transfer_to_<name> tool.
  • The handoff ends the router's turn, so its job is to route, not to answer.
  • Specialists can have their own tools and skills.

Use it when requests fall into clear categories that need different expertise.

topic researcher facts writer post
name: blog_pipeline
kind: sequential
sub_agents:
  - name: researcher
    kind: llm
    model: claude-sonnet-5-5
    instruction: List the key facts about the topic.
  - name: writer
    kind: llm
    model: claude-sonnet-5-5
    instruction: Write a short post from these facts.

Pattern 4

Sequential pipeline

Stages run in order, and each stage's output becomes the next stage's input.

  • Each stage stays simple and focused on one step.
  • A stage sees only the previous stage's output, so have earlier stages pass on anything later ones need.
  • Any stage can itself be a supervisor, a router or a parallel group.

Use it when the work naturally splits into steps, like research, then draft, then edit.

reviewers · parallel text security_review at the same time clarity_review merger one list
name: parallel_review
kind: sequential
sub_agents:
  - name: reviewers
    kind: parallel
    sub_agents:
      - name: security_review
        kind: llm
        model: claude-sonnet-5-5
        instruction: Review for security problems.
      - name: clarity_review
        kind: llm
        model: claude-sonnet-5-5
        instruction: Review for clarity problems.
  - name: merger
    kind: llm
    model: claude-sonnet-5-5
    instruction: Merge the reviews into one list.

Pattern 5

Parallel fan-out

Several agents work on the same input at the same time. Their outputs are joined, one section per agent, usually for a following stage to merge.

  • Total time is roughly that of the slowest agent, not the sum.
  • Put a parallel group inside a sequence to combine the results, as here.
  • If one agent fails, the others are stopped and the job reports the error.

Use it when you want independent perspectives on the same thing, like reviews or checks.

What's inside

Agent trees

LLM agents, sequential and parallel stages, agent-as-tool calls and handoffs, nested up to eight levels.

Skills

Markdown guidance attached per agent and versioned with the workflow, so behaviour changes without touching the logic.

Postgres is the queue

No broker to run. Workers claim jobs with SKIP LOCKED, crashed jobs are picked up again after a lease, and the API and workers scale on their own.

Every step visible

Each agent run, LLM call and tool call is recorded with its input, output, duration and token counts, and can be read through the API.

Alert triage built in

Point your alerts at it: secrets are redacted, repeats deduplicated, volume capped, and the analysis posted to your team's Slack.

Guardrails

Per-job LLM call budgets and timeouts, capped tool output, and a web fetch tool that refuses private and internal addresses.