
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
hello-agents
Advanced tools
🤖 生产级多智能体框架 - 工具响应协议、上下文工程、会话持久化、子代理机制等16项核心能力
HelloAgents 是一个基于 OpenAI 原生 API 构建的生产级多智能体框架,集成了工具响应协议(ToolResponse)、上下文工程(HistoryManager/TokenCounter)、会话持久化(SessionStore)、子代理机制(TaskTool)、乐观锁(文件编辑)、熔断器(CircuitBreaker)、Skills 知识外化、TodoWrite 进度管理、DevLog 决策记录、流式输出(SSE)、异步生命周期、可观测性(TraceLogger)、日志系统(四种范式)、LLM/Agent 基类重构等 16 项核心能力,为构建复杂智能体应用提供完整的工程化支持。
重要提示:本仓库目前维护两个版本
📚 学习版本(推荐初学者):learn_version 分支 与 Datawhale Hello-Agents 教程 正文完全对应的稳定版本,适合跟随教程学习使用。
🚀 开发版本(当前分支):持续迭代中的最新代码(V1.0.0),包含新功能和改进,部分实现可能与教程内容存在差异。如需学习教程,请切换到 learn_version 分支。
📦 历史版本:Releases 页面 提供从 v0.1.1 到 v0.2.9 的所有版本,每个版本对应教程的特定章节,可根据学习进度选择对应版本。
pip install hello-agents
from hello_agents import ReActAgent, HelloAgentsLLM, ToolRegistry
from hello_agents.tools.builtin import ReadTool, WriteTool, TodoWriteTool
llm = HelloAgentsLLM()
registry = ToolRegistry()
registry.register_tool(ReadTool())
registry.register_tool(WriteTool())
registry.register_tool(TodoWriteTool())
agent = ReActAgent("assistant", llm, tool_registry=registry)
agent.run("分析项目结构并生成报告")
创建 .env 文件:
LLM_MODEL_ID=your-model-name
LLM_API_KEY=your-api-key-here
LLM_BASE_URL=your-api-base-url
# 自动检测provider
llm = HelloAgentsLLM() # 框架自动检测为modelscope
print(f"检测到的provider: {llm.provider}")
💡 智能检测: 框架会根据API密钥格式和Base URL自动选择合适的provider
框架基于 3 种适配器 支持所有主流 LLM 服务:
支持所有提供 OpenAI 兼容接口的服务:
| 提供商类型 | 示例服务 | 配置示例 |
|---|---|---|
| 云端 API | OpenAI、DeepSeek、Qwen、Kimi、智谱 GLM | LLM_BASE_URL=api.deepseek.com |
| 本地推理 | vLLM、Ollama、SGLang | LLM_BASE_URL=http://localhost:8000 |
| 其他兼容 | 任何 OpenAI 格式接口 | LLM_BASE_URL=your-endpoint |
| 提供商 | 检测条件 | 配置示例 |
|---|---|---|
| Claude | base_url 包含 anthropic.com | LLM_BASE_URL=https://api.anthropic.com |
| 提供商 | 检测条件 | 配置示例 |
|---|---|---|
| Google Gemini | base_url 包含 googleapis.com 或 generativelanguage | LLM_BASE_URL=https://generativelanguage.googleapis.com |
💡 自动适配:框架根据
base_url自动选择适配器,无需手动指定。
hello-agents/
├── hello_agents/ # 主包
│ ├── core/ # 核心组件
│ │ ├── llm.py # LLM 基类与配置
│ │ ├── llm_adapters.py # 三种适配器(OpenAI/Anthropic/Gemini)
│ │ ├── agent.py # Agent 基类(Function Calling 架构)
│ │ ├── session_store.py # 会话持久化
│ │ ├── lifecycle.py # 异步生命周期
│ │ └── streaming.py # SSE 流式输出
│ ├── agents/ # Agent 实现
│ │ ├── simple_agent.py # SimpleAgent
│ │ ├── react_agent.py # ReActAgent
│ │ ├── reflection_agent.py # ReflectionAgent
│ │ └── plan_solve_agent.py # PlanAndSolveAgent
│ ├── tools/ # 工具系统
│ │ ├── registry.py # 工具注册表
│ │ ├── response.py # ToolResponse 协议
│ │ ├── circuit_breaker.py # 熔断器
│ │ ├── tool_filter.py # 工具过滤(子代理机制)
│ │ └── builtin/ # 内置工具
│ │ ├── file_tools.py # 文件工具(乐观锁)
│ │ ├── task_tool.py # 子代理工具
│ │ ├── todowrite_tool.py # 进度管理
│ │ ├── devlog_tool.py # 决策日志
│ │ └── skill_tool.py # Skills 知识外化
│ ├── context/ # 上下文工程
│ │ ├── history.py # HistoryManager
│ │ ├── token_counter.py # TokenCounter
│ │ ├── truncator.py # ObservationTruncator
│ │ └── builder.py # ContextBuilder
│ ├── observability/ # 可观测性
│ │ └── trace_logger.py # TraceLogger
│ └── skills/ # Skills 系统
│ └── loader.py # SkillLoader
├── docs/ # 文档
├── examples/ # 示例代码
└── tests/ # 测试用例
欢迎贡献代码!请遵循以下步骤:
git checkout -b feature/AmazingFeature)git commit -m 'Add some AmazingFeature')git push origin feature/AmazingFeature)本项目采用 CC BY-NC-SA 4.0 许可证 - 查看 LICENSE 文件了解详情。
许可证要点:
如需商业使用,请联系项目维护者获取授权。
详细了解 HelloAgents v1.0.0 的 16 项核心能力:
HelloAgents - 让智能体开发变得简单而强大 🚀
FAQs
生产级多智能体框架 - 工具响应协议、上下文工程、会话持久化、子代理机制、乐观锁、熔断器、Skills知识外化等16项核心能力
We found that hello-agents demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.