Recipes by Use Case

Can’t find the right cookbook example? This page organizes all 58 recipes by real-world use case so you can jump straight to the pattern you need.

Quick find by primitive

Jump to recipes that demonstrate a specific adk-fluent primitive.

Primitive

What it does

Recipes

>> (chain)

Sequential composition

#04, #16, #28, #29, #34, #55, #57

| (parallel)

Concurrent branches

#05, #16, #28, #34, #55, #57

* (repeat)

Loop N times

#06, #16, #30

@ (typed output)

Structured output schema

#31, #53, #55, #57

// (fallback)

Try A, fall back to B

#32

Route

Deterministic branching

#17, #18, #50, #56

S.* transforms

State manipulation

#33, #50, #55, #56

C.* context

Context engineering

#49, #55, #56

tap

Observe without side effects

#35, #57

expect

State assertions

#36, #43

gate

Human-in-the-loop approval

#41, #56

proceed_if

Conditional gating

#19, #57

loop_while

Retry on transient failure

#38

timeout

Execution deadline

#40

race

First response wins

#42

loop_until

Loop until predicate

#20, #28

map_over

Iterate over items

#39

Preset

Reusable config bundle

#22, #28

.guard()

Safety guards

#12, #58

.agent_tool()

LLM-driven routing

#27

.session()

Interactive sessions

#13

.explain()

Builder introspection

#25

.to_mermaid()

Architecture diagrams

#48

mock_backend()

Deterministic testing

#37

E.* eval

Structured evaluation

#11, #37, #46

E.compare()

Model comparison

#32

E.gate()

Quality gate in pipeline

#46

@agent decorator

Decorator syntax

#24

Quick find by question

I need to…

Start here

Build a simple agent

#01

Add tools to an agent

#02, #58

Build a chatbot with memory

#13, #49

Chain agents into a pipeline

#04, #29

Run agents in parallel

#05, #42

Route to different agents

#17, #18, #27

Add guardrails and safety

#12, #19, #46

Test my agents

#11, #36, #37

Evaluate agent quality

#11, #37, #46

Compare models / agents

#32

Retry / handle failures

#38, #32, #40

Deploy to production

#15, #45, #47

Serialize / save agents

#26

Debug data flow issues

#25, #52, #48

Build a complex real-world pipeline

#28, #55, #56


Customer Support & Triage

Build agents that classify tickets, route conversations, and escalate issues.

Every support system needs the same core capabilities: classify intent, route to the right specialist, and escalate when the specialist fails. Without deterministic routing, an LLM coordinator wastes API calls deciding where to send a billing question – a decision that should be instant and free. Without context engineering, each specialist sees the classifier’s internal reasoning mixed in with the customer’s actual message, leading to confused responses. Without escalation gates, unresolved tickets silently close instead of reaching a human. These recipes show how adk-fluent handles each of these concerns declaratively.

Recipe

Key features

Cookbook

Email Classifier Agent

Simple agent creation

#01

Customer Support Chat Session

Interactive .session() API

#13

Multi-Department Ticket Routing

Dynamic field forwarding

#14

Customer Support Triage

S.capture, C.none, Route, gate

#56

Customer Service Hub

Transfer control, .isolate()

#54

IT Helpdesk Triage

Capture and route pattern

#50

Data Processing & ETL

Transform, validate, and pipeline structured data through multi-step workflows.

Data pipelines break in predictable ways: missing fields crash downstream agents, renamed columns produce garbage, and unchecked nulls propagate silently until they corrupt the final output. In native ADK, every transform requires a custom BaseAgent subclass – 15-30 lines of boilerplate per step. In adk-fluent, S.pick, S.rename, S.guard, and S.compute are composable one-liners that slot into any pipeline with >>. The result is a pipeline where data transformations are visible in the topology, not hidden in class files.

Recipe

Key features

Cookbook

Document Processing Pipeline

Sequential pipeline

#04

ETL Pipeline with Function Steps

>> fn plain function composition

#29

Research Data Pipeline

S.* state transforms

#33

Analytics Data Quality

expect() state assertions

#36

Batch Processing Customer Feedback

map_over iteration

#39

Insurance Claim Processing

Structured schemas, @ operator

#53

Search & Research

Build research agents, deep search pipelines, and knowledge retrieval systems.

Research pipelines have a unique failure mode: they need to be both broad and deep. A single-source search misses critical information. A sequential search wastes time when sources are independent. And a search without quality review produces reports full of contradictions that nobody trusts. adk-fluent’s parallel operator | runs searches concurrently, the // fallback operator adds graceful degradation when a source is down, and the * until() loop operator iterates quality reviews until confidence thresholds are met. Without these, you end up with brittle pipelines that either miss sources or produce low-quality output.

Recipe

Key features

Cookbook

Market Research Fan-Out

Parallel FanOut

#05

News Analysis Pipeline

Operator composition >>, |, *

#16

Investment Analysis Pipeline

Full expression language

#28

Knowledge Retrieval with Fallback

// fallback operator

#32

Fastest-Response Search (Race)

race across providers

#42

Deep Research Agent

>>, |, *, @, S.*, C.*

#55

Content Generation & Review

Generate, refine, and review text content with iterative quality loops.

Content quality is inherently iterative – first drafts are rarely good enough. Without structured iteration, teams resort to manual copy-paste cycles between a writer and reviewer, losing context and version history with each round. The * N and * until() operators in adk-fluent formalize this iteration pattern, making it testable and bounded. The @ operator ensures output conforms to a schema, and tap() lets you observe quality metrics without mutating the pipeline. Without these, quality loops are ad-hoc and unbounded, leading to either infinite loops or premature termination.

Recipe

Key features

Cookbook

Essay Refinement Loop

Loop agent with iterations

#06

Resume Refinement with Exit

loop_until conditional exit

#20

Customer Onboarding Loop

* until(pred) operator

#30

A/B Prompt Testing

.with_() for variants

#23

Code Review Pipeline

Full expression algebra

#34

Code Review Agent

>>, |, @, proceed_if, tap

#57

Content Review Pipeline

Visibility policies

#51

E-Commerce & Finance

Order routing, fraud detection, invoice parsing, and financial analysis.

E-commerce and financial systems demand deterministic behavior – routing a payment to the wrong processor is not a “hallucination,” it’s a financial incident. LLM-based routing is too slow and too unpredictable for decisions that can be made on a single state key. adk-fluent’s Route primitive provides instant, deterministic branching based on state values. proceed_if() gates prevent unauthorized transactions from reaching downstream processors. @ typed output ensures invoices and reports conform to expected schemas rather than returning free-form text that breaks downstream systems.

Recipe

Key features

Cookbook

E-Commerce Order Routing

Route deterministic branching

#17

Fraud Detection Pipeline

proceed_if conditional gating

#19

Order Processing with State Keys

StateKey typed descriptors

#21

Structured Invoice Parsing

@ typed output operator

#31

E-Commerce Primitives Showcase

All primitives combined

#43

Team Coordination & Delegation

Multi-agent systems with coordinators, specialists, and routing.

Most multi-agent systems start the same way: a coordinator decides which specialist to call. The critical design choice is whether the coordinator uses the LLM to decide (flexible but expensive and unpredictable) or uses deterministic rules (fast and testable but rigid). adk-fluent supports both: .agent_tool() lets the LLM pick the specialist when the decision is complex, while Route() provides instant deterministic dispatch when the decision is simple. Without this distinction, teams either waste API calls on trivial routing or lose flexibility on complex delegation.

Recipe

Key features

Cookbook

Product Launch Coordinator

Team coordinator pattern

#07

Senior Architect Delegates

LLM-driven routing, .agent_tool()

#27

Multi-Language Routing

Dict >> shorthand

#18

Multi-Tool Task Agent

.tool(), .guard(), .inject()

#58

Safety, Guardrails & Compliance

Content moderation, medical safety, legal approval gates, and contracts.

In regulated domains, an unguarded AI response can create legal liability, violate compliance requirements, or cause patient harm. Guardrails are not optional – they are the difference between a prototype and a deployable system. adk-fluent’s .guard() method registers safety checks as both pre-model and post-model hooks in a single call. gate() pauses the pipeline for human approval on high-risk decisions. Data contracts (.produces(), .consumes()) catch missing fields at build time rather than letting them surface in production with patient data at stake. Without these, every safety check is a hand-written callback scattered across the codebase with no guarantee of consistent application.

Recipe

Key features

Cookbook

Content Moderation with Logging

before_model, after_model callbacks

#03

Medical Advice Safety Guards

.guard() method

#12

Legal Document Review

gate with human approval

#41

Medical Imaging Contracts

.produces(), .consumes(), strict contracts

#46

Contract Checking

Catch data flow bugs early

#52

Enterprise Compliance Preset

Preset for shared config

#22

Production & Deployment

Deploying, testing, serializing, and monitoring agents in production.

The gap between a working prototype and a production system is filled with concerns that have nothing to do with the agent’s core logic: retries for transient failures, cost tracking for budget management, latency monitoring for SLA compliance, dependency injection for environment-specific configuration, and serialization for CI/CD pipelines. In native ADK, each of these requires custom boilerplate. adk-fluent’s middleware system (M.retry(), M.cost(), M.latency()), dependency injection (.inject()), and serialization (to_dict(), to_yaml()) handle these cross-cutting concerns declaratively. Without them, production concerns leak into agent logic, making the code harder to test, harder to maintain, and harder to reason about.

Recipe

Key features

Cookbook

Production Deployment

to_app() with middleware

#15

Deployment Serialization

to_dict, to_yaml, from_dict

#26

Mock Testing Pipeline

mock_backend(), deterministic tests

#37

Dependency Injection

Dev/staging/prod environments

#47

ML Inference Monitoring

tap for pure observation

#35

Middleware Stack

Production middleware for healthcare

#45

Retry on Transient Failures

loop_while pattern

#38

Timeout for Trading Agent

timeout execution deadline

#40

Developer Experience & Tooling

Introspection, visualization, debugging, and IDE workflow.

When an agent pipeline does something unexpected, you need to answer three questions fast: what is the pipeline topology, what data flows between agents, and which agent produced the wrong output? Without introspection tools, you resort to print-debugging across a graph of async agents – a miserable experience. adk-fluent provides .explain() for human-readable pipeline summaries, .validate() for configuration errors, .to_mermaid() for architecture diagrams that stay in sync with code, and .inspect() for raw builder state. These tools turn debugging from guesswork into systematic investigation.

Recipe

Key features

Cookbook

Travel Planner with Tools

Attaching function tools

#02

Quick Code Review with .ask()

One-shot execution

#08

Live Translation Streaming

.stream() token-by-token

#09

A/B Testing Agent Variants

.clone() for independent copies

#10

Smoke-Testing with .test()

Inline testing

#11

Validate & Explain

.validate(), .explain(), .inspect()

#25

Domain Expert via @agent

@agent decorator

#24

Architecture Diagrams

.to_mermaid() visualization

#48

IR and Backends

Inspecting and compiling agent graphs

#44

Context Engineering

C.* context transforms

#49