Open Source · Agentic AI

Building Agentic Systems

Specs for portable agent work and identity, harnesses that run them, and memory you can inspect.

Agent harnesses already break projects into steps and carry context from one turn to the next. They usually do it privately, in their own shape. I am building an open alternative in five parts: AGS writes the work plan down as a portable graph, OAP persists a named agent as a reviewable profile, MagAgent 0.98.0 and Loro 0.16.1 execute those ideas for developers and governed teams, Merced AI 0.2.0 runs the same profiles on whichever harness you already have installed, and MagGraph keeps long-term memory as Markdown in Git.

The throughline

Structure you can review, governance you can prove

Two questions decide whether agentic work is worth trusting with anything that matters: can you see the plan before you pay for it, and can you show what actually happened afterward.

The work format

AGS

An open, vendor-neutral document describing the work as a graph of bounded agentic loops, with success criteria the harness checks rather than the model asserts.

The agent format

OAP

A portable profile for who an agent is, what authority it asks for, what memory it may use, and what it learned after previous sessions.

The harnesses

MagAgent and Loro

Two programs that run those portable artifacts. One is built for a developer in a terminal, the other for an organization that has to answer to an auditor.

The broker

Merced AI

A layer above the harnesses. It finds the agent CLIs already on your machine and runs one profile on any of them, reporting honestly how much of that profile each one can actually honor.

The memory

MagGraph

A graph database where knowledge lives as Markdown files in Git, so what an agent remembers is something a person can read, review, and correct.

All open source AGS, OAP, MagAgent, and Merced AI are Apache-2.0, MagGraph is MIT or Apache-2.0, Loro is MIT. Everything on this page is public code you can read, fork, or implement against.

01 / Tooling

The Mag Ecosystem

A local-first AI productivity stack: a Rust memory graph, a terminal agent, and a desktop command center.

What it is

MagGraph is an in-process graph database written in Rust. Knowledge is stored as versioned Markdown nodes inside a Git repository, edges emerge automatically from [[wikilinks]], and Git handles versioning and sync. It ships a Python API, a CLI, and an auto-generated MCP server, plus a lakehouse mode where nodes point at external S3 or Parquet data.

MagAgent 0.98.0 is the terminal-native coding and productivity agent that sits on that memory. It connects to 20 provider options across local and cloud models, ships 40 built-in tools and 10 skill libraries, spawns sub-agents for parallel work, saves reusable workflow recipes, loads plugins and MCP servers, runs AGS level 3 graphs, and can take tasks from Slack, Discord, or Telegram while you are away from the terminal.

As of 0.98.0 that bundled local workspace is durable. magent ui serves traditional chats, profile-backed bots, and bounded multi-bot groups, and a turn now runs on its own thread: close the tab mid-reply and the answer is still recorded, reopen it and the reply is picked back up from where it left off. Stop cancels the work rather than the connection. Tool approvals reach the browser instead of being refused for want of a console, a Memory view browses what the agent has kept and what links to it, and a first-run panel replaces a composer that could not work. The three-column Graph Kanban validates an Agentic Graph and works every card to completion through the durable executor, keeping dependencies, profile routing, gates, changed files, and per-card outcomes visible.

The MagAgent local web workspace showing the Memory view: a memory graph of 134 nodes and 157 links with duplicate and suppressed counts, a searchable list of remembered notes, and one note opened in full alongside the notes it links out to and the notes that link back to it.
MagAgent 0.98.0, magent ui. The Memory view over a real graph: what the agent has kept, and what links to it. Read-only, because editing and deletion stay in the CLI where the destructive commands have their confirmations.

Mag Command Center 0.5.0 is the Tauri, React, and TypeScript desktop app over both: project-scoped chats, provider and permission configuration without hand-editing TOML, an OAP Profile Center with a schema-driven builder and effective-authority review, a Run Center for approvals and blocked work, a Library covering memory, research, SQLite, and plugins, and a full Graph Board for authoring, validating, and running portable workflows. It is packaged for macOS, Windows, and Linux.

Mag Command Center's Graph Board with a generated Agentic Graph draft: an objective field, board, map and source tabs, filter controls, and task cards in a To do column showing their dependencies.
Mag Command Center 0.5.0, Graph Board. A draft graph generated from a one-line objective, ready to edit, validate, and run against the installed MagAgent runtime.

How to use it

Install the agent, run the configuration wizard, and work in a project directory. Memory accumulates as you go, and it accumulates as files you can open.

python -m pip install mag-agent
magent configure
magent                       # interactive session in the current project
magent ui                    # the same project in a loopback browser workspace
magent recipe run release-prep
magent graph generate "ship the next API version" --out release.agraph.yaml

MagGraph is useful on its own if you only want the memory layer. Point any agent framework at its MCP server, or import it in Python and query recall bundles, backlinks, and traversals directly.

Why it matters

Most agent memory is an opaque store you cannot inspect and cannot move. Storing it as Markdown in Git means memory is diffable, reviewable in a pull request, correctable by hand, and portable to any tool that reads text. When an agent remembers something wrong about your codebase, you fix a file instead of filing a bug.

02 / Specification

The Agentic Graph Specification

AGS 1.0 is an open, implementation-neutral format for decomposing a project into a graph of agentic loops. It is a draft standard, Apache-2.0 for the code and schemas, CC BY 4.0 for the specification text.

What it is

An Agentic Graph is a directed acyclic graph. Every node is one bounded agentic loop, a unit of work an agent runs end to end. Every edge is a control-flow dependency. A node is not a prompt and not a function call. It carries:

  • A precise brief, written so an agent that has seen nothing else can act on it.
  • Typed inputs and outputs, so data flow is declared separately from control flow.
  • Success criteria the harness evaluates rather than the model asserts. Kinds include command, file_exists, json_schema, regex, expression, llm_judge, and human.
  • An intelligence tier from minimal to frontier, a normalized capability demand that describes the task without naming any model or vendor.
  • Tools, permissions, and budgets, the ceiling on what a node may do and what it may spend.
  • Failure handling: retries with feedback, fallbacks, escalation, and human gates.

Node types cover tasks, decisions, human gates, bounded loops, bounded fan-out maps, and subgraphs. Every loop has a max_iterations and every fan-out has a max_items, so there is no way to write an unbounded document. JSON and YAML are the same data model, and a YAML file that does not survive a lossless round trip through JSON is not a valid AGS document.

How to use it

If you are planning work: author a graph by hand, or have an agent generate one, then read it before anything runs. A node is a few lines.

ags_version: "1.0"
kind: AgenticGraph
id: myorg/add-healthcheck
title: Add a health check endpoint
objective: Expose GET /healthz returning service and dependency status.

entrypoints: [implement]

nodes:
  implement:
    title: Implement /healthz
    description: >
      Add a GET /healthz endpoint returning 200 with {"status":"ok"} when the
      database and cache are both reachable, and 503 with per-dependency detail
      when either is not.
    intelligence:
      tier: standard
    requirements:
      tools: [file_read, file_write, shell_exec]
      permissions: [fs:read:**, fs:write:src/**, shell:exec:pytest*]
    success:
      summary: The endpoint exists and behaves as specified under test.
      criteria:
        - id: tests_pass
          kind: command
          description: The health-check tests pass.
          run: pytest tests/test_healthz.py -q

Validate it against the reference implementation, then hand it to any conformant harness:

python3 -m pip install jsonschema pyyaml
python3 tools/validate_agraph.py path/to/graph.agraph.yaml
python3 tools/validate_agraph.py --strict examples/

If you build harnesses: the repository has a JSON Schema for graph documents and another for run records, five worked examples, invalid fixtures that each name the diagnostic they should produce, and an integration guide covering parsing, scheduling, model routing, criteria evaluation, and human checkpoints. You pick a conformance level and reject graphs that need more, rather than silently ignoring what you cannot do.

  • 0Reader. Parse, validate, resolve dependencies, render a plan. No execution.
  • 1Minimal harness. Tasks and gates, sequence edges, retries, the basic criteria kinds, tier routing.
  • 2Standard harness. Decisions, conditional edges, the full expression language, budget enforcement, real parallelism, escalation.
  • 3Full harness. Loops, maps, subgraphs, judged and external criteria, compensation, run records, checkpoint and resume.

Why it matters

When the decomposition lives inside a harness, four things follow. You cannot review the plan before the tokens are spent. You cannot move it to another tool. Completion is whatever the model claims it is. And every task gets the same model, which either overspends on trivia or underspends on the one architectural decision that mattered.

Making the plan a file fixes all four at once. It becomes reviewable in a pull request, diffable across revisions, portable between harnesses, and checkable against criteria a machine can run. The tier field is the quiet win: a graph states how hard each piece of work is, and the harness maps tiers to models through its own routing profile, so a plan written today still routes correctly when next year's models arrive.

03 / Agent profiles

Open Agent Profile

OAP 1.0 is a draft specification for persisting a named AI agent as data instead of keeping a process alive.

What it is

An Open Agent Profile is a file that describes an agent's durable identity: role instructions, model preference, tool surface, permissions, attached context, memory stores, learned state, and revision history. A harness reads the profile to start a fresh session on demand, and a session emits an AgentStateDelta when it ends.

The important boundary is security, not syntax. A profile can narrow authority, never widen it. Learned state is treated as untrusted context, not as new system instructions. And an agent can propose changes to its own contract, but the harness or a human decides whether those changes are written back.

How it maps to the stack

  • MagAgent already has Markdown agent definitions with frontmatter, which map naturally to OAP's Markdown encoding. OAP adds state, history, deltas, and writeback discipline.
  • MagGraph remains the volume memory layer. OAP profiles can reference it as a memory store while keeping bounded identity and learned state in the profile.
  • Loro 0.16.1 implements repository-defined provisional OAP Level 3 harness behavior: profile composition, scoped MCP and Skills, subagent delegation, profile-selected memory stores, and AGS nodes bound to named profiles. Its Web UI edits the same profiles under the same policy.
  • Merced AI treats an OAP profile as the unit that travels. It projects one profile onto whichever installed harness you point it at and reports whether that harness received it natively, through a compatibility projection, in degraded form, or not at all.
  • AGS describes the job. OAP describes the agent selected for that job. Together they let a graph node say not only what work needs doing, but which durable agent profile should do it.

Why it matters

Without a profile format, useful agents either vanish with the session or become proprietary configuration trapped inside one harness. OAP makes the agent itself reviewable, diffable, portable, and safe to evolve. The file is the agent's identity; the running session is just one temporary materialization of it.

04 / Enterprise

Loro

Loro 0.16.1 is a Python CLI agent harness for enterprise coding, governed data work, and productivity tasks, with provisional Open Agent Profile Level 3 behavior and an optional local Web UI.

What it is

Loro is the same general harness idea as MagAgent pointed at a different problem. A developer harness optimizes for speed in one person's terminal. An enterprise harness has to answer questions afterward: who ran this, under whose identity, with whose approval, against which policy, and what did it touch.

  • Identity context resolved from configuration and environment, with managed required fields propagated into audit and session records.
  • Identity-bound approvals with once, session, and deny prompts, plus replay protection.
  • Permission policy over normalized filesystem, shell, Git, memory, catalog, provider, and MCP resources, with loro policy explain to show why a decision was made.
  • Subprocess sandbox profiles with minimized environments, bounded runtime and output, and optional Bubblewrap enforcement.
  • Runtime budgets covering model bytes, tokens, cost, and tool calls.
  • A hash-chained audit log: versioned JSONL with process locking and a SHA-256 chain, an authenticated HTTP sink, bounded buffering with retry, and audit doctor, flush, and verify commands.
  • Governed memory, local and shared, with Postgres and Apache Iceberg adapters where shared writes are explicit-only and draft-gated, plus read-only Apache Polaris catalog discovery.
  • Layered configuration from system, user, project, local, and runtime sources, with enterprise-managed overlays that can be required and pinned by SHA-256.

It also generates artifacts, Markdown and DOCX documents, PPTX decks, and XLSX or CSV spreadsheets, each with a provenance sidecar recording the prompt preview, generated paths, assumptions, and generator metadata. It speaks MCP as a client and can serve a least-privilege read-only subset as a server.

Since 0.12.0 the harness has grown three things worth calling out. Channel gateways now cover Slack, Discord, Telegram, Teams, Signal bridges, and generic signed webhooks, with platform users mapped to tenant-scoped Loro identities and remote message text explicitly carrying no approval authority. A credential vault keeps provider and gateway secrets in the operating-system keyring, including multiple named accounts for the same provider. And loro get-started reads the current folder's provider, model, profile, workspace, memory, MCP, sandbox, and audit readiness, then recommends the next command.

Current release: 0.16.1 completes that loopback-first React Web UI over the same governed runtime. The parts that make Loro Loro are now in the browser: Agentic Graphs run through the same governed executor and hold human gates for an explicit decision; a read-only Governance view shows resolved identity, budgets, sandbox posture, what policy would decide for a hypothetical request, and the audit record with its hash chain verified; and Memory exposes local notes, governed shared memory, and the proposal queue, where a proposal can now be declined rather than only accepted. A chat reply and a graph run each outlive the page watching them, resuming from a cursor after a reload. Nothing about it is a second policy path: the browser sees what the CLI would allow, and no more.

The Loro local web UI showing the Governance view: cards for resolved identity, runtime budgets, sandbox posture, and approval mode and audit sink; a policy panel for explaining a hypothetical permission request; and the audit record reporting the hash chain intact above a filterable list of events with their actors and timestamps.
Loro 0.16.1, loro web. The Governance view: who you resolve as, what policy would decide, and the audit record with its hash chain verified. Read-only throughout, so nothing here can grant authority.

How to use it

Install, configure a provider, then run the setup wizards for the governance pieces your organization needs. There is a mock provider so a first run needs no API key at all.

python -m pip install loro-agent
loro configure
loro get-started
loro doctor

loro setup identity
loro setup approvals
loro setup sandbox
loro setup audit

loro run "Inspect README.md and suggest the next three improvements."
loro audit verify

python -m pip install "loro-agent[webui]"
loro web                     # the same governed runtime, in a loopback browser

For work that needs explicit scheduling and approval, go through a graph instead of a single prompt. Loro implements AGS at conformance level 3, including durable resume, model-tier routing, harness-evaluated criteria, gates, branches, bounded loops and maps, subgraphs, parallel execution, fallbacks, and compensation. When a graph node names an OAP profile, Loro intersects the graph, profile, identity, and managed policy before it runs anything.

loro graph generate "Create a release readiness report" --out release.agraph.yaml
loro graph validate release.agraph.yaml --strict
loro graph plan release.agraph.yaml
loro graph run release.agraph.yaml --dry-run

Why it matters

Agentic coding stalls in regulated environments for a reason that has nothing to do with model quality. The blocker is evidence. A team can rarely say which identity authorized a write, what the policy was at that moment, or prove the record has not been edited since. Loro is built so those answers exist by default rather than being reconstructed later.

Worth saying plainly: shipping this in a portable, provable form is what the project covers. Identity-provider integration, production sandbox validation, retention, destination immutability, and an approved external-checker registry are deployment concerns that belong to the adopting organization. The repository documents that boundary instead of implying the box is checked.

05 / Interoperability

Merced AI

Merced AI 0.2.0 is a local-first broker for the agent harnesses you already have installed. It is deliberately not another agent loop.

What it is

Most developers now have four or five agent CLIs on one machine, each authenticated separately, each with its own idea of what an agent is. Merced AI discovers those executables safely, normalizes their noninteractive interfaces, and uses Open Agent Profile documents to turn them into named bots you can chat and collaborate with. The profile is the portable part. The harness stays in charge.

That boundary is the whole design. The selected harness keeps model access, tools, authentication, sandboxing, approvals, and final policy enforcement. Merced AI never supersedes a harness policy, and it never pretends to. Fourteen harnesses are discovered and executable today, including Codex, Claude Code, Gemini CLI, OpenCode, Goose, Anton, DSH, Antigravity CLI, Pi, Prime Agent, OpenClaw, Kimi Code CLI, and both of the harnesses on this page.

The Merced AI local web UI: a conversation with a bot named Release Notes, a right-hand panel showing the runtime route from OAP profile to active harness, an effective-authority grid covering projection, workspace, approvals, and writeback, and a harness health list reporting fourteen detected harnesses with their versions.
Merced AI 0.2.0, merced-ai ui. One OAP profile routed to a chosen harness, with the effective authority and the detected harness inventory shown next to the conversation.

How to use it

Initialize a workspace, write a profile, bind it to a harness with a fallback, and review the exact projection before a single token is spent.

python -m pip install merced-ai
merced-ai init
merced-ai harness list

merced-ai profile create reviewer \
  --description "Reviews code for concrete defects before merge." \
  --instructions "Review code. Report verified defects and do not edit files."

merced-ai bot create reviewer --profile reviewer --harness codex --fallback claude

merced-ai ask reviewer "Review the current diff" --dry-run --explain
merced-ai profile effective reviewer --harness codex

Then run it, chat with it, or open the same records in a browser. Sessions are durable, atomic, and project-local, so a conversation survives a restart and can be resumed by id.

Since 0.2.0 a conversation can hold several bots at once. Group chats work across the CLI, the API and the web UI, with exact mentions, ask-everyone, named-recipient and round-robin dispatch. Participants run concurrently but persist in a deterministic order, each reply is attributed to the bot that produced it, one failing bot does not take the round down, and a retry targets only that bot.

merced-ai ask reviewer "Review the current diff"
merced-ai chat reviewer
merced-ai session list
merced-ai session resume <session-id>

python -m pip install 'merced-ai[webui]'
merced-ai ui

Why it matters

The honest part is the projection report. When a harness receives the OAP profile through its own CLI, that is native. When the profile has to be rendered into a system prompt or a delimited prompt block, that is projected or degraded, and Merced AI says so rather than implying the identity carried over intact. Nothing here can make a harness enforce a permission it does not have.

The payoff is that a reviewed agent stops being a per-tool configuration. You write the profile once, keep it in the repository next to the code, and run it wherever the work is, without rewriting it for each vendor's format or waiting for one harness to win.

06 / The shape of it

How the pieces fit

AGS is the job contract. OAP is the agent contract. Everything else is an implementation choice you get to make separately.

  1. 01

    AGS is the work interchange format

    A graph is a file. It can be written by a person, generated by an agent, reviewed in a pull request, and stored next to the code it describes. Nothing in the normative model names a vendor, a model, or a runtime.

  2. 02

    OAP is the durable agent profile

    A profile is also a file. It records who the agent is, what tools and permissions it asks for, what memory it may use, and what it learned. Sessions propose deltas; the harness decides what persists.

  3. 03

    MagAgent and Loro are harnesses that adopt it

    Both implement AGS conformance level 3. MagAgent 0.98.0 is the developer harness. Loro 0.16.1 is the governed harness and adds provisional OAP Level 3 profile behavior. Each now has a local browser workspace over the same runtime.

  4. 04

    Merced AI carries a profile to the harnesses you already run

    You should not have to adopt my harness to use the formats. Merced AI 0.2.0 discovers the agent CLIs already installed, binds one OAP profile to any of them, and reports plainly how faithfully each one received it.

  5. 05

    MagGraph is the memory underneath

    A graph describes one job. MagGraph holds what accumulates across jobs: project conventions, past decisions, the shape of a codebase. Markdown nodes in Git, so the memory is reviewable the same way the plan is.

  6. 06

    Nothing here requires the rest of it

    Implement AGS or OAP in your own harness and never touch Mag or Loro. Use MagGraph as a memory layer under a completely different agent framework. Point Merced AI at a stack that contains none of my tools. The point of writing the formats down was to make the pieces separable.

Building a harness Implementation reports are the most useful contribution to the specs right now. If you build against AGS or OAP and something is awkward to express, that is a spec bug worth filing.

07 / Questions

Common Questions

What is the Agentic Graph Specification?

AGS is an open format for writing down how a project is decomposed into agentic work. A graph is a directed acyclic graph whose nodes are bounded agentic loops. Each node carries a brief, typed inputs and outputs, success criteria the harness evaluates, an intelligence tier, the tools and permissions it may use, and budgets. It serializes to JSON or YAML and any conformant harness can run it.

What is the Open Agent Profile specification?

OAP is a draft 1.0 specification for persisting a named AI agent as a file instead of a running process. A profile captures the agent's role, model, tools, permissions, context, memory stores, learned state, and revision history. A harness reads it to instantiate a session and writes back only through controlled state deltas.

Why write the plan down instead of letting the agent plan internally?

A plan that lives only inside a harness cannot be reviewed before the tokens are spent, cannot move to another tool, and cannot define completion in checkable terms. As a file it becomes reviewable, diffable, portable, and routable, so each node gets a model sized to the work.

What is the difference between MagAgent and Loro?

Both are AGS level 3 harnesses. MagAgent 0.98.0 is the developer harness: terminal-native, local-first, backed by MagGraph memory, with recipes, sub-agents, plugins, chat gateways, and a bundled local web workspace with a Graph Kanban. Loro 0.16.1 is the enterprise harness: identity, approvals, permission policy, sandbox profiles, budgets, a hash-chained audit log, governed shared memory over Postgres or Apache Iceberg, signed channel gateways, its own loopback Web UI, and provisional OAP Level 3 profile support.

What is Merced AI, and does it replace them?

No, it sits a step above them. Merced AI is a local-first broker: it discovers the 14 agent harnesses that may already be installed on your machine, normalizes their noninteractive interfaces, and binds OAP profiles to them as named bots. It is not another agent loop. The selected harness keeps model access, tools, authentication, sandboxing, approvals, and final policy enforcement, and Merced AI reports honestly whether your profile landed natively, as a projection, degraded, or not at all.

Do I have to use all of them?

No. AGS and OAP are implementation-neutral by design, MagGraph works under any agent framework through its Python API or MCP server, either harness is useful on its own, and Merced AI is useful even if you run none of my harnesses. They are built to compose, not to lock together.

Are AGS and OAP stable enough to build on?

AGS 1.0 is a draft standard and OAP 1.0 is a draft specification. Both have schemas, examples, and conformance rules, and both are intended to evolve through additive 1.x releases. The honest caveat: independent implementation and formal certification are still early.

How do I follow the work?

Everything is public on GitHub, with Loro under alexmerced-oss. Issues and pull requests are open on every repository, and the fastest way to reach me about any of it is dev@alexmerced.com.

08 / Start here

Pick a starting point

Read the spec, install an agent, or go back to the rest of what I build.

Read the spec

Start with AGS for graph-shaped work and OAP for persistent named agents.

Try an agent

MagAgent for a developer terminal, Loro when the work needs identity, approvals, and an audit trail, Merced AI when you would rather keep the harness you already use.

See the rest

The lakehouse tooling, the books, and everything else on the main page.