Awesome Agentic Patterns

A curated catalogue of agentic AI patterns — real‑world tricks, workflows, and mini‑architectures that help autonomous or semi‑autonomous AI agents get useful work done in production.
Why? Tutorials show toy demos. Real products hide the messy bits. This list surfaces the repeatable patterns that bridge the gap so we can all ship smarter, faster agents.
What counts as a pattern?
- Repeatable – more than one team is using it.
- Agent‑centric – improves how an AI agent senses, reasons, or acts.
- Traceable – backed by a public reference: blog post, talk, repo, or paper.
If your link ticks those boxes, it belongs here.
Quick Tour of Categories
| Category | What you'll find |
|---|---|
| Context & Memory | Sliding‑window curation, vector cache, episodic memory |
| Feedback Loops | Compilers, CI, human review, self‑healing retries |
| Learning & Adaptation | Agent RFT, skill libraries, variance‑based RL |
| Orchestration & Control | Task decomposition, sub‑agent spawning, tool routing |
| Reliability & Eval | Guardrails, eval harnesses, logging, reproducibility |
| Security & Safety | Isolated VMs, PII tokenization, security scanning |
| Tool Use & Environment | Shell, browser, DB, Playwright, sandbox tricks |
| UX & Collaboration | Prompt hand‑offs, staged commits, async background agents |
Categories are fluid — open a PR if you see a better slice!
The tables below are auto‑generated from the patterns/ folder.
Context & Memory
- Agent-Powered Codebase Q&A / Onboarding UPDATED
- Context Window Anxiety Management UPDATED
- Context Window Auto-Compaction
- Context-Minimization Pattern UPDATED
- Curated Code Context Window UPDATED
- Curated File Context Window UPDATED
- Dynamic Context Injection UPDATED
- Episodic Memory Retrieval & Injection UPDATED
- Filesystem-Based Agent State UPDATED
- Layered Configuration Context UPDATED
- Memory Synthesis from Execution Logs UPDATED
- Proactive Agent State Externalization UPDATED
- Progressive Disclosure for Large Files
- Prompt Caching via Exact Prefix Preservation
- Self-Identity Accumulation UPDATED
- Semantic Context Filtering Pattern
- Working Memory via TodoWrite
Feedback Loops
- AI-Assisted Code Review / Verification UPDATED
- Background Agent with CI Feedback UPDATED
- Coding Agent CI Feedback Loop UPDATED
- Dogfooding with Rapid Iteration for Agent Improvement UPDATED
- Graph of Thoughts (GoT) UPDATED
- Incident-to-Eval Synthesis NEW
- Inference-Healed Code Review Reward UPDATED
- Iterative Prompt & Skill Refinement
- Reflection Loop UPDATED
- Rich Feedback Loops > Perfect Prompts UPDATED
- Self-Critique Evaluator Loop UPDATED
- Self-Discover: LLM Self-Composed Reasoning Structures UPDATED
- Spec-As-Test Feedback Loop UPDATED
- Tool Use Incentivization via Reward Shaping UPDATED
Learning & Adaptation
- Agent Reinforcement Fine-Tuning (Agent RFT)
- Compounding Engineering Pattern
- Frontier-Focused Development
- Memory Reinforcement Learning (MemRL)
- Shipping as Research
- Skill Library Evolution
- Variance-Based RL Sample Selection
Orchestration & Control
- Action-Selector Pattern UPDATED
- Agent Modes by Model Personality
- Agent-Driven Research UPDATED
- Autonomous Workflow Agent Architecture
- Budget-Aware Model Routing with Hard Cost Caps NEW
- Burn the Boats
- Conditional Parallel Tool Execution UPDATED
- Continuous Autonomous Task Loop Pattern UPDATED
- Custom Sandboxed Background Agent
- Discrete Phase Separation
- Disposable Scaffolding Over Durable Features UPDATED
- Distributed Execution with Cloud Workers
- Dual LLM Pattern UPDATED
- Explicit Posterior-Sampling Planner UPDATED
- Factory over Assistant
- Feature List as Immutable Contract
- Hybrid LLM/Code Workflow Coordinator
- Inference-Time Scaling UPDATED
- Initializer-Maintainer Dual Agent Architecture
- Inversion of Control UPDATED
- Iterative Multi-Agent Brainstorming UPDATED
- Lane-Based Execution Queueing
- Language Agent Tree Search (LATS) UPDATED
- LLM Map-Reduce Pattern UPDATED
- Multi-Model Orchestration for Complex Edits UPDATED
- Opponent Processor / Multi-Agent Debate Pattern
- Oracle and Worker Multi-Model Approach UPDATED
- Parallel Tool Call Learning
- Plan-Then-Execute Pattern UPDATED
- Planner-Worker Separation for Long-Running Agents
- Progressive Autonomy with Model Evolution UPDATED
- Progressive Complexity Escalation
- Recursive Best-of-N Delegation
- Self-Rewriting Meta-Prompt Loop UPDATED
- Specification-Driven Agent Development UPDATED
- Stop Hook Auto-Continue Pattern
- Sub-Agent Spawning
- Subject Hygiene for Task Delegation
- Swarm Migration Pattern
- Three-Stage Perception Architecture UPDATED
- Tool Capability Compartmentalization UPDATED
- Tool Selection Guide
- Tree-of-Thought Reasoning UPDATED
- Workspace-Native Multi-Agent Orchestration NEW
Reliability & Eval
- Action Caching & Replay Pattern
- Adaptive Sandbox Fan-Out Controller
- Anti-Reward-Hacking Grader Design
- Asynchronous Coding Agent Pipeline UPDATED
- Canary Rollout and Automatic Rollback for Agent Policy Changes NEW
- CriticGPT-Style Code Review UPDATED
- Extended Coherence Work Sessions UPDATED
- Failover-Aware Model Fallback
- Lethal Trifecta Threat Model UPDATED
- LLM Observability
- Merged Code + Language Skill Model UPDATED
- No-Token-Limit Magic UPDATED
- Reliability Problem Map Checklist for RAG and Agents NEW
- RLAIF (Reinforcement Learning from AI Feedback) UPDATED
- Schema Validation Retry with Cross-Step Learning
- Structured Output Specification
- Versioned Constitution Governance UPDATED
- Workflow Evals with Mocked Tools
Security & Safety
- Deterministic Security Scanning Build Loop UPDATED
- External Credential Sync
- Hook-Based Safety Guard Rails for Autonomous Code Agents UPDATED
- Isolated VM per RL Rollout
- Non-Custodial Spending Controls NEW
- PII Tokenization UPDATED
- Sandboxed Tool Authorization
- Soulbound Identity Verification NEW
- Zero-Trust Agent Mesh NEW
Tool Use & Environment
- Agent SDK for Programmatic Control UPDATED
- Agent-First Tooling and Logging UPDATED
- Agentic Search Over Vector Embeddings
- AI Web Search Agent Loop
- CLI-First Skill Design UPDATED
- CLI-Native Agent Orchestration UPDATED
- Code Mode MCP Tool Interface Improvement Pattern UPDATED
- Code-Over-API Pattern UPDATED
- Code-Then-Execute Pattern UPDATED
- Dual-Use Tool Design
- Dynamic Code Injection (On-Demand File Fetch) UPDATED
- Egress Lockdown (No-Exfiltration Channel) UPDATED
- Intelligent Bash Tool Execution
- LLM-Friendly API Design UPDATED
- Multi-Platform Communication Aggregation UPDATED
- Multi-Platform Webhook Triggers
- Patch Steering via Prompted Tool Selection UPDATED
- Progressive Tool Discovery UPDATED
- Shell Command Contextualization UPDATED
- Subagent Compilation Checker UPDATED
- Tool Use Steering via Prompting UPDATED
- Virtual Machine Operator Agent UPDATED
- Visual AI Multimodal Integration UPDATED
UX & Collaboration
- Abstracted Code Representation for Review UPDATED
- Agent-Assisted Scaffolding UPDATED
- Agent-Friendly Workflow Design UPDATED
- AI-Accelerated Learning and Skill Development UPDATED
- Chain-of-Thought Monitoring & Interruption
- Codebase Optimization for Agents
- Democratization of Tooling via Agents UPDATED
- Dev Tooling Assumptions Reset
- Human-in-the-Loop Approval Framework
- Latent Demand Product Discovery
- Milestone Escrow for Agent Resource Funding NEW
- Proactive Trigger Vocabulary UPDATED
- Seamless Background-to-Foreground Handoff UPDATED
- Spectrum of Control / Blended Initiative UPDATED
- Team-Shared Agent Configuration as Code
- Verbose Reasoning Transparency UPDATED
Contributing in 3 steps
- Fork & branch →
git checkout -b add-my-pattern - Add a pattern file under
patterns/using the template above. - Open a PR titled
Add: my-pattern-name— the README & site will regenerate automatically. - This repository is pattern-first: proposals that are primarily product announcements or promotions will be rejected, even if technically valid.
See CONTRIBUTING.md for the fine print.
Inspiration
This project started after the write‑up "What Sourcegraph learned building AI coding agents" (28 May 2025) and the ongoing Raising an Agent video diary. Many first patterns come straight from those lessons — thanks to everyone sharing their journey in the open!
License
Apache‑2.0. See LICENSE.