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.
Python-first builders with
>> | * operators and 9 namespace modules. Full programmatic control.Most development starts here.
YAML + Markdown → agent graphs. Domain experts write prompts and topology. One file = docs + runtime.
Reusable, cross-team, config-driven.
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 |
|---|---|
How builders wrap ADK, the IR tree, and the compilation pipeline |
|
Opinionated guidance on when to use what |
|
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 |
|---|---|
Constructor args, method chaining, |
|
All 9 operators ( |
|
|
|
The P module: |
|
|
Advanced Pipeline Capabilities¶
Chapter |
What you’ll learn |
|---|---|
|
|
Reusable configuration bundles with |
|
The S module: |
|
|
|
The C module: |
|
|
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 |
|---|---|
|
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 |
|---|---|
The |
|
|
|
|
|
|
|
Plan/execute latch, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Infrastructure¶
Production concerns that apply across all three pathways.
Chapter |
What you’ll learn |
|---|---|
|
|
|
|
|
|
|
|
|
|
Durable execution, crash recovery, determinism rules, Temporal patterns |
|
The M module: |
|
The G module: |
|
The E module: |
|
|
|
Remote agent-to-agent communication: |
|
Declarative agent UIs: |
Backend maturity at a glance
Backend |
Status |
Key Feature |
|---|---|---|
ADK |
Stable — production-ready, default |
Native ADK objects, streaming, |
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 |
|---|---|
Every error with cause and fix-it code |
|
Official ADK samples ported to adk-fluent |
|
“Which pattern should I use?” flowchart |
Foundations
- Foundations
- Architecture & Core Concepts
- Builders
- Constructor Arguments
- Method Chaining (Fluent API)
.build()– Terminal Method__getattr__Forwarding- Typo Detection
.explain()– Introspection.validate()– Early Error Detection.clone()and.with_()– Variants- Serialization
- IR Compilation
- Data Contracts
- Dependency Injection
- Middleware
- Escape Hatches
- Workflow Builders
- Combining Builder and Operator Styles
- Expression Language
- Operator Summary
- Reading an expression
- Immutability
>>– Pipeline (Sequential)- Function Steps
|/.parallel()– Parallel (Fan-Out)*/.times()– Loop@/.outputAs()– Typed Output///.fallback()– Fallback ChainRoute("key").eq(...)– Deterministic Routing- Conditional Gating
- Full Composition
- Backend Compatibility
- Data Flow Between Agents
- The Five Concerns
- The Three Composition Modules: P, C, S
- What Gets Sent to the LLM
- P Module: Prompt Composition
- C Module: Context Engineering
- S Module: State Transforms
- Input: What the Agent Accepts (Tool Mode)
- Output: What Shape the Response Takes
- Storage: Where the Response Goes
- Contracts: Static Annotations
- End-to-End Compilation: From Builder to LLM Call
- Inspecting Data Flow
- Common Patterns
- T Module: Tool Composition
- A Module: Artifact Operations
Building agents
- Building agents
- Prompt Builder
- One-Shot Execution
.ask(prompt).ask_async(prompt).stream(prompt).events(prompt).session().map(prompts, concurrency=5).map_async(prompts, concurrency=5).test(prompt, contains=, matches=, equals=).to_app(config=None)- Execution Method Summary
- Choosing an Execution Method
- Interplay with Other Modules
- Best Practices
- Callbacks
- Presets
- State Transforms
- Structured Data
- Context Engineering
- Quick Start
- Which
C.*do I want? - The Problem
- Primitives Reference
C.none()C.default()C.userOnly()/C.user_only()C.fromState()/C.from_state()C.fromAgents()/C.from_agents()C.excludeAgents()/C.exclude_agents()C.window(n)C.template(str)S.capture(key)C.budget(max_tokens=)C.priority(tier=)- Composition
- Integration with Agent Builder
- Complete Example
- What Gets Sent to the LLM
Patterns & control flow
Safety & observability
Backends & execution
Distributed agents
Harness (hooks, permissions, reactor)
- Skills – Composable Agent Packages
- Building Harnesses – From Agent to Autonomous Runtime
- Hooks — The Unified Observation and Intervention Layer
- Permissions
- Plan mode
- Session store, fork & replay
- Durable event log – seq, cursors, tail & backends
- Reactor – reactive signals, priorities & interrupts
- Subagents
- Compression
- Budget
- Usage tracking
- Virtual filesystem – pluggable backends for workspace tools
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.
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.
Operator Algebra Reference ↗
All 9 operators with SVG flow diagrams, code examples, and composition rules. >>, |, *, @, //, Route, and more.
Data Flow Reference ↗
The five orthogonal data-flow concerns: .reads(), .returns(), .writes(), .accepts(), and .produces(). Timeline, confusion matrix, and decision flowchart.
Delegation & Transfer Reference ↗
.sub_agent() vs .agent_tool() control flow, transfer control matrix (.isolate(), .stay(), .no_peers()), and common topologies.
Execution Modes Reference ↗
Sync vs async execution: .ask() vs .ask_async(), streaming, environment compatibility matrix, and the RuntimeError trap.
A2A Topology Reference ↗
Local vs remote agents, A2A mesh topology, state bridging (.sends() / .receives()), resilience middleware, and discovery methods.