agent-works
Batteries-included Agent toolbox built on agent-base.
agent-works adds production-ready capabilities on top of the agent-base runtime kernel: MCP multi-server management, Skills with progressive disclosure, built-in file tools, tool enforcement middleware, and a CLI REPL loop — all behind feature flags. Pick what you need.
Relationship with agent-base
agent-base Pure runtime kernel (~12 deps, trait interfaces only)
↑
agent-works Batteries-included toolbox (wraps agent-base + enhancements)
- Use
agent-basealone when you only need the runtime (LLM + tools + middleware). - Use
agent-workswhen you want MCP, Skills, built-in tools, CLI — and still get everything from agent-base through re-exports. - Switching from
agent-basetoagent-worksis a one-line import change.
Installation
[]
= { = "0.1.1", = ["full"] }
Or pick specific features:
= { = "0.1.1", = ["mcp", "skill"] }
Feature Flags
| Feature | Description | Extra deps |
|---|---|---|
mcp |
McpHUb — multi-server MCP with HTTP + stdio transport |
— |
skill |
Skill trait + LazySkillPrompter / FullDetailPrompter + SkillDetailTool + SkillLoader |
— |
builtin-tools |
ReadFileTool, WriteFileTool, ListDirectoryTool, FileExistsTool, SearchReplaceTool |
walkdir |
cli |
CliRepl (generic REPL loop) + CliEventPrinter (terminal event output) |
— |
full |
All of the above | — |
All types from agent-base are re-exported (AgentBuilder, AgentRuntime, Tool, Middleware, ...), so you only need to depend on agent-works.
Quick Start
Skills
Skills package tools + descriptions into reusable units with progressive disclosure:
use Arc;
use ;
use async_trait;
use ;
// 1. Define tools
;
// 2. Pack into a Skill
;
// 3. Build with agent-works AgentBuilder
let runtime = new
.system_prompt
.register_skill // auto-registers tools, injects prompt, adds detail tool
.build?;
The builder automatically:
- Registers skill tools and detects name conflicts
- Injects skill brief descriptions into the system prompt (via
LazySkillPrompter) - Registers
SkillDetailToolfor on-demand detailed prompt loading
MCP Multi-Server
use *;
let mut hub = new;
hub.add_server;
hub.connect_all.await?;
// Discover tools from all servers
let all_tools = hub.discover_all.await?;
// Register into the agent runtime
let mut tools = runtime.tools_mut;
hub.register_all;
Built-in File Tools
use ;
use PathBuf;
let runtime = new
.register_tool
.register_tool
.build?;
CLI REPL
use ;
let mut repl = new;
// Register custom shell commands
repl.register_shell_command;
repl.run.await?;
Tool Enforcement
The ToolEnforcementMiddleware (inherited from agent-base) nudges the LLM to actually call tools instead of just describing what it would do:
use ToolEnforcementMiddleware;
use ToolEnforcementConfig;
let runtime = new
.register_tool
.middleware
.build?;
Examples
# Skills with progressive disclosure
# MCP multi-server connection
# Built-in file tools
# CLI REPL + event printer
Module Structure
src/
├── lib.rs # Re-exports agent-base + feature-gated modules
├── builder.rs # AgentBuilder wrapper with skill integration
├── mcp/ # McpHUb + McpClient (HTTP + stdio transport)
├── skill/ # Skill trait + prompter strategies + detail tool
├── builtin/ # ReadFile / WriteFile / ListDirectory / FileExists / SearchReplace
└── cli/ # CliRepl + CliEventPrinter
License
MIT