经 AI Skill Hub 精选评估,sagents 获评「推荐使用」。这款Agent工作流在功能完整性、社区活跃度和易用性方面表现出色,AI 评分 7.5 分,适合有一定技术背景的用户使用。
基于Elixir的OTP监督和中间件组合,构建交互式AI代理
sagents 是一套完整的 AI Agent 自动化工作流方案。通过可视化的节点编排,将复杂的多步骤任务拆解为清晰的自动化流程,实现全程无人值守的智能处理。支持与数百种外部服务和 API 无缝集成,适合构建数据处理管线、业务自动化和 AI 辅助决策系统。
基于Elixir的OTP监督和中间件组合,构建交互式AI代理
sagents 是一套完整的 AI Agent 自动化工作流方案。通过可视化的节点编排,将复杂的多步骤任务拆解为清晰的自动化流程,实现全程无人值守的智能处理。支持与数百种外部服务和 API 无缝集成,适合构建数据处理管线、业务自动化和 AI 辅助决策系统。
# 克隆仓库 git clone https://github.com/sagents-ai/sagents cd sagents # 查看安装说明 cat README.md # 按 README 完成环境依赖安装后即可使用
# 查看帮助 sagents --help # 基本运行 sagents [options] <input> # 详细使用说明请查阅文档 # https://github.com/sagents-ai/sagents
# sagents 配置说明 # 查看配置选项 sagents --config-example > config.yml # 常见配置项 # output_dir: ./output # log_level: info # workers: 4 # 环境变量(覆盖配置文件) export SAGENTS_CONFIG="/path/to/config.yml"
Sage Agents - Combining the wisdom of a Sage) with the power of LLM-based Agents
A sage is a person who has attained wisdom and is often characterized by sound judgment and deep understanding. Sagents brings this philosophy to AI agents: building systems that don't just execute tasks, but do so with thoughtful human oversight, efficient resource management, and extensible architecture.
call_llm, execute_tools, check_pre_tool_hitl, propagate_state, etc.) or write your own. Different agents can use different modes in the same applicationuntil_tool) - Force agents to loop until they call a specific tool, returning the result as a clean {:ok, state, %ToolResult{}} tuple. No more hoping the LLM follows your output format — get structured data you can pattern match onSee it in action! Try the agents_demo application to experience Sagents interactively, or add the sagents_live_debugger to your app for real-time insights into agent configuration, state, and event flows.

The AgentsDemo chat interface showing the use of a virtual filesystem, tool call execution, composable middleware, supervised Agentic GenServer assistant, and much more!
{:ok, agent} = Agent.new(%{ agent_id: "my-agent-1", model: ChatAnthropic.new!(%{model: "claude-sonnet-4-5-20250929"}), base_system_prompt: "You are a helpful coding assistant.", middleware: [ TodoList, FileSystem, {HumanInTheLoop, [ interrupt_on: %{ "write_file" => true, "delete_file" => true } ]} ] }) ```
mix deps.get
mix test --include live_call mix test --include live_anthropic
Add sagents to your list of dependencies in mix.exs:
def deps do
[
{:sagents, "~> 0.7.0"}
]
end
LangChain is automatically included as a dependency.
Add Sagents.Supervisor to your application's supervision tree:
```elixir
Sagents provides generators to scaffold everything you need for conversation-centric agents:
mix sagents.setup MyApp.Conversations \
--scope MyApp.Accounts.Scope \
--owner-type user \
--owner-field user_id
This generates: - Persistence layer - Database schemas and migration - Factory module - Agent creation with model/middleware configuration - Coordinator module - Session management and lifecycle orchestration
All configured to work together seamlessly based on your --owner-type and --owner-field settings.
```elixir
A complete Phoenix LiveView application demonstrating Sagents in action: - Multi-conversation support with real-time state persistence - Human-in-the-loop approval workflows - File system operations with persistence - SubAgent delegation patterns
Sagents builds on the Elixir LangChain library for LLM integration. To use Sagents, you need to configure an LLM provider by setting the appropriate API key as an environment variable:
```bash
mix sagents.setup MyApp.Conversations \
--scope MyApp.Accounts.Scope \
--owner-type user \
--owner-field user_id \
--factory MyApp.Agents.Factory \
--coordinator MyApp.Agents.Coordinator \
--pubsub MyApp.PubSub \
--presence MyAppWeb.Presence \
--table-prefix sagents_
All options have sensible defaults based on your context module and Phoenix conventions.
For a fully customized example, see the agents_demo project.
config :sagents, :distribution, :horde ```
When Horde is enabled, Sagents.ProcessRegistry and Sagents.ProcessSupervisor automatically switch to Horde.Registry and Horde.DynamicSupervisor, giving you:
Sagents.Horde.ClusterConfigAgents broadcast {:agent, {:node_transferring, data}} and {:agent, {:node_transferred, data}} events during Horde redistribution, allowing connected clients to follow their agent to a new node.
No code changes are needed beyond the config — the ProcessRegistry and ProcessSupervisor abstractions handle backend switching transparently.
sagents是一个开源的AI工作流项目,使用Elixir和OTP监督,提供了一个灵活的中间件组合,用于构建交互式AI代理。虽然项目质量较高,但仍需要进一步的测试和优化。
该工具使用 NOASSERTION 协议,商用场景请仔细阅读协议条款,必要时咨询法律意见。
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
📄 NOASSERTION — 请查阅原始协议条款了解具体使用限制。
AI Skill Hub 点评:sagents 的核心功能完整,质量良好。对于自动化工程师和运维人员来说,这是一个值得纳入个人工具库的选择。建议先在非生产环境试用,再逐步推广。
| 原始名称 | sagents |
| 原始描述 | 开源AI工作流:Build interactive AI agents in Elixir with OTP supervision, middleware compositi。⭐226 · Elixir |
| Topics | workflowagentaielixir |
| GitHub | https://github.com/sagents-ai/sagents |
| License | NOASSERTION |
| 语言 | Elixir |
收录时间:2026-06-09 · 更新时间:2026-06-09 · License:NOASSERTION · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端