Agent workflow

From breethomas/bette-think · View interactive version

Agent workflow is an AI agent skill from the GitHub repository breethomas/bette-think. Expert system for designing and architecting AI agent workflows based on proven Meta methodologies. Use when users need to build AI agents, create agent workflows, solve problems using agentic systems, integrate multiple tools into agent architectures, or need guidance on agent design patterns. Help

How to use this skill

Skill file

Agent Workflow Designer

Overview

This skill guides the design and architecture of AI agent workflows using proven methodologies. When a user presents a problem, this skill helps structure an agent-based solution following the 9-step building process and 8-layer architecture framework validated at Meta.

Workflow Decision Tree

When a user shares a problem or requests agent design help:

  1. Assess the problem scope
  1. Determine architecture complexity
  1. Follow the appropriate workflow

9-Step Agent Building Process

Use this sequential workflow when designing a new agent from scratch:

Step 1: Define Purpose and Scope

Key principle: Start with job-to-be-done, not technology.

Ask the user:

Bad scope example:

"An AI assistant for customer service"

Good scope example:

"An agent that takes customer complaints, pulls order history from Shopify API, and drafts refund approvals for orders under $200"

Decision point: Narrow scope = better performance. Resist building Swiss Army knives.

Step 2: Structure Inputs and Outputs

Treat the agent as a function with structured interfaces:

Inputs:

Outputs:

Example structure:

Input: {
  "complaint_text": "string",
  "customer_id": "string",
  "order_id": "string (optional)"
}

Output: {
  "action": "approve_refund | escalate | request_info",
  "refund_amount": "number",
  "reasoning": "string",
  "confidence": "number"
}

Step 3: Write System Instructions

Critical: Spend 80% of design time here.

Include in system prompt:

Testing strategy: A great system prompt can make GPT-3.5 outperform poorly prompted GPT-4.

Step 4: Enable Reasoning and External Actions

ReAct Framework Pattern:

  1. Reason: Analyze the current state and decide next action
  2. Act: Call an API, use a tool, or make a decision
  3. Observe: Review the result and determine if goal is achieved

Start simple:

Common tools to integrate:

Step 5: Orchestrate Multiple Agents (When Needed)

When to use multi-agent architecture:

When NOT to use multi-agent:

Common 4-agent pattern:

  1. Research Agent: Gathers information from sources
  2. Analysis Agent: Processes and synthesizes data
  3. Writing Agent: Creates structured outputs
  4. QA Agent: Reviews quality and accuracy

Keep handoffs simple: Complex orchestration = complex failures.

Step 6: Implement Memory and Context

Three types of memory to consider:

Conversation history:

User context:

Knowledge retrieval:

Implementation guidance:

Step 7: Add Multimedia Capabilities

Modern agents should handle:

Strategic approach: Add capabilities based on actual user needs, not "nice-to-haves."

Step 8: Format and Deliver Results

Output is your product's UX. Design outputs for:

Human consumption:

System consumption:

Quality standard: Great agent outputs look like a human created them.

Step 9: Build Interface or API

Delivery method options:

Best practice: The best agents feel invisible—they just make things happen.

8-Layer Architecture Framework

When analyzing agent architecture needs, consider which layers require attention:

Layer 1: Infrastructure

Foundation: Cloud, databases, APIs, compute resources

Key considerations:

Common mistake: Underestimating compute needs—agents make more API calls than traditional apps.

Layer 2: Agent Internet

Operating system for agents: Identity, state management, inter-agent communication

Current state: Mostly custom-built, but platforms like LangChain and CrewAI are emerging.

Layer 3: Protocol

Standards for interoperability: MCP (Model Context Protocol) is becoming the standard

Key principle: Bet on open standards, not proprietary solutions. MCP allows any tool to work with any agent.

Layer 4: Tooling Enrichment

Agent superpowers: RAG systems, function calling, external integrations

Quality over quantity: 5 rock-solid tools > 50 flaky integrations

Tool categories:

Layer 5: Cognition Reasoning

The brain: Planning, decision-making, error handling

Critical elements:

User forgiveness: Users forgive agents that fail gracefully, not ones that spiral into nonsense.

Layer 6: Memory Personalization

Human touch: Personal context, preferences, conversation history

Start simple: Store user preferences and conversation context before building complex personalization.

Layer 7: Application

User-facing products: The actual agent functionality users interact with

Focus strategy: Nail one use case before expanding to others.

Layer 8: Ops Governance

Risk management: Monitoring, cost control, privacy, oversight

Build from day one: Retrofitting governance is expensive and painful.

Key components:

Problem-to-Solution Workflow

When a user presents a problem:

Step 1: Clarify the problem

Step 2: Assess agent appropriateness

Not every problem needs an agent. Consider:

Step 3: Map to architecture

Using the 8 layers, identify which need focus:

Step 4: Design workflow

Apply the 9-step building process, calling out:

Step 5: Identify implementation path

Based on user's role and resources:

Tool Integration Patterns

MCP (Model Context Protocol) Integration

When tools support MCP:

  1. Agent discovers available tools
  2. Agent calls tools using standardized interface
  3. Tool returns structured response
  4. Agent processes and continues workflow

Advantage: Write once, use with any agent.

Custom API Integration

When building custom integrations:

  1. Define clear API contract (inputs/outputs)
  2. Implement error handling and retries
  3. Add rate limiting and caching
  4. Monitor usage and costs
  5. Document for agent consumption

Common Integration Scenarios

CRM Integration (Salesforce, HubSpot):

Communication Tools (Slack, Email):

Data Sources (Databases, APIs):

Decision Framework: Single vs. Multi-Agent

Use Single Agent When:

Use Multi-Agent When:

Example - Customer Support:

Single agent sufficient for:

"Take customer complaint, pull order history, draft refund approval"

Multi-agent beneficial for:

"Monitor social media, categorize issues, research solutions, generate responses, escalate critical cases, track resolution"

Common Pitfalls and Solutions

Pitfall 1: Scope Creep

Problem: Trying to build a general-purpose assistant

Solution: Define narrow, specific job-to-be-done with clear success metrics

Pitfall 2: Tool Overload

Problem: Giving agent 50+ tools upfront

Solution: Start with 5 essential tools, add incrementally based on actual needs

Pitfall 3: Skipping System Prompt

Problem: Generic or minimal instructions

Solution: Invest 80% of time crafting detailed system prompt with examples and edge cases

Pitfall 4: No Error Handling

Problem: Agent breaks on unexpected inputs

Solution: Design graceful degradation, clear error states, and fallback behaviors

Pitfall 5: Ignoring Costs

Problem: Runaway API costs from inefficient agent design

Solution: Build cost monitoring from day one, implement caching, optimize prompt length

Pitfall 6: Over-Engineering Architecture

Problem: Building all 8 layers simultaneously

Solution: Start with Layers 4, 5, 7 (tools, reasoning, application), add others as needed

Output Format

When providing agent workflow solutions, structure the response as:

  1. Problem Restatement: Confirm understanding of the user's need
  2. Agent Architecture Recommendation: Single vs. multi-agent, with rationale
  3. Step-by-Step Workflow: Apply relevant steps from the 9-step process
  4. Tool Integration Plan: Specific tools needed and integration approach
  5. Layer Analysis: Which of the 8 layers need focus and why
  6. Implementation Guidance: Prioritized next steps based on user's role
  7. Success Metrics: How to measure if the agent is working

Agent Taxonomy Quick Reference

When users ask about existing tools:

Category 1: Consumer Agents (Built-In)

Category 2: No-Code Builders

Category 3: Developer-First Platforms

Category 4: Specialized Agent Apps

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.