Chains
Overview
Section titled “Overview”Chains are sequential multi-step pipelines defined in YAML. Each step specifies which tools to use and a system prompt that guides the LLM’s behavior for that step.
Chain Format
Section titled “Chain Format”name: my-chaindescription: What this chain doestier: freesteps: - id: step-1 tools: [tool_a, tool_b] systemPrompt: Instructions for this step. - id: step-2 tools: [tool_c] systemPrompt: Instructions for the next step. Can reference results from step-1. - id: step-3 tools: [tool_d, tool_e] systemPrompt: Final step instructions.Fields
Section titled “Fields”| Field | Type | Description |
|---|---|---|
name | string | Unique chain identifier |
description | string | What the chain does |
tier | free | paid | Content tier |
steps | array | Ordered list of execution steps |
steps[].id | string | Step identifier |
steps[].tools | string[] | Tools available for this step |
steps[].systemPrompt | string | LLM instructions for the step |
Example: Tax Prep Chain
Section titled “Example: Tax Prep Chain”name: tax-prepdescription: Analyze transactions for tax-deductible expenses and generate Schedule C summarytier: paidsteps: - id: scan tools: [transaction_search] systemPrompt: > Find all transactions that could be business-related or tax-deductible. Search broadly across software, subscriptions, travel, meals, office supplies, professional services. - id: categorize-for-tax tools: [categorize] systemPrompt: > Categorize identified business transactions using IRS Schedule C line items (advertising, car/truck, insurance, office, supplies, travel, meals, utilities, other). - id: flag-deductions tools: [anomaly_detect, transaction_search] systemPrompt: > Flag questionable deductions, mixed-use expenses needing allocation, meals over $75, and items missing documentation. - id: generate-report tools: [spending_summary, export_transactions] systemPrompt: > Generate a tax summary by Schedule C line item with totals, flagged items, and estimated tax savings. Export business expenses.Example: Cash Flow Forecast Chain
Section titled “Example: Cash Flow Forecast Chain”name: cash-flow-forecastdescription: Forecast cash flow by analyzing income/expense trends and projecting future balancestier: paidsteps: - id: analyze-trends tools: [spending_summary, transaction_search] systemPrompt: > Analyze 3-6 months of income and expense trends. Calculate monthly totals and identify direction. - id: identify-recurring tools: [anomaly_detect, transaction_search] systemPrompt: > Identify all recurring income and expenses with frequency and amounts. Note any recent changes. - id: project tools: [spending_summary] systemPrompt: > Project income, expenses, and net balance for the next 6 months using 3-month moving average with seasonal adjustments. - id: report tools: [spending_summary, export_transactions] systemPrompt: > Generate cash flow forecast with monthly projection table, risk indicators (savings rate, months to negative), and recommendations.Execution
Section titled “Execution”Each step runs sequentially. The LLM receives the step’s system prompt and has access only to the tools listed for that step. Results from earlier steps are available as context for later steps.
If any step fails, the chain stops and reports the error.