Skip to content
chiltepin
chiltepin docs
Blocks reference

AI & agents

When to use each of the 6 ai & agents blocks, with a live example of every one.

The ai & agents blocks: what each one is for, how to choose between neighbours, and a live starter example you can edit — converted at build time from the authoring skill your agent reads. 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. The full field contract for any block — every field, enum, and terse one-line form, generated from the schema — is npx chiltepin block <type>. See the block catalog for every block rendered on one page.

Shape: Structure & emphasis — four fixed frames for one LLM agent: the loop (agentloop), one real episode (trace), the contract (prompt), and the window budget (context). Answers: What does the loop do? What can it call? What is the model told? What fills the window? What did a real run look like? They compose — the AI / agent recipe in reference/recipes.md stacks all four. Not this family: the architecture around the agent (services, queues, vector stores) → block (architecture.md; kind: llm / agent gets the violet card); one turn's message timing between services → sequence (flows.md).

AI & agents

agentloop — the canonical agent-loop diagram

Environment left, agent card centre, tools stacked right, a memory cylinder below. Answers: what does one loop turn do, and what can the agent call? The four numbered arrows are fixed (prompt → tool call → result → response). List only tools the agent can call; the render shows 5 and folds the rest. The memory cylinder draws only when memory: is present. agentloop for the loop itself; block for the deployment around it.

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

Support triage agent

AGENT
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
Legendenvironmentagenttool · memoryprompt · tool callresponse · result
stops when: reply sent or ticket escalated
Valid — passes chiltepin check

trace — an agent / session execution transcript

A vertical transcript: one card per turn with a role chip (user, assistant, tool, system). Answers: what did one real episode do, step by step? Quote args and result: JSON braces and colons are YAML syntax. Block scalars (|) keep line breaks. trace, not sequence, to follow one conversation; sequence for the timing between services.

```traceeditable · live
renderedchiltepin 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 chiltepin check

prompt — prompt anatomy with variable highlighting

Stacked segment cards with role kickers; every {{variable}} highlights as a chip. Answers: what is the model told, and where does each value come from? Quote any text that contains {{ }}: bare braces are YAML flow syntax. List each variable in vars so the legend explains it. prompt, not code, for templates and system prompts; code for programs.

```prompteditable · live
renderedchiltepin 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 chiltepin check

context — context-window token budget

One horizontal bar sized against window, segments left to right, free space dim. Answers: what fills the window, and how much is left? A sum past window draws red past a dashed boundary with an "over budget" chip. Use it to show the failure case on purpose. context for token budgets; a waterfall chart for latency and cost.

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

Where the window goes

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

neuralnet — layered network

One column per layer with units, kind (input / conv / pool / dense / attention / output …) and activation; dense mesh between layers, an ellipsis when a layer is wider than maxUnits. Answers: what is the model's shape? List the layers a reader would name, not every repeated block: fold "12 × transformer block" into one attention layer with a note. neuralnet for the architecture; flow (variant: dag) for the training pipeline; chart line for loss curves.

```neuralneteditable · live
renderedchiltepin renders this
SECTION 01 · Neural net

Digit classifier

NEURAL NET
Neural network: 6 layersInput78428×28 pixelsConv 3×332ReLUMax pool32Dense128ReLUDropout 0.3128Output10softmax
Legendinputconvpooldensedropoutoutput
Params 1.2M
Valid — passes chiltepin check

modelcard — model card

Identity, intended use and out-of-scope, training data, metrics per split, limitations, ethics. Answers: what is this model, and what may it be used for? The endpoint card for a model: one per deployed model version. modelcard, not spec, for a model; benchmark to compare candidates.

```modelcardeditable · live
renderedchiltepin renders this
SECTION 01 · Model card
MODEL·3.2.0support-intent-v3taskText classification (support ticket intent)
architectureDistilBERT fine-tune, 6 layers
params66M
ownerML platform
licenseInternal
Intended use
  • Route inbound tickets to one of 14 queues
  • Suggest a queue to an agent; never auto-close
Out of scope
  • Any language other than English and Spanish
Training data
  • 410k tickets, 2024-01 to 2025-06, PII scrubbed
Metrics
MetricValueSplitNote
Macro F10.91test
Latency p9538 msprodCPU, batch 1
Limitations
  • Confuses billing and refund intents on short tickets
Valid — passes chiltepin check