FareedKhan-dev/all-agentic-architectures
소개
프로덕션 수준의 에이전트형 AI 아키텍처 35가지(Reflexion, LATS, GraphRAG, MemGPT, Voyager, BrowserAgent 등)를 담은 Python 라이브러리이자 실행 가능한 교재입니다. 여러 LLM 제공업체를 지원하며 17개 작업으로 구성된 벤치마크 리더보드를 제공합니다.
AI 및 머신러닝측정된 스타 증가
- in 24h
- 0
- in 7 days
- +9
- in 15 days
- +15
- in 1 month
- +123
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalAgentic Architectures
Thirty-six production-grade agentic AI patterns. End to end.
A library and a living textbook — real LLM outputs, provider-agnostic, deterministic-picker discipline throughout, and a comparative benchmark leaderboard that ranks every architecture against every relevant task.
36ARCHITECTURES |
283PASSING TESTS |
17BENCHMARK TASKS |
9LLM PROVIDERS |
0MOCKED RUNS |
Overview
A single Python library that packages every major agentic AI pattern from the literature as a runnable Architecture class with a uniform contract. Each pattern ships with a fully executed Jupyter notebook whose theory is written against the captured run, not synthetic examples. The library is multi-provider (Nebius, OpenAI, Anthropic, DeepSeek, Groq, Ollama, Together, Fireworks, Mistral, Google, OpenRouter) and built on top of LangGraph state machines.
The central technical discipline of the repository is the deterministic-picker pattern — every LLM-as-Scorer surface has the LLM commit to categorical features (booleans, enums) and lets Python compose the deciding signal. This is the universal escape from the LLM-as-Scorer flat-band pathology, applied in 13 of 36 architectures; 9 more are architecturally immune by design.
Quickstart
pip install "agentic-architectures[nebius,mcp]"
from agentic_architectures import get_llm
from agentic_architectures.architectures import Reflection
arch = Reflection(llm=get_llm(), max_iterations=2, target_score=8)
result = arch.run("Write a haiku about a glacier.")
print(result.output)
print("score:", result.metadata["final_score"], "/ 10")
Same .run(task) interface across all 36 architectures. Same ArchitectureResult return shape. Swap the class, swap the pattern: your downstream code does not change.
Web search needs no key: SEARCH_BACKEND=mcp in .env searches through Parallel's free MCP server (or set a Tavily key). With no API key at all, run everything locally with Ollama: ollama pull qwen3:8b and ollama pull nomic-embed-text, then LLM_PROVIDER=ollama.
Set up a virtualenv from a fresh clone
git clone https://github.com/FareedKhan-dev/all-agentic-architectures
cd all-agentic-architectures
python -m venv .venv
.venv\Scripts\activate # Windows
source .venv/bin/activate # macOS / Linux
pip install -e ".[dev,test,docs,nebius,mcp,tavily,faiss,networkx]"
cp .env.example .env # then fill in NEBIUS_API_KEY etc.
pytest -q # 310 tests pass in a few seconds
Architecture families
The 36 architectures
Reasoning & Reflection
| Architecture | Pattern | Reference |
|---|---|---|
| Reflection | Generate → critique → refine | Madaan 2023 |
| Reflexion | Verbal reflections in episodic memory | Shinn 2023 |
| Chain-of-Verification (CoVe) | Verify each baseline claim independently | Dhuliawala 2023 |
| Self-Discover | SELECT → ADAPT → IMPLEMENT → SOLVE | Zhou 2024 |
| Constitutional AI | Per-rule pass/fail → revise | Bai 2022 |
Sampling & Search
| Architecture | Pattern | Reference |
|---|---|---|
| Self-Consistency | Sample N paths, majority-vote | Wang 2022 |
| Tree of Thoughts | Beam search over thoughts | Yao 2023 |
| LATS | MCTS tree with reward backup | Zhou 2024 |
| Mental Loop | Simulate → score (deterministic-picker) | this repo |
| Ensemble | N voters, weighted aggregation | this repo |
Retrieval (RAG)
| Architecture | Pattern | Reference |
|---|---|---|
| Agentic RAG | Agent decides when & what to retrieve | LangGraph reference |
| Corrective RAG (CRAG) | Grade docs, fall back to web | Yan 2024 |
| Self-RAG | Per-doc reflection tokens | Asai 2024 |
| Adaptive RAG | Pre-route by query complexity | Jeong 2024 |
| GraphRAG | KG + community summaries | Microsoft 2024 |
Memory
| Architecture | Stored unit | Reference |
|---|---|---|
| Episodic + Semantic | Conversation turns + triples | Park 2023 |
| Graph Memory | (subject, predicate, object) triples | this repo |
| MemGPT | OS-style context + archival tiers | Packer 2023 |
| Voyager | Reusable Python skills (real subprocess) | Wang 2023 |
| Agent Workflow Memory | High-level workflow recipes | Wang 2024 |
Tools & Actions
| Architecture | Pattern | Reference |
|---|---|---|
| Tool Use | Agent with one tool | LangChain reference |
| ReAct | Thought → Action → Observation | Yao 2022 |
| Planning | Decompose → execute → replan | Wei 2022 |
| Plan-Execute-Verify (PEV) | Post-execution verification per step | this repo |
| SWE-Agent | Sandboxed file-system agent | Yang 2024 |
| BrowserAgent | Real Playwright + safety gate | Anthropic Computer-Use 2024 |
Multi-Agent
| Architecture | Pattern | Reference |
|---|---|---|
| Multi-Agent | Supervisor + specialists | LangGraph reference |
| Blackboard | Shared workspace + agents | classical AI |
| Debate | N agents × K rounds | Du 2023 |
| STORM | Multi-perspective research → article | Shao 2024 |
| Meta-Controller | Router over architectures | this repo |
| Mixture of Agents | Layers of proposers, each refining the last, then an aggregator | Wang 2024 |
Safety, Routing & Specialty
| Architecture | Pattern | Reference |
|---|---|---|
| Dry-Run | Propose → simulate → approval gate | this repo |
| Reflexive Metacognitive | Self-aware capability routing | this repo |
| RLHF Self-Improvement | Multi-dim deterministic scoring + archive | this repo |
| Cellular Automata | LLM rules over a grid | this repo |
Provider compatibility
| Provider | Install extra | Notes |
|---|---|---|
| Nebius (default) | [nebius] | Nemotron 3.5 Lightning by default; cheapest for the included demos |
| OpenAI | [openai] | All architectures work; highest quality for reasoning patterns |
| Anthropic | [anthropic] | Strong on long context; required for production Computer-Use |
| DeepSeek | [deepseek] | Through langchain-deepseek; deepseek-flash by default |
| Groq | [groq] | Fast inference; great for high-volume Self-Consistency |
| Ollama (local) | [ollama] | No API key; qwen3:8b by default, every architecture verified end to end on qwen3 |
| Together | [together] | Wide model catalogue |
| Fireworks | [fireworks] | Function-calling first-class |
| Mistral | [mistral] | EU-hosted option |
[google] | Gemini 3.5 Flash-Lite by default, free tier | |
| OpenRouter | [openrouter] | One key for hundreds of models (MiniMax, Qwen, DeepSeek, ...) |
Switch via LLM_PROVIDER + the corresponding key in .env. No code changes. Leave LLM_MODEL empty for each provider's recommended model; the provider guide lists them, checked against each provider's deprecation pages in November 2026, and how to point the openai provider at any OpenAI-compatible server.
Benchmarks
A 17-task suite runs every architecture and scores results. Most recent run (May 2026), real Nebius Llama-3.3-70B, ~25 min, ~$1.50 in tokens:
| Outcome | Architectures |
|---|---|
| Strong 2/2 or 3/3 | Reflection SelfConsistency SelfDiscover BrowserAgent |
| Perfect on attempted 1/1 | 21 more — see leaderboard |
| Pattern-fit failures | LATS on arithmetic (wrong shape) · Debate + Ensemble on Sally trick (group-think) · Reflexion + AWM on raw-fact recall (wrong memory shape) |
| Overall | 33 / 42 correct 78% |
Full leaderboard with per-task answer excerpts: docs/benchmarks.md
Learning paths
Four curated reading orders, depending on what you're trying to do.
| Path | For | Order |
|---|---|---|
| Beginner | Mental model | Reflection → Tool Use → ReAct → Planning → Self-Consistency |
| RAG-focused | Production retrieval | Agentic RAG → CRAG → Self-RAG → Adaptive RAG → GraphRAG |
| Multi-agent | Coordination | Multi-Agent → Blackboard → Debate → STORM → Meta-Controller → Mixture of Agents |
| Safety | Guardrails | Dry-Run → Constitutional AI → Reflexive Metacognitive → BrowserAgent (safety gate) |
Star history
Tested
pytest -q
310 passed, 38 skipped (env-gated integration) in a few seconds
| Suite | Coverage |
|---|---|
| Registry sweep | All 36 architectures (metadata + instantiate + build) |
| Pure-Python helpers | Haiku checker, composite scorers, subprocess executor, safety gate, sandbox path |
| Notebook integrity | All 36 notebooks executed, no error outputs, §9 commentary tailored from real captured runs |
| Integration (env-gated) | One real-LLM happy-path per architecture, gated via RUN_INTEGRATION=1. For 1.0.0 all 38 ran on LangChain 1.5 and LangGraph 1.2 against local models through Ollama, with no API key, and every one passed on qwen3:8b, the default local model (MetaController on a rerun, after the free MCP search tier's rate limit stopped it). |
Documentation
| Full docs site | Dark-mode site with embedded notebooks (live after first deploy) |
| Quickstart | One-command install, 8-line example |
| Switching providers | Capability matrix; one env var to swap |
| Add your own architecture | 5-step contributor recipe |
| Deterministic-picker pattern | The central technical pattern, explained once |
| Memory variants | Comparison of all 7 memory shapes |
| API reference | mkdocstrings auto-gen from docstrings (live after first deploy) |
| Benchmarks | Full per-task leaderboard with answer excerpts |
Contributing
Contributions welcome. Two paths:
- Add a new architecture — follow the 5-step recipe. The PR template includes a deterministic-picker checklist.
- Improve an existing one — bug fix, prompt tuning, performance, scoring rubric. Open an issue first to discuss scope.
See CONTRIBUTING.md for the dev setup, code style, and commit-message convention (Conventional Commits; release-please auto-generates the CHANGELOG).
Community
- Chinese translation of the course by @wxt2rr (of an earlier version of the notebooks, #3).
- Agentic Architectures Arena, a live dashboard that runs every pattern, built for this video walkthrough by @theaiautomators (#19).
Citation
@misc{khan2026agentic,
title = {Agentic Architectures: A Library of 36 Production-Grade Agentic AI Patterns},
author = {Khan, Fareed},
year = {2026},
howpublished = {\url{https://github.com/FareedKhan-dev/all-agentic-architectures}},
note = {MIT licensed Python library and runnable textbook}
}
License
MIT — © 2026 Fareed Khan.
관련 프로젝트 살펴보기
불러오는 중…