Crig::AgentBuilder(M)
Builder for the core agent runtime. AgentBuilder is the main ergonomic surface for composing preambles, context, tools, dynamic retrieval, output schemas, and generation parameters before producing a concrete Agent.
Constructors
Instance methods
Add static context that will be normalized into request documents.
Set a default conversation id used when none is provided per-request. Can be overridden per-request via PromptRequest#conversation.
Register a dynamic context source queried at prompt time.
Register a dynamic tool source queried from vector search at prompt time.
Register a dynamic tool source queried from vector search at prompt time using the same ToolSet-oriented surface as the upstream Rust builder.
Attach a ConversationMemory backend. When set, the agent will automatically load prior conversation history before sending a prompt and append new messages after a successful turn. A conversation_id must be supplied either via #conversation_id on the builder or per-request via PromptRequest#conversation. If neither is set, memory is silently bypassed.
Build a JSON schema from a Crystal type for structured output requests.
Upstream alias: dynamic_tools → retrieved_tools (v0.41.0)
Upstream alias: dynamic_tools → retrieved_tools for ToolSet variant (v0.41.0)
Add a nested agent as a callable tool (upstream into_tool).
Add a tool definition directly without an executable runtime implementation.
Add an executable tool and route it through the shared tool server runtime.
Deprecated: use repeated .tool(...) calls instead.
Deprecated: use repeated .tool(...) calls instead. tools(Vec) was removed in upstream v0.41.0 — prefer .tool(...) for clarity.