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-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 NEW
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
- Inference-Healed Code Review Reward UPDATED
- Iterative Prompt & Skill Refinement NEW
- 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) UPDATED
- Compounding Engineering Pattern UPDATED
- Memory Reinforcement Learning (MemRL) NEW
- Skill Library Evolution UPDATED
- Variance-Based RL Sample Selection UPDATED
Orchestration & Control
- Action-Selector Pattern UPDATED
- Agent-Driven Research UPDATED
- Autonomous Workflow Agent Architecture UPDATED
- Conditional Parallel Tool Execution UPDATED
- Continuous Autonomous Task Loop Pattern UPDATED
- Discrete Phase Separation UPDATED
- Disposable Scaffolding Over Durable Features UPDATED
- Distributed Execution with Cloud Workers UPDATED
- Dual LLM Pattern UPDATED
- Explicit Posterior-Sampling Planner UPDATED
- Feature List as Immutable Contract UPDATED
- Hybrid LLM/Code Workflow Coordinator NEW
- Inference-Time Scaling UPDATED
- Initializer-Maintainer Dual Agent Architecture UPDATED
- Inversion of Control UPDATED
- Iterative Multi-Agent Brainstorming UPDATED
- Language Agent Tree Search (LATS) UPDATED
- LLM Map-Reduce Pattern UPDATED
- Multi-Model Orchestration for Complex Edits UPDATED
- Opponent Processor / Multi-Agent Debate Pattern UPDATED
- Oracle and Worker Multi-Model Approach UPDATED
- Parallel Tool Call Learning UPDATED
- Plan-Then-Execute Pattern UPDATED
- Progressive Autonomy with Model Evolution UPDATED
- Progressive Complexity Escalation UPDATED
- Self-Rewriting Meta-Prompt Loop UPDATED
- Specification-Driven Agent Development UPDATED
- Stop Hook Auto-Continue Pattern UPDATED
- Sub-Agent Spawning UPDATED
- Swarm Migration Pattern UPDATED
- Three-Stage Perception Architecture UPDATED
- Tool Capability Compartmentalization UPDATED
- Tree-of-Thought Reasoning UPDATED
Reliability & Eval
- Anti-Reward-Hacking Grader Design UPDATED
- Asynchronous Coding Agent Pipeline UPDATED
- CriticGPT-Style Code Review UPDATED
- Extended Coherence Work Sessions UPDATED
- Lethal Trifecta Threat Model UPDATED
- LLM Observability NEW
- Merged Code + Language Skill Model UPDATED
- No-Token-Limit Magic UPDATED
- RLAIF (Reinforcement Learning from AI Feedback) UPDATED
- Structured Output Specification UPDATED
- Versioned Constitution Governance UPDATED
- Workflow Evals with Mocked Tools NEW
Security & Safety
- Deterministic Security Scanning Build Loop UPDATED
- Isolated VM per RL Rollout UPDATED
- PII Tokenization UPDATED
Tool Use & Environment
- Agent SDK for Programmatic Control UPDATED
- Agent-First Tooling and Logging UPDATED
- Agentic Search Over Vector Embeddings UPDATED
- 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 UPDATED
- Dynamic Code Injection (On-Demand File Fetch) UPDATED
- Egress Lockdown (No-Exfiltration Channel) UPDATED
- LLM-Friendly API Design UPDATED
- Multi-Platform Communication Aggregation UPDATED
- Multi-Platform Webhook Triggers NEW
- 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 UPDATED
- Democratization of Tooling via Agents UPDATED
- Human-in-the-Loop Approval Framework UPDATED
- Latent Demand Product Discovery UPDATED
- Proactive Trigger Vocabulary UPDATED
- Seamless Background-to-Foreground Handoff UPDATED
- Spectrum of Control / Blended Initiative UPDATED
- Team-Shared Agent Configuration as Code UPDATED
- 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.
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.