smolagents
简介
HuggingFace 出品的极简 Agent 库:主打 CodeAgent——让模型直接写 Python 代码作为行动(比 JSON 工具调用更灵活),几行代码即可搭建带工具的 Agent。
English
HuggingFace's minimalist agent library featuring CodeAgents that write Python code as actions, more flexible than JSON tool calls.
适用场景
- 想要轻量级方案快速验证 Agent 想法
- 希望模型用写代码而非固定 JSON 格式调用工具
- 已熟悉 HF 生态,想无缝接 transformers 模型
快速上手
- pip install smolagents,配好模型端点
- 用 ToolMind 装饰器把 Python 函数注册成工具
- 创建 CodeAgent 并传入工具列表运行
- 在 Hub 上挑选现成工具扩展能力
标签
相关资源
LangChain 精选
最流行的 LLM 应用开发框架,提供链式调用、Agent 编排、工具调用与 RAG 全套能力,Python 与 JS 双语言生态,适合快速搭建各类 AI Agent 应用。The most popular framework for building LLM applications: chains, agent orchestration, tool calling and RAG out of the box, in both Python and JavaScript.
LangGraph 精选
基于图(状态机)的 Agent 编排框架,擅长多 Agent 协作、循环与人工介入流程,是 LangChain 官方推荐的复杂 Agent 生产方案。Graph-based agent orchestration from the LangChain team. Ideal for multi-agent collaboration, loops and human-in-the-loop workflows in production.
AutoGen
微软开源的多 Agent 对话框架,让多个 Agent 通过对话协作完成复杂任务,支持人机混合参与,学术与工业界应用广泛。Microsoft's open-source framework where multiple agents converse to solve complex tasks, with human-in-the-loop support.