Skip to content
← all posts
7 min read

Agent Chain Templates: Start Building in 5 Minutes

Mentiko Team

The worst part of building agent chains isn't the complexity. It's the blank JSON file. You know what you want the chain to do, but translating that into agents, events, prompts, and triggers from zero is slow. Templates fix this. They give you a working chain that already handles the structural decisions -- agent count, event flow, error handling -- so you can focus on the part that's actually unique: your prompts and your data.

This isn't scaffolding that generates boilerplate you'll rewrite. These are production chains stripped down to their minimal viable form. Fork one, change the prompts, deploy it.

The blank canvas problem

Every agent chain has the same structural questions. How many agents? What events connect them? Where do errors get caught? Should anything run in parallel? These questions have well-known answers for common workflows. A content pipeline is always some variation of research-write-edit-publish. A support triage system always classifies then routes. A data processing chain always extracts, transforms, loads.

If you're spending time on structure instead of logic, you're solving a problem someone already solved. Templates encode those structural decisions so you skip directly to customization.

Template categories

Mentiko ships with templates organized by domain. Each template is a complete chain definition -- not pseudocode, not a diagram, but a JSON file you can deploy as-is.

Content operations. Pipelines for blog production, social media scheduling, newsletter generation, and content repurposing. The blog pipeline template chains a researcher, writer, editor, and SEO optimizer. The repurposing template takes one piece of content and fans out to agents that produce a Twitter thread, LinkedIn post, and email summary in parallel.

Engineering automation. Chains for PR review, dependency audits, changelog generation, and incident response. The PR review template runs three parallel agents (security scan, logic review, style check) and collects their findings into a single review comment. The incident response template triggers on a webhook, classifies severity, and routes to the appropriate runbook chain.

Customer support. Triage, routing, response drafting, and escalation chains. The triage template classifies incoming tickets by urgency and topic, routes to specialized handlers, and drafts responses with relevant documentation links. The escalation template monitors open ticket age and auto-escalates when SLA thresholds approach.

Research and analysis. Multi-source research, competitive analysis, report generation, and data synthesis. The research template fans out to multiple source agents (academic, news, forums, internal docs), collects findings, synthesizes them, and produces a structured brief.

Sales enablement. Lead scoring, outreach drafting, follow-up scheduling, and pipeline reporting. The outreach template takes a lead profile, researches their company, drafts a personalized message, and queues it for review.

How to fork a template

Every template in the Mentiko marketplace has a Fork button. Forking copies the chain definition into your workspace as a new chain. The original template stays untouched. Your fork is yours to modify.

From the CLI:

mentiko template fork content/blog-pipeline --name my-blog-chain

This creates a new chain called my-blog-chain in your workspace with the exact structure of the content/blog-pipeline template. The chain is immediately runnable -- you can trigger it before making any changes to see the baseline behavior.

From the UI, navigate to Marketplace, find the template, click Fork, and name your chain. Same result.

Customization points

Every template has four layers you can customize independently. You don't need to touch all of them.

Agents and prompts. This is where most customization happens. The template gives you the right number of agents with the right event wiring. You change what each agent actually does by rewriting its prompt. A blog pipeline's writer agent might have a generic "write a blog post" prompt -- you replace that with your brand voice, word count targets, and formatting rules.

Triggers. Templates default to chain:start as the entry trigger. You can rewire this to a webhook, a cron schedule, or an event from another chain. The structure inside the chain doesn't change -- just how it gets kicked off.

Schedules. Templates don't include schedules by default because timing is workflow-specific. Add a cron expression to run the chain on a schedule, or leave it manual. A weekly newsletter chain gets 0 9 * * 1 (Monday at 9 AM). A PR review chain triggers on webhook, no schedule needed.

Error handling. Templates include basic error recovery -- usually a fallback agent on the most failure-prone step. You can add more fallback agents, change retry counts, or wire up alerting. The on_error event on any agent can be pointed at a recovery agent or a notification chain.

Template anatomy

A template is just a chain definition with metadata. Here's the structure:

{
  "template": {
    "name": "content/blog-pipeline",
    "version": "1.2.0",
    "category": "content",
    "description": "Research, write, edit, and optimize blog posts.",
    "customization_hints": [
      "Rewrite writer prompt with your brand voice",
      "Add SEO keywords to optimizer prompt",
      "Change schedule to match your publishing cadence"
    ]
  },
  "chain": {
    "name": "blog-pipeline",
    "agents": [
      {
        "name": "researcher",
        "prompt": "Research {TOPIC} using web sources. Focus on data points, quotes, and recent developments. Output structured findings.",
        "triggers": ["chain:start"],
        "emits": ["research:complete"]
      },
      {
        "name": "writer",
        "prompt": "Write a 1200-word blog post from the research findings. Use a professional but conversational tone.",
        "triggers": ["research:complete"],
        "emits": ["draft:complete"]
      },
      {
        "name": "editor",
        "prompt": "Edit for clarity, grammar, and flow. Cut unnecessary words. Ensure all claims are supported by the research.",
        "triggers": ["draft:complete"],
        "emits": ["edit:complete"]
      },
      {
        "name": "seo-optimizer",
        "prompt": "Add meta description, suggest title variants, check keyword density, add internal link suggestions.",
        "triggers": ["edit:complete"],
        "emits": ["chain:complete"]
      }
    ]
  }
}

The template block is metadata that the marketplace uses for discovery and display. The chain block is the actual chain definition -- identical to what you'd write from scratch. When you fork, the template block is stripped and you get a clean chain.

The customization_hints array tells you where to start modifying. It's documentation for the fork, not runtime configuration.

Creating your own templates

Any chain in your workspace can become a template. If you've built a chain that works well and could be useful to others (or to future-you across different projects), publish it.

mentiko template publish my-blog-chain \
  --category content \
  --description "Blog pipeline with brand voice and SEO optimization" \
  --hints "Update writer prompt for your brand" \
  --hints "Add your target keywords to SEO agent"

This wraps your chain definition in template metadata and submits it to the marketplace. You can publish templates as public (available to everyone) or org-private (available only to your organization).

Good templates share a few traits. They use generic variable names like {TOPIC} and {AUDIENCE} instead of hardcoded values. Their prompts describe the task structure without being overly specific to one use case. They include error handling on agents that interact with external services. And their customization hints actually point to the things someone would need to change.

Publishing to the marketplace

The Mentiko marketplace is where templates live after publishing. Every template shows its agent count, event flow diagram, category, fork count, and the customization hints from the author.

Templates are versioned. When you update a published template, existing forks are not affected -- they're independent copies. Users who forked an earlier version can see that a new version exists and choose to merge updates, but it's never automatic.

The marketplace also tracks which templates are most forked and which have the highest run success rates. This surfaces templates that actually work in production, not just ones with good descriptions.

When evaluating a template, look at three things: the agent count (fewer is usually better), the event flow (does it match your mental model of the workflow), and the customization hints (do they make sense for your use case). If all three check out, fork it and start customizing. You'll be running a production chain in minutes instead of hours.

Start with a template, end with your own

The progression is straightforward. Browse templates, fork one that's close to what you need, customize the prompts and triggers, run it, iterate. Once your chain is stable and useful, publish it as a template for your team or the community.

Every template in the marketplace started as someone's blank JSON file. The point is that yours doesn't have to.


Browse available templates in the Mentiko Marketplace, or build your first chain from scratch if you prefer starting from zero.

Get new posts in your inbox

No spam. Unsubscribe anytime.