# didilili/ai-agents-from-zero architecture

> Architecture diagram of the GitHub repository didilili/ai-agents-from-zero, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-05-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/didilili/ai-agents-from-zero
- Repository: https://github.com/didilili/ai-agents-from-zero

## Overview

1. **Repository shape: a documentation-first knowledge base**
   - This repo is primarily a **Chinese AI agent tutorial site**, not a single application.
   - Its core assets are **Markdown lessons**, **worked examples**, **project walk-throughs**, **images**, and a **static site shell** for publishing and reading online.

2. **Two main content domains**
   - The top-level numbered Markdown files (`1-1...md` through `27...md`) form the **concept and framework curriculum**: LLM basics, prompt engineering, RAG, LangChain, LangGraph, MCP, Agents, deployment, and related engineering topics.
   - The subdirectories under **`案例与源码-*`** and **`实战项目-*`** contain **hands-on case studies** and **end-to-end project materials**.

3. **Static site / documentation delivery layer**
   - `index.html`, `_sidebar.md`, `.nojekyll`, `sitemap.xml`, and `lib/plugins/*` indicate a **static documentation site** built for browser reading and likely hosted on GitHub Pages.
   - The site shell is responsible for navigation, rendering Markdown, and optional enhancements such as analytics and Mermaid diagram viewing.

4. **Learning content boundary**
   - The repo separates **concept explanations** from **project execution paths**:
     - Concept chapters explain the framework and theory.
     - Case-study directories provide concrete artifacts like workflow definitions, sample data, screenshots, and runnable code snippets.
   - This separation makes the repo usable both as a **study guide** and as a **reference library**.

5. **Python example runtime boundary**
   - `requirements.txt` and `pyproject.toml` define the **Python execution environment** for the sample code.
   - The README’s quick start points to running examples directly from the repository root, which means the code examples depend on **root-level environment loading** via `.env`.

6. **LangChain / LangGraph example subsystem**
   - `案例与源码-2-LangChain框架` and `案例与源码-3-LangGraph框架` are the main code-example clusters.
   - They are organized by topic: model I/O, prompt templates, output parsers, LCEL, memory, tools, embeddings, RAG, MCP, agents, graph/state/edge/node design, persistence, streaming, and multi-agent coordination.
   - These folders represent the repo’s **framework architecture teaching layer**.

7. **Project-simulation subsystem**
   - `实战项目-电商问数` and `实战项目-深度研搜` are the two most complete “enterprise-style” project tracks in the repo.
   - The embedded lesson files show the intended architecture of each project:
     - **电商问数**: MySQL + metadata knowledge base + Qdrant + Elasticsearch + LangGraph + FastAPI.
     - **深度研搜**: DeepAgents-style multi-agent orchestration + network search + database querying + RAGFlow knowledge base + file generation + FastAPI/WebSocket.
   - These are described as **project blueprints and walkthroughs**; their actual runnable source lives in external repositories linked from the README.

8. **Data and artifact layer**
   - `images/` and the project-specific `images/` folders store diagrams, screenshots, and explanatory visuals used throughout the lessons.
   - Some projects also include structured artifacts:
     - `yaml/` in the e-commerce question-answering project for metadata tables and metrics.
     - Sample files in example folders (`csv`, `json`, `pdf`, `docx`, `txt`, `xlsx`, `mp4`) used to demonstrate ingestion, parsing, retrieval, or generation workflows.
   - These assets act as the **input corpus** for tutorial pipelines.

9. **External service and platform dependencies**
   - The repo references several outside systems that materially shape the architecture:
     - **LLM providers** such as OpenAI, DeepSeek, Qwen.
     - **Ollama** for local model deployment.
     - **Redis**, **Qdrant**, **Elasticsearch**, **MySQL**, and **FastAPI** in the project tracks.
     - **Coze**, **Dify**, **RAGFlow**, **MCP** servers/clients, and other agent tooling in the tutorial branches.
   - These dependencies matter because the repo is teaching **integration architecture**, not just isolated code patterns.

10. **Configuration and secrets boundary**
   - `.env-example` indicates environment-specific configuration is expected to be copied into a local `.env`.
   - The README emphasizes API keys and environment setup, so the architecture assumes **local developer configuration** rather than checked-in secrets.
   - This boundary cleanly separates **documentation/code** from **runtime credentials and machine-specific settings**.

11. **Developer workflow / repository hygiene**
   - `.husky/commit-msg` and `commitlint.config.js` show a **commit-message validation workflow**.
   - `CONTRIBUTING.md` suggests the repo is maintained like an evolving knowledge product, with contributor guidelines and update cadence.
   - This is a documentation engineering workflow, not a product CI/CD pipeline.

12. **Repository-level navigation model**
   - The content is intentionally hierarchical:
     - fundamentals → framework tutorials → platform tutorials → project cases → interview prep.
   - `_sidebar.md` and the numbered lesson structure support that navigation model.
   - For architecture diagramming, think of this repo as a **content platform with layered learning paths**, where the central flow is “concepts → examples → project systems → reference materials.”

13. **What is not here**
   - There is no single monolithic backend service, database schema, or deployed application in this repo.
   - Instead, it is a **meta-repository** that teaches how to build such systems, while delegating some runnable projects to linked external repos.
   - That distinction is important for any architecture diagram: the repo itself is the **knowledge and example hub**, not the production system.

Main entry points: [`_sidebar.md`](https://github.com/didilili/ai-agents-from-zero/blob/main/_sidebar.md) (Sidebar nav), [`案例与源码-3-LangGraph框架`](https://github.com/didilili/ai-agents-from-zero/tree/main/案例与源码-3-LangGraph框架) (LangGraph examples), [`images`](https://github.com/didilili/ai-agents-from-zero/tree/main/images) (Images), [`案例与源码-2-LangChain框架`](https://github.com/didilili/ai-agents-from-zero/tree/main/案例与源码-2-LangChain框架) (LangChain examples)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_docs["Docs site"]
  node_site_shell["Site shell<br/>static docs<br/>[index.html]"]
  node_sidebar_nav["Sidebar nav<br/>docs nav<br/>[_sidebar.md]"]
  node_site_plugins["Site plugins<br/>docs plugins"]
end

subgraph group_curriculum["Curriculum"]
  node_curriculum_basics["Fundamentals<br/>concept chapters<br/>[1-1-大模型认知与工程概览.md]"]
  node_curriculum_rag["RAG path<br/>concept chapters"]
  node_curriculum_platforms["Platform agents<br/>concept chapters"]
  node_curriculum_langchain["LangChain path<br/>framework chapters"]
  node_curriculum_langgraph["LangGraph path<br/>framework chapters"]
  node_curriculum_skills["Skills & tools<br/>practice chapters"]
end

subgraph group_examples["Example suites"]
  node_examples_coze_dify["Coze&Dify cases<br/>workflow cases"]
  node_examples_langchain["LangChain examples<br/>code examples"]
  node_examples_langgraph["LangGraph examples<br/>code examples"]
end

subgraph group_projects["Project tracks"]
  node_project_ecommerce["电商问数<br/>project blueprint"]
  node_project_research["深度研搜<br/>project blueprint"]
end

subgraph group_assets["Assets"]
  node_images_root[("Images<br/>visual assets")]
  node_sample_artifacts["Sample files<br/>data artifacts"]
  node_project_yaml["Metadata YAML<br/>structured data"]
end

subgraph group_ops["Ops & workflow"]
  node_env_config["Env config<br/>runtime config<br/>[.env-example]"]
  node_dev_workflow["Dev workflow<br/>repo hygiene<br/>[CONTRIBUTING.md]"]
end

node_site_shell -->|"navigates"| node_sidebar_nav
node_site_shell -->|"extends with"| node_site_plugins
node_sidebar_nav -->|"routes to"| node_curriculum_basics
node_sidebar_nav -->|"routes to"| node_curriculum_rag
node_sidebar_nav -->|"routes to"| node_curriculum_platforms
node_sidebar_nav -->|"routes to"| node_curriculum_langchain
node_sidebar_nav -->|"routes to"| node_curriculum_langgraph
node_sidebar_nav -->|"routes to"| node_curriculum_skills
node_curriculum_basics -->|"leads into"| node_curriculum_langchain
node_curriculum_basics -->|"leads into"| node_curriculum_langgraph
node_curriculum_langchain -->|"anchors"| node_examples_langchain
node_curriculum_langgraph -->|"anchors"| node_examples_langgraph
node_curriculum_platforms -->|"anchors"| node_examples_coze_dify
node_examples_langchain -->|"consumes"| node_sample_artifacts
node_examples_langchain -->|"depends on"| node_env_config
node_examples_langgraph -->|"depends on"| node_env_config
node_examples_langgraph -->|"mirrors"| node_project_yaml
node_project_ecommerce -->|"uses"| node_project_yaml
node_project_ecommerce -->|"builds on"| node_examples_langgraph
node_project_research -->|"builds on"| node_examples_langgraph
node_examples_coze_dify -->|"illustrates with"| node_images_root
node_examples_langchain -->|"illustrates with"| node_images_root
node_examples_langgraph -->|"illustrates with"| node_images_root
node_project_ecommerce -->|"illustrates with"| node_images_root
node_project_research -->|"illustrates with"| node_images_root
node_dev_workflow -->|"maintains"| node_site_shell
node_env_config -->|"configures"| node_examples_coze_dify

click node_site_shell "https://github.com/didilili/ai-agents-from-zero/blob/main/index.html"
click node_sidebar_nav "https://github.com/didilili/ai-agents-from-zero/blob/main/_sidebar.md"
click node_site_plugins "https://github.com/didilili/ai-agents-from-zero/tree/main/lib/plugins"
click node_curriculum_basics "https://github.com/didilili/ai-agents-from-zero/blob/main/1-1-大模型认知与工程概览.md"
click node_curriculum_rag "https://github.com/didilili/ai-agents-from-zero/blob/main/2-RAG-搭建企业私有&个人知识库.md"
click node_curriculum_platforms "https://github.com/didilili/ai-agents-from-zero/blob/main/3-基于Coze&Dify平台的智能体开发.md"
click node_curriculum_langchain "https://github.com/didilili/ai-agents-from-zero/blob/main/9-LangChain概述与架构.md"
click node_curriculum_langgraph "https://github.com/didilili/ai-agents-from-zero/blob/main/22-LangGraph概述与快速入门.md"
click node_curriculum_skills "https://github.com/didilili/ai-agents-from-zero/blob/main/27-Skills技能与AI编程工具实践.md"
click node_examples_coze_dify "https://github.com/didilili/ai-agents-from-zero/tree/main/案例与源码-1-Coze&Dify工作流智能体"
click node_examples_langchain "https://github.com/didilili/ai-agents-from-zero/tree/main/案例与源码-2-LangChain框架"
click node_examples_langgraph "https://github.com/didilili/ai-agents-from-zero/tree/main/案例与源码-3-LangGraph框架"
click node_project_ecommerce "https://github.com/didilili/ai-agents-from-zero/tree/main/实战项目-电商问数"
click node_project_research "https://github.com/didilili/ai-agents-from-zero/tree/main/实战项目-深度研搜"
click node_images_root "https://github.com/didilili/ai-agents-from-zero/tree/main/images"
click node_sample_artifacts "https://github.com/didilili/ai-agents-from-zero/tree/main/案例与源码-2-LangChain框架/10-rag/docloads/assets"
click node_project_yaml "https://github.com/didilili/ai-agents-from-zero/tree/main/实战项目-电商问数/yaml"
click node_env_config "https://github.com/didilili/ai-agents-from-zero/blob/main/.env-example"
click node_dev_workflow "https://github.com/didilili/ai-agents-from-zero/blob/main/CONTRIBUTING.md"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_site_shell,node_sidebar_nav,node_site_plugins toneBlue
class node_curriculum_basics,node_curriculum_rag,node_curriculum_platforms,node_curriculum_langchain,node_curriculum_langgraph,node_curriculum_skills toneAmber
class node_examples_coze_dify,node_examples_langchain,node_examples_langgraph toneMint
class node_project_ecommerce,node_project_research toneRose
class node_images_root,node_sample_artifacts,node_project_yaml toneIndigo
class node_env_config,node_dev_workflow toneTeal
```

## Components

### Docs site

Static documentation shell and navigation for reading the knowledge base in the browser.

- [Site shell](https://github.com/didilili/ai-agents-from-zero/blob/main/index.html): static docs · Browser-facing documentation entry point with sidebar navigation and Markdown rendering. · `index.html`
- [Sidebar nav](https://github.com/didilili/ai-agents-from-zero/blob/main/_sidebar.md): docs nav · Repository-wide navigation structure for the learning paths. · `_sidebar.md`
- [Site plugins](https://github.com/didilili/ai-agents-from-zero/tree/main/lib/plugins): docs plugins · Optional browser enhancements such as analytics and Mermaid viewing. · `lib/plugins`

### Curriculum

Top-level conceptual and framework lessons that form the main learning path.

- [Fundamentals](https://github.com/didilili/ai-agents-from-zero/blob/main/1-1-大模型认知与工程概览.md): concept chapters · Core theory on LLMs, prompting, RAG choices, and agent selection. · `1-1-大模型认知与工程概览.md`
- [RAG path](https://github.com/didilili/ai-agents-from-zero/blob/main/2-RAG-搭建企业私有&个人知识库.md): concept chapters · Knowledge-base, RAG, and deployment-related lessons. · `2-RAG-搭建企业私有&个人知识库.md`
- [Platform agents](https://github.com/didilili/ai-agents-from-zero/blob/main/3-基于Coze&Dify平台的智能体开发.md): concept chapters · Coze and Dify workflow-based agent tutorials and deployment notes. · `3-基于Coze&Dify平台的智能体开发.md`
- [LangChain path](https://github.com/didilili/ai-agents-from-zero/blob/main/9-LangChain概述与架构.md): framework chapters · LangChain overview, model I/O, prompts, memory, tools, embeddings, RAG, MCP, and agents. · `9-LangChain概述与架构.md`
- [LangGraph path](https://github.com/didilili/ai-agents-from-zero/blob/main/22-LangGraph概述与快速入门.md): framework chapters · LangGraph concepts from graph and state APIs through advanced multi-agent patterns. · `22-LangGraph概述与快速入门.md`
- [Skills & tools](https://github.com/didilili/ai-agents-from-zero/blob/main/27-Skills技能与AI编程工具实践.md): practice chapters · AI coding tools and skill-oriented practices near the end of the curriculum. · `27-Skills技能与AI编程工具实践.md`

### Example suites

Runnable framework examples and case-study materials organized by topic.

- [Coze&Dify cases](https://github.com/didilili/ai-agents-from-zero/tree/main/案例与源码-1-Coze&Dify工作流智能体): workflow cases · Workflow-oriented case studies for Coze and Dify, including generated artifacts and sample data. · `案例与源码-1-Coze&Dify工作流智能体`
- [LangChain examples](https://github.com/didilili/ai-agents-from-zero/tree/main/案例与源码-2-LangChain框架): code examples · Topic-based Python examples covering the LangChain stack from hello world to agents. · `案例与源码-2-LangChain框架`
- [LangGraph examples](https://github.com/didilili/ai-agents-from-zero/tree/main/案例与源码-3-LangGraph框架): code examples · Graph, state, node, edge, persistence, streaming, subgraph, and multi-agent examples. · `案例与源码-3-LangGraph框架`

### Project tracks

End-to-end project walkthroughs that model real-world agent system architectures.

- [电商问数](https://github.com/didilili/ai-agents-from-zero/tree/main/实战项目-电商问数): project blueprint · E-commerce question-answering track built around metadata retrieval, Qdrant, Elasticsearch, MySQL, LangGraph, and FastAPI. · `实战项目-电商问数`
- [深度研搜](https://github.com/didilili/ai-agents-from-zero/tree/main/实战项目-深度研搜): project blueprint · Deep research track using multi-agent orchestration, search, database query, RAGFlow knowledge base, and API delivery. · `实战项目-深度研搜`

### Assets

Images and structured sample data used to explain and drive the tutorial pipelines.

- [Images](https://github.com/didilili/ai-agents-from-zero/tree/main/images): visual assets · Repo-wide diagrams, screenshots, and illustrations supporting the lessons. · `images`
- [Sample files](https://github.com/didilili/ai-agents-from-zero/tree/main/案例与源码-2-LangChain框架/10-rag/docloads/assets): data artifacts · CSV, JSON, PDF, DOCX, TXT, XLSX, and MP4 materials used in ingestion and generation demos. · `案例与源码-2-LangChain框架/10-rag/docloads/assets`
- [Metadata YAML](https://github.com/didilili/ai-agents-from-zero/tree/main/实战项目-电商问数/yaml): structured data · Table and metric metadata used by the e-commerce question-answering project. · `实战项目-电商问数/yaml`

### Ops & workflow

Repository hygiene, environment setup, and contribution workflow files.

- [Env config](https://github.com/didilili/ai-agents-from-zero/blob/main/.env-example): runtime config · Local environment template and Python project settings for running examples. · `.env-example`
- [Dev workflow](https://github.com/didilili/ai-agents-from-zero/blob/main/CONTRIBUTING.md): repo hygiene · Contribution guidance and commit-message validation for maintaining the knowledge base. · `CONTRIBUTING.md`

## Connections

- Site shell → Sidebar nav: navigates · The static site is organized through the sidebar navigation.
- Site shell → Site plugins: extends with · Browser-side enhancements are loaded through the plugin layer.
- Sidebar nav → Fundamentals: routes to · Navigation exposes the foundational learning path.
- Sidebar nav → RAG path: routes to · Navigation exposes the RAG and deployment path.
- Sidebar nav → Platform agents: routes to · Navigation exposes platform-based agent tutorials.
- Sidebar nav → LangChain path: routes to · Navigation exposes the LangChain framework path.
- Sidebar nav → LangGraph path: routes to · Navigation exposes the LangGraph framework path.
- Sidebar nav → Skills & tools: routes to · Navigation exposes the skills and tools section.
- Fundamentals → LangChain path: leads into · Foundational concepts prepare readers for LangChain patterns.
- Fundamentals → LangGraph path: leads into · Foundational concepts prepare readers for graph-based agents.
- LangChain path → LangChain examples: anchors · The framework curriculum is reinforced by the LangChain code suite.
- LangGraph path → LangGraph examples: anchors · The framework curriculum is reinforced by the LangGraph code suite.
- Platform agents → Coze&Dify cases: anchors · Platform tutorials are backed by workflow cases and artifacts.
- LangChain examples → Sample files: consumes · RAG and document-loading demos use bundled sample files.
- LangChain examples → Env config: depends on · Examples rely on local environment and Python setup.
- LangGraph examples → Env config: depends on · Graph examples rely on local environment and Python setup.
- LangGraph examples → Metadata YAML: mirrors · Project-style metadata and persistence patterns inform the example flow.
- 电商问数 → Metadata YAML: uses · The e-commerce track builds its metadata knowledge base from YAML artifacts.
- 电商问数 → LangGraph examples: builds on · The project architecture is taught using LangGraph-style components and flows.
- 深度研搜 → LangGraph examples: builds on · The deep research track follows multi-agent and graph orchestration patterns.
- Coze&Dify cases → Images: illustrates with · Case studies rely on screenshots and diagrams to explain workflows.
- LangChain examples → Images: illustrates with · Framework lessons are accompanied by explanatory visuals.
- LangGraph examples → Images: illustrates with · Graph lessons are accompanied by explanatory visuals.
- 电商问数 → Images: illustrates with · The project walkthrough uses diagrams and screenshots.
- 深度研搜 → Images: illustrates with · The project walkthrough uses diagrams and screenshots.
- Dev workflow → Site shell: maintains · Repository hygiene supports the documentation site and content updates.
- Env config → Coze&Dify cases: configures · Local environment setup supports running and reproducing examples.
