Skip to content

YAAB documentation

Yet Another Agent Builder — a type-safe, governance-first agent SDK with a Rust performance core. Type-safe, optimizable, durable, and simple — the best ideas from across the agent ecosystem on one runtime, on a universal LiteLLM model layer.

YAAB is designed as a drop-in upgrade path for teams on other agent frameworks: the same building blocks you expect — agents, runners, sessions, memory, artifacts, tools, multi-agent workflows, MCP/A2A interop, streaming — plus a first-class governance/registry/compliance layer that none of them ship.

Start here

Guide What it covers
Get started The guided path: install → agent → tools → RAG → memory → multi-agent → govern → deploy
Concepts What each component is for, and how to tell the confusable ones apart (Checkpointer vs Session, Memory vs RAG, …)
Samples End-to-end sample apps & patterns (support bot, RAG QA, approval pipeline, swarm, …), tested offline
Quickstart Three-line agent, tools, typed output, offline testing
Agents Agent[Deps, Output], dependency injection, instructions, capabilities
Tools Typed function tools, agent-as-tool, MCP tools
Models LiteLLM layer, fallbacks, retries, cost, structured output, TestModel
State: sessions, memory, artifacts Managers + services, scoping, session→memory ingestion
Storage & backends In-memory defaults + Postgres/Aurora, Redis, pgvector, OpenSearch, Chroma, Qdrant, Oracle — all extendible
State scoping & AG-UI temp:/user:/app: state prefixes; AG-UI streaming middleware
RAG Built-in retrieval: knowledge base, chunking, vector stores, rerank, citations, faithfulness
Multi-agent Sequential, Parallel, Loop, Swarm, agent-as-tool
Streaming & events Token streaming, the semantic event stream, SSE endpoints
Usage limits & run control Token/request/tool caps, cancellation, timeouts
Robustness Built-in tools, context-window mgmt, HITL approval, resilience, YAML config
Graph orchestration Durable StateGraph, checkpoints, HITL, channels, time-travel
Interop: MCP & A2A MCP client/tools, A2A server + client (RemoteAgent)
Governance & compliance Registry, lifecycle, guardrails, audit, evals, compliance mappers
Evaluation Metric registry, RAGAS/DeepEval adapters, experiments, custom metrics
Optimization Signature/Module/Optimizer, compiled artifacts
Prompts & skills Versioned prompt management, reusable skill bundles
Serving & auth fastapi_server_app, A2A server, bearer/API-key/OAuth2
Platform extensions Doc loaders, Chroma/Qdrant, sandbox, structured streaming, batch, yaab web, sinks
Extending YAAB The component registry, protocols, entry points
Deployment Local → Cloud Run / Fargate / Lambda / K8s, durable backends

The mental model

Agent  ── the typed unit of work (model + instructions + tools + output type)
Runner ── executes agents: event stream, sessions, plugins, governance
Graph  ── durable, checkpointed orchestration when you need explicit control
Governance ── registry + lifecycle + guardrails + audit + compliance (opt-in by mode)
yaab-core ── a Rust performance core for the compute-bound primitives (pure-Python fallback)

Three orchestration paths compose over one runtime:

  1. Fast pathagent.run(prompt): a model-driven tool loop.
  2. Graph pathStateGraph: durable, checkpointed, HITL.
  3. Optimizable pathModule.compile(...): tune at build time, freeze for prod.

Python vs Rust — the honest split

YAAB is Python-first. The whole developer API, the agent loop, the model layer, governance, and orchestration logic are Python (~95% of the code). The Rust core (yaab-core, ~325 lines) accelerates only the compute-bound primitives — vector search, checkpoint serialization, channel reducers, BSP superstep planning + the opt-in whole-superstep fold, and audit hashing — each with a pure-Python fallback. The I/O-bound agent loop stays in Python on purpose (the model/tool network calls dominate, not the loop). The durable graph also exposes an explicit compile(engine="rust"|"python"|"auto") switch. See Graph › Choosing the engine.

Install

pip install yaab-sdk                 # core; pure-Python performance core works everywhere
pip install 'yaab-sdk[litellm]'      # universal model layer
pip install 'yaab-sdk[otel]'         # OpenTelemetry tracing
pip install 'yaab-sdk[all]'          # everything

# Build the Rust accelerator (optional; auto-falls back if absent):
pip install maturin && maturin develop -m yaab-core/Cargo.toml --release

Check the active core:

import yaab
print(yaab.BACKEND)   # "rust" or "python"