lloyal-agents API Reference
    Preparing search index...

    Class ResearchTool

    Spawn parallel research agents for sub-questions (corpus source)

    Creates a withSharedRoot | shared root and runs a useAgentPool | pool of research agents, one per question. Each agent has access to the full toolkit (search, read_file, grep, report). Agents that hit the turn limit without reporting are forced through a reporter pass that extracts partial findings.

    Call setToolkit() before first execution to wire the toolkit into the sub-agent pool.

    Hierarchy

    • Tool<{ questions: string[] }>
      • ResearchTool
    Index

    Constructors

    Properties

    description: "Spawn parallel research agents to investigate sub-questions. Each question gets its own agent." = 'Spawn parallel research agents to investigate sub-questions. Each question gets its own agent.'

    Human-readable description shown to the model

    name: "research" = 'research'

    Tool name — used as the function identifier in tool calls

    parameters: JsonSchema = ...

    JSON Schema describing the tool's expected arguments

    Methods

    • Execute the tool with parsed arguments

      Called by the agent pool when the model emits a tool call matching this tool's name. The return value is JSON-serialized and prefilled back into the agent's context as a tool result.

      Returns an Effection Operation — implement as a generator method. The operation runs inside the agent pool's scope, so it has access to Ctx, Store, and Events contexts for nested agent spawning.

      Parameters

      • args: { questions: string[] }

        Parsed arguments from the model's tool call

      Returns Operation<unknown>

      Tool result (will be JSON-serialized)

    • Inject the toolkit that sub-agents will use. Must be called before execute.

      Parameters

      • toolkit: Toolkit

      Returns void