Skip to main content

base_agent_builder

Function base_agent_builder 

Source
pub fn base_agent_builder(llm_client: Arc<dyn LlmProvider>) -> AgentBuilder
Expand description

Returns an agent_works::AgentBuilder with sensible defaults:

  • English
  • Medium reasoning effort
  • Thinking enabled
  • Consecutive failure recovery (default 3 retries)
  • Session limits (50 sessions / 100 turns per session / 50k per-message cap)
  • Per-run react-loop cap (200 iterations for one user input)
  • LLM-based context compression for long tool-heavy conversations (uses CompressionMiddleware from agent-works when compression feature is enabled)
  • File tools (read_file / write_file / edit_file / list_files) — enabled by default
  • Plan checklist (update_plan) — display-only progress tracking, enabled by default
  • Skills injected into system prompt (not as tools — LLM uses read_file; enabled by default via file feature)
  • MCP protocol support — enabled by default
  • Telemetry + logging — enabled by default

Callers are responsible for: registering additional tools, setting the approval handler, setting the system prompt, then calling .build().

Feature groups (opt-in):

  • shell: shell execution (--features shell)
  • multi-agent: multi-agent support (--features multi-agent)
  • browser: browser automation via CDP (--features browser)
  • protocol meta: MCP
  • observability meta: telemetry + logging
  • app meta: browser (NOT included in full)
  • full: file + shell + mcp + telemetry + logging (excludes browser and multi-agent)