How datawhalechina/agent-tutorial works
1. Repository type
- This is a tutorial/documentation repository, not an application codebase.
- Its main purpose is to teach Agent concepts and ModelScope Agent usage through explanatory markdown + runnable notebook demos.
2. Top-level structure
- The repo is organized into a README.md plus a docs/ tree.
- docs/_sidebar.md acts as the content navigation layer for the tutorial site or docs viewer.
- Most of the actual learning material lives in chapter folders under docs/.
3. Chapter-based content architecture
- The content is split into three clear subsystems:
- Chapter 1: Agent introduction — theory and environment setup.
- Chapter 2: Agent practice — a concrete scheduling assistant project.
- Chapter 3: Agent outlook — broader design patterns and future application discussion.
- This creates a progression from concepts → implementation → application thinking.
4. Theory / concept layer
- Chapter 1 explains the Agent principle and deeper Agent mechanics.
- This layer is the mental model boundary: it defines what an Agent is and what components are needed before touching demos.
- It also includes environment setup guidance, which bridges theory to execution.
5. Practice / application layer
- Chapter 2 is the main applied project section.
- It centers on a “日程规划小助手” (schedule-planning assistant), showing how Agent concepts are assembled into a practical assistant.
- A separate article covers Amap (高德) OpenAPI practice, which indicates the assistant integrates external location or routing data.
6. Demo runtime layer
- The demo-code/ folders contain Jupyter notebooks and configuration files.
- This is the executable boundary of the repo: readers can run demos locally or remotely rather than only reading static docs.
- Notebooks are used for both local function demos and remote function demos, showing multiple execution modes.
7. External services / integration points
- The docs reference ModelScope Agent, which is the main agent framework the tutorial is built around.
- The practice chapter references Amap OpenAPI, meaning the assistant depends on an external mapping/service API.
- Chapter 3 includes a dashscope-demo.ipynb, indicating an additional integration with DashScope for model or agent capability demonstration.
8. Configuration boundary
- cfg_tool_template.json suggests the demos use a tool configuration template to define callable tools/functions.
- This separates agent logic from tool registration/configuration, which is important for the architecture diagram.
- The repo therefore has a clear split between tutorial narrative, agent setup, and tool wiring.
9. Content asset layer
- Each major section has imgs/ directories for diagrams and screenshots.
- These assets support the explanatory material but are not part of runtime execution.
- They likely serve as the visual layer for the diagrams, workflow explanations, and examples.
10. Learning flow / data flow
- The intended user flow is: read Agent theory → configure environment → run notebook demos → integrate external APIs/tools → study broader patterns.
- Data flows from user prompts into the Agent framework, then through configured tools/APIs, and back as assistant responses or scheduled plans.
- In the schedule assistant demo, external service data likely feeds the Agent’s reasoning and action steps.
11. Boundary between documentation and execution
- Markdown files are the authoritative tutorial narrative.
- Notebooks are the interactive execution examples.
- Configuration files bridge the two by turning the tutorial’s concepts into runnable agent/tool setups.
12. What to draw in an architecture diagram
- The diagram should show:
- a documentation/navigation layer (README, _sidebar, markdown chapters),
- a runtime/demo layer (Jupyter notebooks),
- an Agent framework layer (ModelScope Agent),
- external API/tool services (Amap, DashScope),
- and a supporting asset/config layer (imgs, JSON config templates).
- The dominant architectural pattern is a learning-content system with executable agent demos, rather than a production service.
Main entry points: _sidebar.md Sidebar · 1.2 Agent原理深入+环境配置.md 原理与环境 · 2.2 日程规划小助手.md 日程助手 · 1.1 Agent原理.md Agent原理
Components 18
Repository
Top-level tutorial repository structure
- README · Repository landing page and overview
README.md
Docs
Narrative documentation and chapter content
- Sidebar · Documentation navigation structure
docs/_sidebar.md
Chapter 1
Agent introduction and environment setup
Chapter 2
Agent practice and schedule assistant project
Chapter 3
Agent outlook and broader application patterns
Demo runtime
Executable notebook demos for chapter 1
Demo runtime
Executable notebook demo for chapter 3
- DashScope demo · DashScope capability demonstration
docs/第三章:Agent应用展望/demo-code/dashscope-demo.ipynb
Support assets
Images and configuration templates used by the tutorials
- 工具模板 · Template for registering callable tools
docs/第一章:Agent简介/demo-code/cfg_tool_template.json - Chapter 1 imgs · Diagrams and screenshots supporting chapter 1
docs/第一章:Agent简介/imgs - Chapter 2 imgs · Diagrams and screenshots supporting chapter 2
docs/第二章:Agent实践/imgs - Chapter 3 imgs · Diagrams and screenshots supporting chapter 3
docs/第三章:Agent应用展望/imgs
Integrations
External frameworks and APIs referenced by the tutorials
- ModelScope Agent · Primary agent framework used throughout the tutorial
- Amap API · Mapping and location service used in the practice chapter
- DashScope · Model or agent capability service referenced in chapter 3
Connections 21
- README → Sidebar: organizes · Landing page connects to the documentation structure
- Sidebar → Agent原理: navigates · Sidebar exposes chapter 1 content
- Sidebar → 高德实践: navigates · Sidebar exposes chapter 2 content
- Sidebar → 创作思路: navigates · Sidebar exposes chapter 3 content
- Agent原理 → 原理与环境: builds into · Theory leads into deeper mechanics and setup
- 原理与环境 → 本地 demo: grounds · Setup enables runnable local demo
- 原理与环境 → 远程 demo: grounds · Setup enables runnable remote demo
- 本地 demo → 工具模板: uses · Local demo relies on tool configuration template
- 远程 demo → 工具模板: uses · Remote demo relies on tool configuration template
- 本地 demo → ModelScope Agent: runs on · Notebook executes Agent framework examples
- 远程 demo → ModelScope Agent: runs on · Notebook executes Agent framework examples
- 高德实践 → Amap API: integrates · Practice article demonstrates Amap integration
- 日程助手 → Amap API: uses · Schedule assistant depends on mapping/location data
- 日程助手 → ModelScope Agent: assembles · Project combines tutorial concepts with the Agent framework
- 创作思路 → 应用展望: develops · Pattern discussion leads to broader outlook
- 应用展望 → DashScope demo: illustrates · Outlook section is backed by a DashScope notebook demo
- DashScope demo → DashScope: uses · Notebook demonstrates the external capability service
- Agent原理 → Chapter 1 imgs: supported by · Chapter 1 uses visual explanation assets
- 日程助手 → Chapter 2 imgs: supported by · Chapter 2 uses visual explanation assets
- 应用展望 → Chapter 3 imgs: supported by · Chapter 3 uses visual explanation assets
- 原理与环境 → ModelScope Agent: introduces · Environment setup prepares the Agent framework