# AgentBlueprints

> Practical, copy-ready blueprints for AI agents, automation, model routing and MCP. Each blueprint includes steps and a copyable config, code sample, or prompt.

All blueprints are also available as Markdown at https://agentblueprints.dev/blueprints/<slug>.md and in full at https://agentblueprints.dev/llms-full.txt.

## AI Agent Workflows

- [Agent Tracing and Evaluation Setup](https://agentblueprints.dev/blueprints/agent-observability.md): Capture structured traces of every LLM and tool call and run a small regression eval suite on each change. (setup ~1-2 hours; last verified n/a)
- [Evaluator-Optimizer Refinement Loop](https://agentblueprints.dev/blueprints/evaluator-optimizer.md): One model generates, another grades against a rubric, and the loop repeats until the rubric passes or a limit is hit. (setup ~30-60 minutes; last verified n/a)
- [Human-in-the-Loop Approval Gate](https://agentblueprints.dev/blueprints/human-in-the-loop-approval.md): Let agents draft freely but require explicit human approval before any irreversible or external action. (setup ~2-4 hours; last verified n/a)
- [Planner-Executor Agent](https://agentblueprints.dev/blueprints/planner-executor.md): Split a task into an explicit plan, execute steps one at a time, and re-plan only when a step fails. (setup ~2-4 hours; last verified n/a)
- [RAG Agent with Grounded Citations](https://agentblueprints.dev/blueprints/rag-with-citations.md): Retrieval-augmented answering that cites source chunks and refuses when the context does not support an answer. (setup ~2-4 hours; last verified n/a)
- [ReAct Tool-Calling Agent Loop](https://agentblueprints.dev/blueprints/react-agent-loop.md): A minimal, provider-agnostic reason-act-observe loop with a step budget, tool registry, and safe termination. (setup ~30-60 minutes; last verified n/a)
- [Supervisor Multi-Agent Router](https://agentblueprints.dev/blueprints/supervisor-multi-agent.md): A supervisor agent delegates sub-tasks to specialist agents with narrow tools and merges their outputs. (setup ~3-6 hours; last verified n/a)

## n8n Automation Blueprints

- [n8n Form Lead Enrichment and CRM Sync](https://agentblueprints.dev/blueprints/n8n-lead-enrichment.md): Capture a lead via n8n Form Trigger, research the company website with an LLM, and upsert into a sheet or CRM. (setup ~1-2 hours; last verified n/a)
- [n8n Global Error Alerting Workflow](https://agentblueprints.dev/blueprints/n8n-error-workflow.md): A dedicated error workflow that alerts you with the failing workflow, node, and execution link whenever any workflow fails. (setup ~20 minutes; last verified n/a)
- [n8n Inbox Triage with LLM Classification](https://agentblueprints.dev/blueprints/n8n-email-triage.md): Classify incoming email into categories with structured output, then label, route, or draft replies. (setup ~1-2 hours; last verified n/a)
- [n8n RSS to AI Summary Digest](https://agentblueprints.dev/blueprints/n8n-rss-ai-digest.md): Daily schedule pulls RSS feeds, summarizes new items with an LLM, and posts a digest to Slack or email. (setup ~30-60 minutes; last verified 2026-10-14)
- [n8n Webhook-Triggered AI Agent](https://agentblueprints.dev/blueprints/n8n-webhook-ai-agent.md): Expose an n8n AI Agent (with memory and tools) behind a webhook that returns the answer synchronously. (setup ~1 hour; last verified 2026-10-14)

## Multi-Model Routing

- [Complexity-Based Cheap/Strong Model Router](https://agentblueprints.dev/blueprints/complexity-based-routing.md): Route easy requests to a cheap model and hard ones to a strong model using a lightweight classifier plus escalation. (setup ~1-2 hours; last verified n/a)
- [LiteLLM Proxy with Fallbacks and Load Balancing](https://agentblueprints.dev/blueprints/litellm-fallback-router.md): An OpenAI-compatible gateway that load-balances deployments and falls back across providers on errors. (setup ~30-60 minutes; last verified 2026-10-14)
- [Local-First Routing with Ollama and Cloud Fallback](https://agentblueprints.dev/blueprints/ollama-local-first.md): Serve requests from a local Ollama model, falling back to a cloud model only when local fails or the task needs it. (setup ~30 minutes; last verified 2026-10-14)
- [OpenRouter Model Fallback and Provider Ordering](https://agentblueprints.dev/blueprints/openrouter-fallback-models.md): Use OpenRouter's request-level models array and provider preferences for automatic failover. (setup ~15 minutes; last verified 2026-10-14)
- [Semantic Response Cache in Front of LLM Calls](https://agentblueprints.dev/blueprints/semantic-cache.md): Reuse prior answers for near-duplicate prompts using embedding similarity with a strict threshold and TTL. (setup ~1-2 hours; last verified n/a)

## Prompt & Agent Patterns

- [Chain-of-Verification Fact Check Prompt](https://agentblueprints.dev/blueprints/chain-of-verification.md): Draft an answer, generate verification questions, answer them independently, then revise, reducing factual errors. (setup ~15 minutes; last verified n/a)
- [Few-Shot Classification Prompt](https://agentblueprints.dev/blueprints/few-shot-classifier.md): A compact few-shot prompt for labeling text with balanced examples, an explicit label set, and an escape label. (setup ~30 minutes; last verified n/a)
- [Production Agent System Prompt Template](https://agentblueprints.dev/blueprints/system-prompt-template.md): A sectioned system prompt template covering role, context, tools, rules, and output format for tool-using agents. (setup ~30-60 minutes; last verified n/a)
- [Prompt Injection Defense for Tool-Using Agents](https://agentblueprints.dev/blueprints/prompt-injection-defense.md): Layered mitigations for agents that read untrusted content such as web pages, emails, and documents. (setup ~1-3 hours; last verified n/a)
- [Reliable Structured JSON Output Pattern](https://agentblueprints.dev/blueprints/structured-output-prompt.md): Get valid, schema-conforming JSON from any model using native structured outputs where available, and validate-and-repair otherwise. (setup ~30 minutes; last verified n/a)

## MCP & Tool Use

- [Build a Custom MCP Server in Python (MCPServer, formerly FastMCP)](https://agentblueprints.dev/blueprints/mcp-python-server.md): Expose your own functions as MCP tools and resources using the official Python SDK in about 20 lines. (setup ~20 minutes; last verified 2026-10-14)
- [Build a Custom MCP Server in TypeScript](https://agentblueprints.dev/blueprints/mcp-typescript-server.md): A minimal stdio MCP server using @modelcontextprotocol/sdk with a zod-validated tool. (setup ~20-30 minutes; last verified 2026-10-14)
- [GitHub MCP Server with a Scoped Token](https://agentblueprints.dev/blueprints/mcp-github-server.md): Run GitHub's official MCP server in Docker with a fine-grained, least-privilege personal access token. (setup ~20-30 minutes; last verified 2026-10-14)
- [MCP Starter Config for Claude Desktop](https://agentblueprints.dev/blueprints/mcp-claude-desktop-config.md): A claude_desktop_config.json wiring up filesystem, fetch, and git MCP servers with scoped access. (setup ~15 minutes; last verified 2026-10-14)
- [Read-Only Database Access for Agents via MCP](https://agentblueprints.dev/blueprints/mcp-postgres-readonly.md): Give an agent safe SQL querying through an MCP server connected with a read-only database role. (setup ~30 minutes; last verified 2026-10-14)
- [Tool Design Checklist for Agents and MCP](https://agentblueprints.dev/blueprints/mcp-tool-design-checklist.md): How to name, describe, and shape tools so models call them correctly and safely. (setup ~30 minutes per tool; last verified n/a)

## Site

- [Tools](https://agentblueprints.dev/tools/): blueprints grouped by tool
- [Request a blueprint](https://agentblueprints.dev/request/)
- [Pricing](https://agentblueprints.dev/pricing/)

## Optional

- [Full content](https://agentblueprints.dev/llms-full.txt): every blueprint in one Markdown file
- [JSON data](https://agentblueprints.dev/blueprints.json): machine-readable blueprint data
