Skip to main content

base_agent_builder

Function base_agent_builder 

Source
pub fn base_agent_builder(llm_client: Arc<dyn LlmClient>) -> 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
  • File tools (read_file / write_file / list_files) — opt-in via file feature
  • Skills injected into system prompt (not as tools — LLM uses read_file; requires file feature)
  • Multi-agent support (opt-in via multi-agent feature)

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

To enable file tools: --features file. To enable shell: --features shell. To enable multi-agent: --features multi-agent or .with_multi_agent(...). To enable MCP: --features mcp. To enable browser (CDP): --features browser. To enable everything: --features full.