A collection of agentic workflow pattern implementations using the Anthropic SDK for TypeScript. Each pattern demonstrates different approaches to building AI-powered applications with Claude.
Sequential processing where each LLM call's output feeds into the next step. Ideal for multi-stage transformations and analysis pipelines.
Execute independent LLM tasks concurrently to improve performance. Useful for batch processing and multi-faceted analysis.
Intelligently route requests to specialized models or prompts based on input classification. Optimizes for cost, latency, and accuracy.
Coordinate multiple worker agents from a central orchestrator. Demonstrates task decomposition, parallel execution, and result aggregation with OpenTelemetry instrumentation.
Iterative refinement loop where an evaluator provides feedback to improve generated artifacts. Generates and optimizes OpenAPI specifications through validation and quality assessment cycles.
Interleave reasoning and action steps, allowing the agent to dynamically plan and execute based on observations.
Multiple specialized agents work together, coordinating to solve complex tasks through negotiation and information sharing.
An autonomous AI agent with persistent memory, adaptive learning, and multi-session capabilities for conducting research tasks. This pattern has been moved to its own repo.
Each pattern directory contains:
- Complete working implementation
- Dedicated README with usage instructions
- Test cases demonstrating the pattern
- TypeScript examples with the Anthropic SDK
- Node.js v18+
- Anthropic API key
# Clone the repository
git clone <repository-url>
cd agentic-patterns
# Install dependencies for a specific pattern
cd <pattern-directory>
npm installNavigate to any pattern directory and follow its README for specific instructions. Most patterns can be run with:
npm run devagentic-patterns/
├── prompt-chaining/ # Sequential LLM pipeline
├── parallelization/ # Concurrent task execution
├── routing/ # Request classification and routing
├── otel-orchestrator-project/ # Orchestrator-worker with telemetry
├── evaluator-optimizer/ # Iterative refinement workflow
├── shared/ # Common utilities (Anthropic client, types)
└── README.md # This file
The shared/ directory contains reusable components:
- anthropic-client.ts - Wrapper for Anthropic SDK
- types.ts - Common TypeScript type definitions
MIT License - see LICENSE file for details