AI Agent SDK
Project description
Agentica: Build AI Agents
Agentica 是一个轻量级 Python 框架,用于构建 AI 智能体。Async-First 架构,支持工具调用、RAG、多智能体团队、工作流编排和 MCP 协议。
安装
pip install -U agentica
快速开始
import asyncio
from agentica import Agent, ZhipuAI
async def main():
agent = Agent(model=ZhipuAI())
result = await agent.run("一句话介绍北京")
print(result.content)
asyncio.run(main())
北京是中国的首都,是一座拥有三千多年历史的文化名城,也是全国的政治、文化和国际交流中心。
需要先设置 API Key:
export ZHIPUAI_API_KEY="your-api-key" # 智谱AI(glm-4.7-flash 免费)
export OPENAI_API_KEY="sk-xxx" # OpenAI
export DEEPSEEK_API_KEY="your-api-key" # DeepSeek
功能特性
- Async-First — 原生 async API,
asyncio.gather()并行工具执行,同步适配器兼容 - 20+ 模型 — OpenAI / DeepSeek / Claude / 智谱 / Qwen / Moonshot / Ollama / LiteLLM 等
- 40+ 内置工具 — 搜索、代码执行、文件操作、浏览器、OCR、图像生成
- RAG — 知识库管理、混合检索、Rerank,集成 LangChain / LlamaIndex
- 多智能体 — Team(动态委派)和 Workflow(确定性编排)
- 安全守卫 — 输入/输出/工具级 Guardrails
- MCP / ACP — Model Context Protocol 和 Agent Communication Protocol 支持
- Skill 系统 — 基于 Markdown 的技能注入,模型无关
- 多模态 — 文本、图像、音频、视频理解
CLI
agentica --model_provider zhipuai --model_name glm-4.7-flash
Web UI
通过 agentica-gateway 提供 Web 页面,同时支持飞书 App、企业微信直连调用 Agentica。
示例
查看 examples/ 获取完整示例,涵盖:
| 类别 | 内容 |
|---|---|
| 基础用法 | Hello World、流式输出、结构化输出、多轮对话、多模态 |
| 工具 | 自定义工具、Async 工具、搜索、代码执行、文件操作 |
| Agent 模式 | Agent 作为工具、并行执行、团队协作、辩论 |
| RAG | PDF 问答、高级 RAG、LangChain / LlamaIndex 集成 |
| 工作流 | 数据管道、投资研究、新闻报道、代码审查 |
| MCP | Stdio / SSE / HTTP 传输、JSON 配置 |
| 应用 | LLM OS、深度研究、客服系统 |
文档
完整使用文档:https://shibing624.github.io/agentica
社区与支持
- GitHub Issues — 提交 issue
- 微信群 — 添加微信号
xuming624,备注 "llm",加入技术交流群
引用
如果您在研究中使用了 Agentica,请引用:
Xu, M. (2026). Agentica: A Human-Centric Framework for Large Language Model Agent Workflows. GitHub. https://github.com/shibing624/agentica
许可证
贡献
欢迎贡献!请查看 CONTRIBUTING.md。
致谢
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agentica-1.3.2.tar.gz.
File metadata
- Download URL: agentica-1.3.2.tar.gz
- Upload date:
- Size: 369.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
08a12237466ce050e71314e34e3a521754c16a1dd20a17fb224044f3c966d4f1
|
|
| MD5 |
b4add1111189958eb9ef01c0c896e1e7
|
|
| BLAKE2b-256 |
523a4414f80d54e6dae65a7a727bc82d723ebd29d1e130dcb29233030951f280
|
File details
Details for the file agentica-1.3.2-py3-none-any.whl.
File metadata
- Download URL: agentica-1.3.2-py3-none-any.whl
- Upload date:
- Size: 465.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c20c2f35ad7d5b2c61665a9c754ce17368ed9815ab2f843d1b9108c5b99351c
|
|
| MD5 |
9da33acd7b4fd30397f1d84d4a3cdf24
|
|
| BLAKE2b-256 |
a822edb592b0682be656eb00f3109a32d6480f71f460ddf12a51a40c22f8f8ad
|