Files
jaspersoft-agent-learn/README.md
T

3.6 KiB
Raw Blame History

JasperSoft Agent Learn

AI Agent 开发学习项目 | 从零到一掌握 Agent 核心概念

License: MIT Python


🎯 这是什么?

一个渐进式的 AI Agent 开发学习项目,通过 7 个 Step 带你从零掌握 AI Agent 的核心概念:

Step 主题 你将学会
01 Tool 工具系统 如何定义和注册工具
02 State 状态管理 如何管理 Agent 的状态
03 Simple Agent 如何构建 Agent 循环
04 Memory 记忆 如何让 Agent 记住对话
05 RAG 知识检索 如何让 Agent 查阅知识库
06 Self-Correction 如何让 Agent 自我修正
07 Multi-Agent 如何构建多 Agent 协作

📚 学习大纲

第 1 周:基础(Step 01-03

  • Day 1-2: 理解 Tool 系统
  • Day 3-4: 掌握 State 管理
  • Day 5-7: 构建简单 Agent

第 2 周:进阶(Step 04-07

  • Day 8-9: 多级记忆系统
  • Day 10-11: RAG 与知识增强
  • Day 12-13: 自我修正模式
  • Day 14: 多 Agent 协作

🚀 快速开始

1. 克隆项目

git clone https://www.1415243231.top/gitea/panda/jaspersoft-agent-learn.git
cd jaspersoft-agent-learn

2. 安装依赖

python -m venv venv
source venv/bin/activate  # Linux/Mac
.\venv\Scripts\activate   # Windows
pip install python-dotenv

3. 开始学习

cd step_01_tools
python main.py

📖 学习方法

每个 Step 都包含:

step_XX_name/
├── README.md              # 理论 + 架构图(先读)
├── concept.py             # 详细注释代码(再看)
├── exercise.py            # 练习题(自己做)
├── exercise_answer.py     # 参考答案(对照)
└── main.py               # 运行演示

💡 核心概念预览

Tool(工具)

class Tool:
    name: str          # 工具名称
    description: str  # 工具描述
    execute: Callable # 执行函数

State(状态)

state = {
    "messages": [...],   # 对话历史
    "context": {...},    # 上下文
    "memory": [...],     # 记忆
}

Agent 循环

while not done:
    thought = think(state)      # 思考
    action = decide(thought)    # 决策
    result = execute(action)    # 执行
    observe(state, result)      # 观察

🎓 学习目标

完成本项目后,你将能够:

  • 理解 Tool 的定义和注册机制
  • 掌握 State 的设计模式
  • 能够构建简单的 Agent 循环
  • 实现多级记忆系统
  • 理解 RAG 架构
  • 掌握 Self-Correction 模式
  • 设计 Multi-Agent 协作系统

📝 项目结构

jaspersoft-agent-learn/
├── LEARN_GUIDE.md        # 详细学习指南
├── README.md             # 项目概览
├── .env.example          # 环境变量模板
│
├── step_01_tools/        # 工具系统
├── step_02_state/        # 状态管理
├── step_03_simple_agent/ # 简单 Agent
├── step_04_memory/       # 记忆系统
└── step_05_07_advanced/  # RAG/修正/多Agent

🔗 相关链接


🤝 参与贡献

欢迎提交 Issue 和 PR


📄 许可证

MIT License


开始你的 AI Agent 学习之旅吧! 🚀