avodado
avodado docs
Blocks reference

AI & agents

Field contracts and worked examples for the 4 ai & agents blocks.

Field contracts and worked examples for the ai & agents blocks — converted at build time from the repo's authoring-skill reference. Every example body is YAML; in a real doc the fence language is the block type (for example sequence … ). Schemas are strict — unknown fields are rejected. See the field contract for the at-a-glance shape of all 77 blocks, or the block catalog for live previews.

AI & agents

Purpose-built for documenting LLM agents and pipelines: the loop itself (agentloop), what one episode actually did (trace), what the model is told (prompt), and what fills the window (context). They compose — the Agent system doc playbook in the avodado authoring skill stacks all four. For the surrounding architecture (services, queues, vector stores) stay with block (kind: llm/agent gets the violet card); for one turn's message timing use sequence.

agentloop — the canonical agent-loop diagram

```agentloopeditable · live
renderedavo renders this
SECTION 01 · Agent loop

Support triage agent

AGENT

One loop turn — the agent reads the ticket, calls tools, and replies or escalates.

Agent loopCustomerTriage agentclaude-sonnet-4-6Routes each ticket to a fixor a human.search_kbSearch help-centerarticlesget_accountLook up plan andbilling statecreate_ticketEscalate to a humanqueue1prompt4response2tool call3resultread/writememoryconversation historycustomer profile
stops when: reply sent or ticket escalated
Valid — passes avo check

The environment (env, default "User") sits left, the agent card centre (model renders as a mono chip, note as small text), tools stack right (capped at 5 + "+N more"), and a memory cylinder hangs beneath only when memory: is present. The numbered arrows are fixed — ① prompt → ② tool call → ③ result (dashed) → ④ response — so keep tools to what the agent can actually call. stop renders as a "stops when:" foot pill. Use agentloop for the loop itself; use block for the deployment around it.

trace — an agent / session execution transcript

```traceeditable · live
renderedavo renders this
SECTION 01 · Trace

Password reset — one episode

USER
I never get the reset email.
ASSISTANT
Could be a bounce — check delivery logs before blaming spam.
Let me check our email logs.
TOOL
email_logs.search
args:{ "to": "sam@example.com", "type": "password_reset" }
1 result: bounced (mailbox full)
ASSISTANT
Your mailbox rejected the email — free up space and I will resend it.
Valid — passes avo check

A vertical transcript — one entry per turn, each with a role chip (USER navy · ASSISTANT violet · TOOL teal · SYSTEM gray) and a card. Assistant turns may carry thinking (renders first, small italic); a tool turn is tool + args + result (mono chips, "args:" / "→"). Multi-line strings keep their line breaks, so block scalars (|) work for long output. Quote args / result — JSON braces and colons are YAML syntax. Use trace to show what one real episode did; use sequence for the timing between services.

prompt — prompt anatomy with variable highlighting

```prompteditable · live
renderedavo renders this
SECTION 01 · Prompt

Support reply template

SYSTEM— role + guardrails
You are a support agent for {{product}}. Answer from the docs only.
USER
Customer ({{plan}} plan) asks: {{question}}
{{product}}Product name from config
{{plan}}Plan tier of the signed-in customer
{{question}}The inbound message
Valid — passes avo check

Stacked cards, one per segment, each with a coloured role kicker (SYSTEM gray · USER navy · ASSISTANT violet · TOOL teal) and the text in a mono face. Any {{variable}} token highlights as an amber chip; list those variables in vars so the legend explains where each value comes from. text containing {{ }} must be quoted — bare braces are YAML flow syntax. Use prompt for templates and system prompts; use code for actual code.

context — context-window token budget

```contexteditable · live
renderedavo renders this
SECTION 01 · Context window

Where the 200k window goes

CONTEXT
Context windowwindow: 200,000 tokens12retrievalhistoryfree (50,000)
1system prompt6,000 tokens · 3%
2tool schemas14,000 tokens · 7%
3retrieval60,000 tokens · 30%top-8 chunks
4history70,000 tokens · 35%
Valid — passes avo check

One horizontal bar sized against window: segments left → right, leftover space as a dim "free (N)" segment, and a legend row per segment with N tokens · NN%. Zero-token segments are skipped; if the sum exceeds the window the overflow renders red past a dashed boundary with an "over budget" chip — deliberately alarming, use it to show the failure case. unit defaults to "tokens". Use context for window budgets; use a waterfall chart for latency/cost cascades and a funnel chart for conversion.