Skip to content

explorer ​

Use explorerAgent for documentation summaries, module tours, and explanations that span many files. Its built-in tools read files and sources. Use oracleAgent for a focused design judgment.

When called as an LLM tool, the explorer continues the caller's conversation. From code, wrap the call in thread { ... } when you want an isolated survey.

The model reports progress in a sentence beside each tool call, and nothing prints it by default. std::agents/lib/toolkits shows the callback that does.

Functions ​

buildTools ​

ts
buildTools(): any[]

Return the explorer's file, source, and web lookup tools.

Returns: any[]

(source)

explorerAgent ​

ts
@guarded(cost: maxCost, time: maxTime)
explorerAgent(
  question: string,
  context: string = "",
  maxCost: number = $20.00,
  maxTime: number = 15m,
  model: string = "",
  provider: string = "",
  extraTools: any[] = [],
): Result<string>

Survey a codebase or documentation and return an organized answer with sources. It never changes anything. It continues your conversation, and every file it reads stays in your history, so say how much ground to cover and scope the question tightly.

Called from code, this runs on the caller's thread like any function: the reads and the answer stay there, and the system prompt is removed when the agent finishes. Wrap the call in thread { ... } for an isolated survey.

Parameters:

NameTypeDefaultDescription
questionstringThe question and the scope to cover.
contextstring""
maxCostnumber$20.00Cost budget in USD.
maxTimenumber15mTime budget in milliseconds.
modelstring""Model override, or "" for the ambient model.
providerstring""Provider for the model override, ignored when model is empty.
extraToolsany[][]Tools to add to the built-in lookup tools.

Returns: Result<string>

Throws: std::guard

(source)