# AI Agentic Architectures 35 agentic AI architectures to learn from. The 35 agentic design patterns are production-grade architectures categorized into eight families: **Reasoning & Reflection, Sampling & Search, Retrieval (RAG), Memory, Tools & Actions, Multi-Agent, Safety & Routing, and Specialty**. These patterns are designed as "workflow shapes" - graphs of nodes where control flows, often utilizing loops where an agent acts, checks results, and iterates until a task is complete. Below is a comprehensive list of the 35 patterns, organized by family, with descriptions and links to their example implementations (Jupyter notebooks). ## FareedKhan - [FareedKhan GitHub Repository](https://github.com/FareedKhan-dev/all-agentic-architectures) - [Interactive Website](https://fareedkhan-dev.github.io/all-agentic-architectures/) ## Analysis - [Learn Every AI Agent Pattern From One Video](https://youtu.be/PZsJfBVDZZc?si=MBtAP_aUk8J4AfTB) - Great video by [Theaiautomators](https://www.youtube.com/@TheAIAutomators) that actually runs all 35 patterns and explains them with examples via repository code below - [Theaiautomators GitHub Repository](https://github.com/theaiautomators/agentic-architectures) - this repo is a teaching harness around that excellent library (see How this uses the base repo) --- # Patterns ### 1. Reasoning & Reflection These patterns use self-critique loops to iterate on and improve answer quality. - **[Reflection](https://github.com/FareedKhan-dev/all-agentic-architectures/blob/main/notebooks/01_reflection.ipynb)**: A producer drafts an answer, and a critic scores/critiques it; the agent then refines the output until it meets a target score. - **[Reflexion](https://github.com/FareedKhan-dev/all-agentic-architectures/blob/main/notebooks/18_reflexion.ipynb)**: Attempts a task, evaluates the answer, and stores a "verbal lesson" in episodic memory to inform future retries. - **[Chain-of-Verification (CoVe)](https://github.com/FareedKhan-dev/all-agentic-architectures/blob/main/notebooks/20_chain_of_verification.ipynb)**: Drafts a baseline answer, generates independent verification questions for each claim, and rewrites the final response based only on verified facts. - **[Self-Discover](https://github.com/FareedKhan-dev/all-agentic-architectures/blob/main/notebooks/19_self_discover.ipynb)**: Composes a custom reasoning "recipe" by selecting thinking modules (e.g., critical thinking, analogies) and adapting them to solve novel problems. - **[Constitutional AI](https://github.com/FareedKhan-dev/all-agentic-architectures/blob/main/notebooks/32_constitutional_ai.ipynb)**: Checks a draft against a list of explicit rules (a "constitution"); each rule receives a pass/fail pass, followed by revisions to fix failures. ### 2. Sampling & Search These patterns generate multiple candidates to find the best possible answer through search or voting. - **[Self-Consistency](https://github.com/FareedKhan-dev/all-agentic-architectures/blob/main/notebooks/21_self_consistency.ipynb)**: Generates multiple reasoning paths for the same question and uses a majority vote on the final answer. - **[Tree of Thoughts](https://github.com/FareedKhan-dev/all-agentic-architectures/blob/main/notebooks/09_tree_of_thoughts.ipynb)**: Conducts a beam search over reasoning steps; an evaluator scores thoughts to prune the search tree. - **[LATS (Language Agent Tree Search)](https://github.com/FareedKhan-dev/all-agentic-architectures/blob/main/notebooks/22_lats.ipynb)**: Implements Monte Carlo Tree Search (MCTS) over reasoning moves, using a rubric to judge progress and propagate rewards back up the tree. - **[Mental Loop](https://github.com/FareedKhan-dev/all-agentic-architectures/blob/main/notebooks/10_mental_loop.ipynb)**: Simulates and scores distinct candidate actions before choosing the best one to execute. - **[Ensemble](https://github.com/FareedKhan-dev/all-agentic-architectures/blob/main/notebooks/13_ensemble.ipynb)**: Uses multiple independent "voters" (e.g., analytical, skeptical, pragmatic) and selects a final answer through weighted aggregation. ### 3. Retrieval (RAG) These patterns focus on grounding agent responses in external knowledge bases. - **[Agentic RAG](https://github.com/FareedKhan-dev/all-agentic-architectures/blob/main/notebooks/23_agentic_rag)**: The agent decides when and what to retrieve, potentially calling tools multiple times to flesh out knowledge. - **[Corrective RAG (CRAG)](https://github.com/FareedKhan-dev/all-agentic-architectures/blob/main/notebooks/24_corrective_rag.ipynb)**: Grades retrieved documents and discards irrelevant chunks; it can trigger a web search if the internal knowledge is insufficient. - **[Self-RAG](https://github.com/FareedKhan-dev/all-agentic-architectures/blob/main/notebooks/25_self_rag.ipynb)**: Emits "reflection tokens" to assess if retrieved passages are relevant, supported, or useful before answering. - **[Adaptive RAG](https://github.com/FareedKhan-dev/all-agentic-architectures/blob/main/notebooks/26_adaptive_rag.ipynb)**: Classifies incoming queries to decide if retrieval is needed and determines whether to use simple or complex retrieval tracks. - **[GraphRAG](https://github.com/FareedKhan-dev/all-agentic-architectures/blob/main/notebooks/27_graph_rag.ipynb)**: Builds a Knowledge Graph (KG) of entities and relationships; it answers global questions by summarizing "communities" of related entities. ### 4. Memory These patterns define different storage shapes to allow agents to remember context across sessions. - **[Episodic + Semantic](https://github.com/FareedKhan-dev/all-agentic-architectures/blob/main/notebooks/08_episodic_semantic_memory.ipynb)**: Saves conversational turns (episodic) while extracting and storing specific facts into a Knowledge Graph (semantic). - **[Graph Memory](https://github.com/FareedKhan-dev/all-agentic-architectures/blob/main/notebooks/12_graph_memory.ipynb)**: Stores knowledge as triples (subject, predicate, object) for fact-based retrieval. - **[MemGPT](https://github.com/FareedKhan-dev/all-agentic-architectures/blob/main/notebooks/31_memgpt.ipynb)**: Uses an OS-style "virtual memory" approach, paging facts in and out of the context window from an archival storage tier. - **[Voyager](https://github.com/FareedKhan-dev/all-agentic-architectures/blob/main/notebooks/29_voyager.ipynb)**: Discovers and saves reusable Python skills as real scripts in a library for later execution. - **[Agent Workflow Memory (AWM)](https://github.com/FareedKhan-dev/all-agentic-architectures/blob/main/notebooks/35_agent_workflow_memory.ipynb)**: Mines successful multi-step task completions to create "workflow recipes" that guide future similar tasks. ### 5. Tools & Actions These patterns enable agents to interact with environments, from single tools to web browsers. - **[Tool Use](https://github.com/FareedKhan-dev/all-agentic-architectures/blob/main/notebooks/02_tool_use.ipynb)**: The most basic loop where an agent identifies a task, calls a tool, and synthesizes the result. - **[ReAct](https://github.com/FareedKhan-dev/all-agentic-architectures/blob/main/notebooks/03_react.ipynb)**: Combines explicit reasoning ("Thought") with actions ("Act") and results ("Observation") in a continuous cycle. - **[Planning](https://github.com/FareedKhan-dev/all-agentic-architectures/blob/main/notebooks/04_planning.ipynb)**: Decomposes a goal into a stepped plan, executes steps, and has the ability to "re-plan" if results change the situation. - **[Plan-Execute-Verify (PEV)](https://github.com/FareedKhan-dev/all-agentic-architectures/blob/main/notebooks/06_pev.ipynb)**: Adds an impartial evaluator agent to judge if the output of an execution step meets specific rubric criteria. - **[SWE-Agent](https://github.com/FareedKhan-dev/all-agentic-architectures/blob/main/notebooks/33_swe_agent.ipynb)**: A coding-specific agent that interacts with a sandboxed file system to list, read, and write files. - **[BrowserAgent](https://github.com/FareedKhan-dev/all-agentic-architectures/blob/main/notebooks/34_computer_use.ipynb)**: Uses a real Playwright-driven browser to navigate websites and interact with page elements. ### 6. Multi-Agent These patterns orchestrate collaboration between multiple specialized agents. - **[Multi-Agent](https://github.com/FareedKhan-dev/all-agentic-architectures/blob/main/notebooks/05_multi_agent.ipynb)**: A supervisor agent routes sub-tasks to specialists, each with their own tools and personas, and then consolidates their work. - **[Blackboard](https://github.com/FareedKhan-dev/all-agentic-architectures/blob/main/notebooks/07_blackboard.ipynb)**: Specialists "bid" on their ability to contribute to a shared workspace; a synthesis agent eventually merges the board into a final answer. - **[Debate](https://github.com/FareedKhan-dev/all-agentic-architectures/blob/main/notebooks/28_debate.ipynb)**: Multiple agents answer independently and then read and argue against each other's positions for several rounds. - **[STORM](https://github.com/FareedKhan-dev/all-agentic-architectures/blob/main/notebooks/30_storm.ipynb)**: A multi-perspective research system that spawns personas to interview a topic and generate a structured article. - **[Meta-Controller](https://github.com/FareedKhan-dev/all-agentic-architectures/blob/main/notebooks/11_meta_controller.ipynb)**: A high-level router that chooses the most appropriate architecture (e.g., Planning vs. Reflection) for a given task. ### 7. Safety, Routing & Specialty These focus on specialized behaviors like security gates and self-improvement. - **[Dry-Run](https://github.com/FareedKhan-dev/all-agentic-architectures/blob/main/notebooks/14_dry_run.ipynb)**: An agent proposes an action, a simulator predicts its effects, and a reviewer must approve it before execution. - **[Reflexive Metacognitive](https://github.com/FareedKhan-dev/all-agentic-architectures/blob/main/notebooks/17_reflexive_metacognitive.ipynb)**: An agent assesses its own competence before answering, choosing to hedge with caveats or escalate to a human. - **[RLHF Self-Improvement](https://github.com/FareedKhan-dev/all-agentic-architectures/blob/main/notebooks/15_rlhf_self_improvement.ipynb)**: Scores candidates against detailed dimensions (e.g., "avoids cliches") using deterministic rubrics and iterates until a threshold is met. - **[Cellular Automata](https://github.com/FareedKhan-dev/all-agentic-architectures/blob/main/notebooks/16_cellular_automata.ipynb)**: An LLM applies rules to nodes across a grid to simulate complex emergent behavior. - **[Computer Use (Mock)](https://github.com/FareedKhan-dev/all-agentic-architectures/blob/main/notebooks/34_computer_use.ipynb)**: Drives a simulated GUI through a safety gate to evaluate if actions like navigating to a site are secure.