Haozhe-Xing/agent_learning
概要
LLMエージェント、RAG、ツール利用、メモリシステム、マルチエージェントシステム、LangChain、LangGraph、MCP、エージェント型強化学習を網羅した、体系的で包括的な実践重視のAIエージェント開発チュートリアルです。AIエージェント開発をゼロから学べるほか、arXivの最新論文を毎日自動で追跡します。
学習・教育計測したスター増加
- 24時間
- +1
- 7日間
- +15
- 15日間
- +149
- 1か月
- +187
期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。
README.md
オリジナルLearn AI Agents from Scratch
A visual, bilingual, and engineering-first textbook for building reliable LLM Agents.
From Function Calling, memory, planning, RAG, and context engineering to Agentic RL, multi-agent systems, evaluation, security, and production deployment.
Try the Function Calling demo · Step through a weather lookup and see how the result triggers an email reminder. Run an offline task
中文说明 · Complete directory · Runnable reference agent · Contributing
Run a task that survives a restart
With Git, Python 3 and a Bash shell, run this example from a fresh clone. It records a report locally in SQLite. Each command starts a new process. Python’s standard library handles the entire exercise, so you can run it offline after cloning without an API key.
git clone https://github.com/Haozhe-Xing/agent_learning.git
cd agent_learning
db="$(mktemp)"
python3 examples/chapter08/resumable_task.py start --db "$db"
python3 examples/chapter08/resumable_task.py approve --db "$db"
python3 examples/chapter08/resumable_task.py run --db "$db" --stop-after-apply
python3 examples/chapter08/resumable_task.py run --db "$db"
report-001: proposed
report-001: approved
report-001: applied
report-001: verified
At applied, the first run has saved the report. The next process reads its checkpoint and verifies the existing report. See how the checkpoint works in §8.7
What is this repository?
agent_learning is an open-source AI Agent textbook and learning repository. It is designed for the gap between "I can call an LLM API" and "I can build, evaluate, secure, and deploy an Agent system."
Instead of teaching isolated framework APIs, the book builds one connected mental model:
LLM fundamentals → tools → memory → planning → RAG → context → harness → skills → Agentic RL → multi-agent → evaluation → security → deployment
The repository includes:
- 26 chapters across foundations, core capabilities, frameworks, multi-agent systems, production, and capstone projects.
- English and Chinese editions with matching tables of contents.
- 330+ original SVG diagrams and 5 interactive demos for architecture, state, sequence, and training flows.
- Paper-to-practice explanations covering ReAct, Reflexion, MemGPT/Letta, GraphRAG, GRPO, MCP, A2A, and more.
reference-agent/, a small runnable Agent baseline with tool calling, input checks, evaluation, an MCP server, a FastAPI service, and offline tests.
This is not an awesome-list and not a framework manual. It is a structured path from first principles to production engineering.
Complete directory
- Book source
src/en/— English mdBook sourcesrc/zh/— Chinese mdBook sourcesrc/en/SUMMARY.md— English table of contentssrc/zh/SUMMARY.md— Chinese table of contents
- Foundations
- Core capabilities
- Framework practice
- Multi-agent systems
- Production engineering
- Capstone projects
- Appendices
- Runnable implementation
reference-agent/— teaching baseline Agent implementationreference-agent/src/reference_agent/— Agent loop, providers, tools, security, server, evaluationreference-agent/tests/— offline test suite
- Assets and build files
src/en/svg/— English diagramssrc/zh/svg/— Chinese diagramssrc/en/animations/— English interactive demossrc/zh/animations/— Chinese interactive demostheme/— shared mdBook themebook.toml— Chinese mdBook configbook-en.toml— English mdBook configserve.sh— build and serve both books locally
Runnable reference agent
reference-agent/ is the shared, dependency-light implementation behind the hands-on chapters. It includes:
- a minimal ReAct loop and tool registry;
- offline
FakeProviderand optional OpenAI provider; - per-run message history and input validation;
- an MCP server, a FastAPI endpoint that replays a completed answer in SSE chunks, an evaluation harness, and a Dockerfile;
- Offline tests that run without an API key.
cd reference-agent
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
pytest -q
The implementation is intentionally small enough to read. It is a teaching baseline, not a claim of production completeness.
Feel free to contact the author on WeChat.

Project principles
- Mechanisms before frameworks. Explain why an abstraction exists before teaching its API.
- Visuals must teach. Diagrams carry architecture and process information; they are not decoration.
- Research must lead to engineering insight. Paper notes include contribution, mechanism, use, and limitations.
- Production claims must be honest. Runnable code, tests, security boundaries, and known limitations are stated explicitly.
- Bilingual content stays aligned. Text, diagrams, navigation, and interactive demos are maintained in both languages.
Contributing
Corrections, clearer explanations, runnable examples, translation fixes, and new paper notes are welcome.
- Found an error? Open an issue.
- Want to improve a chapter? Edit the matching file under both
src/en/andsrc/zh/when possible. - Adding a page? Update both
SUMMARY.mdfiles. - Adding a diagram? Place localized assets under
src/en/svg/andsrc/zh/svg/. - Before a PR, run
./serve.shand verify both language builds.
Please keep claims verifiable and prefer primary sources for papers, protocols, versions, and external projects.
Roadmap
- 26-chapter bilingual mdBook
- Localized diagrams and interactive demos
- Agentic RL, context engineering, harness engineering, and self-evolving Agent coverage
- Runnable
reference-agentbaseline with offline tests - More end-to-end capstone implementations
- Searchable diagram gallery and concept index
- Evaluation and observability starter templates
- More exercises, interview questions, and regression cases
Suggestions are welcome in Issues.
License
Released under the MIT License.
If this repository saves you time, consider giving it a Star.
A Star helps more engineers find a structured path through AI Agents instead of another disconnected list of links.
関連プロジェクトを探す
読み込み中…