User Guide

Write agents in 1-3 lines. Get native ADK objects. Keep full control.

This guide takes you from “I know how to build a simple agent” to “I can design production multi-agent systems with data contracts, context engineering, middleware, and evaluation.” Read sequentially for the full journey, or jump to the topic you need.

Python or TypeScript?

This user guide is Python-first, but every concept applies to both adk-fluent (Python) and adk-fluent-ts (TypeScript). Code samples with a synced Python / TypeScript tab stay in sync once you pick one — click TypeScript on any block and the rest of the site follows.

If you’re using TypeScript, read the TypeScript (adk-fluent-ts) landing page first. It covers install, imports, and the full operator → method-chain mapping (>>.then(), |.parallel(), *.times(), //.fallback(), @.outputAs()).

Quick taste — every concept in 8 lines

from adk_fluent import Agent, S, C

support = (
    S.capture("message")                                    # S: State transforms
    >> Agent("classify", "gemini-2.5-flash")
       .instruct("Classify intent.")                        # P: Prompt (via .instruct)
       .context(C.none())                                   # C: Context engineering
       .writes("intent")                                    # Data flow: named state keys
    >> Agent("resolve", "gemini-2.5-flash")
       .instruct("Resolve the {intent} issue.")             # {key} = reads from state
       .tool(lookup_customer)                                # Tools: plain functions
       .writes("resolution")
)

Each line maps to a concept you’ll learn below. Hover over any builder method in your IDE to see its type signature.

Three Pathways

adk-fluent offers three distinct development pathways. All produce native ADK objects – they solve different problems at different abstraction levels. Pick the one that matches your use case, or combine them.

Pipeline Path
Python-first builders with >> | * operators and 9 namespace modules. Full programmatic control.
Most development starts here.
Skills Path
YAML + Markdown → agent graphs. Domain experts write prompts and topology. One file = docs + runtime.
Reusable, cross-team, config-driven.
Harness Path
Build autonomous coding runtimes with the H namespace. 5 layers: intelligence, tools, safety, observability, runtime.
File/shell access, permissions, REPL.

Not sure which? See the Decision Guide. All three compose: harnesses load skills, skills wire pipelines, pipelines use the full expression algebra.

Foundations

Start here if you’re new to adk-fluent.

Chapter

What you’ll learn

Architecture & Concepts

How builders wrap ADK, the IR tree, and the compilation pipeline

Best Practices

Opinionated guidance on when to use what

Framework Comparison

Side-by-side with LangGraph, CrewAI, and native ADK

Pipeline Path – Building Agents in Python

The core of the library. Full programmatic control with expression operators, namespace modules, and type-checked builders.

Chapter

What you’ll learn

Builders

Constructor args, method chaining, .build(), typo detection, .explain(), serialization

Expression Language

All 9 operators (>>, |, *, @, //, >> with functions, Route, race, dispatch)

Data Flow

.writes(), .reads(), {key} templates, state propagation between agents

Prompts

The P module: P.role(), P.task(), P.constraint(), section ordering, composition

Execution

.ask(), .stream(), .session(), .map(), .events()

Advanced Pipeline Capabilities

Chapter

What you’ll learn

Callbacks

.before_agent(), .after_model(), .guard(), error callbacks

Presets

Reusable configuration bundles with .use()

State Transforms

The S module: S.pick(), S.merge(), S.guard(), S.branch(), composition

Structured Data

@ Schema, .returns(), .produces(), .consumes(), contract checking

Context Engineering

The C module: C.none(), C.from_state(), C.window(), token budgets

Patterns

review_loop, map_reduce, cascade, fan_out_merge, conditional, supervised

Skills Path – Declarative Agent Packages

Turn YAML + Markdown into executable agent graphs. One file is simultaneously documentation, coding-agent context, and a runnable pipeline.

Chapter

What you’ll learn

Skills

Skill(), SkillRegistry, T.skill(), SKILL.md format, composition with operators, tool injection

Harness Path – Autonomous & Reactive Runtimes

Build Claude-Code-class autonomous agents and reactive, event-driven systems. The H namespace provides safety, observability, and runtime layers. The R namespace adds state-driven reactivity where agents activate on signal changes – conversation phases, quality scores, completion flags – without polling or manual dispatch.

Chapter

What you’ll learn

Harness

The H namespace, 5-layer architecture, EventBus, permissions, sandbox, budgets, REPL

Reactor

R namespace, Signal, SignalPredicate, Builder.on(), R.compile(), priority scheduling, preemption, AgentToken – declarative reactive agents

Hooks

H.hooks(), HookDecision, HookEvent, HookMatcher, session-scoped intervention at 12 ADK lifecycle points

Permissions

PermissionPolicy, PermissionDecision, five modes (default/accept_edits/plan/bypass/dont_ask), PermissionPlugin, approval memory

Plan Mode

Plan/execute latch, PlanMode, PlanModePolicy, enter_plan_mode / exit_plan_mode tools, read-only planning phase

Session

SessionStore, SessionSnapshot, auto-fork / auto-restore, tape replay, persistence

Durable Events

SessionTape seq/cursor/tail, TapeBackend (JSONL/InMemory/Null/Chain), stream_from_cursor, workflow lifecycle events

Subagents

SubagentSpec, SubagentRunner, dynamic spawner, make_task_tool, isolated child contexts

Compression

ContextCompressor, CompressionStrategy, pre_compact hooks, keep-recent / drop-old / summarize

Budget

BudgetPolicy, BudgetMonitor, BudgetPlugin, threshold callbacks, token / cost limits

Usage

UsageTracker, CostTable, TurnUsage, per-agent aggregation, cost-per-model accounting

Virtual Filesystem

FsBackend Protocol, LocalBackend, MemoryBackend, SandboxedBackend, workspace_tools_with_backend, sandbox-safe tool I/O

Infrastructure

Production concerns that apply across all three pathways.

Chapter

What you’ll learn

Visibility

.show(), .hide(), .transparent(), topology control

Transfer Control

.isolate(), .stay(), .no_peers()

Memory

.memory(), .memory_auto_save(), persistent agent memory

IR & Backends

.to_ir(), compilation, backend abstraction

Execution Backends

.engine(), ADK / Temporal / asyncio, capability matrix, backend selection

Temporal Guide

Durable execution, crash recovery, determinism rules, Temporal patterns

Middleware

The M module: M.retry(), M.log(), M.cost(), M.circuit_breaker(), composition

Guards

The G module: G.pii(), G.toxicity(), G.schema(), input/output validation

Evaluation

The E module: E.case(), E.criterion(), eval suites, comparison reports

Testing

.mock(), .test(), check_contracts(), AgentHarness, pytest integration

A2A

Remote agent-to-agent communication: RemoteAgent, A2AServer, discovery, resilience

A2UI

Declarative agent UIs: UI namespace, components, operators, surfaces, presets

Backend maturity at a glance

Backend

Status

Key Feature

ADK

Stable — production-ready, default

Native ADK objects, streaming, adk web/run/deploy

Temporal

In Development — API may change

Durable execution, crash recovery, distributed

asyncio

In Development — reference impl

Zero-dependency IR interpreter

DBOS / Prefect

Conceptual — not yet implemented

Under research

Start with ADK. If you need durability, see Execution Backends.

Reference

Resource

Description

Error Reference

Every error with cause and fix-it code

ADK Samples

Official ADK samples ported to adk-fluent

Decision Guide

“Which pattern should I use?” flowchart

Building agents

Harness (hooks, permissions, reactor)

Interactive Visual References

Rich interactive diagrams — open in a new tab for the full experience, or explore the embedded previews below.

Module Lifecycle Reference ↗

Where each module (S, C, P, A, M, T, E, G) fires during execution. Swim-lane timeline, interaction grid, and step-through walkthrough.

BUILD PRE LLM POST TOOL
P C S LLM Assembly

P·C·S Visual Reference ↗

How Prompt, Context, and State modules compose to assemble what the LLM sees. Factory catalogs, composition rules, and assembly order.

Prompt Context State
A B >> C |

Operator Algebra Reference ↗

All 9 operators with SVG flow diagrams, code examples, and composition rules. >>, |, *, @, //, Route, and more.

Sequential Parallel Loop Schema Fallback
R O W I C

Data Flow Reference ↗

The five orthogonal data-flow concerns: .reads(), .returns(), .writes(), .accepts(), and .produces(). Timeline, confusion matrix, and decision flowchart.

Context Output Storage Input Contract
Parent sub tool

Delegation & Transfer Reference ↗

.sub_agent() vs .agent_tool() control flow, transfer control matrix (.isolate(), .stay(), .no_peers()), and common topologies.

Transfer AgentTool Isolate Topology
S A vs sync async

Execution Modes Reference ↗

Sync vs async execution: .ask() vs .ask_async(), streaming, environment compatibility matrix, and the RuntimeError trap.

Sync Async Stream Batch
A2A

A2A Topology Reference ↗

Local vs remote agents, A2A mesh topology, state bridging (.sends() / .receives()), resilience middleware, and discovery methods.

Local Remote A2A Resilience