For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Log inSign up
Support
GuidesReference
GuidesReference
    • Core
      • Overview
    • Agents
      • Overview
      • AgentBase
      • AgentServer
      • Configuration
      • ContextBuilder
      • DataMap
      • FunctionResult
      • Helper Functions & Utilities
      • LiveWire
      • PomBuilder
      • Prefabs
        • ConciergeAgent
        • FAQBotAgent
        • InfoGathererAgent
        • ReceptionistAgent
        • SurveyAgent
      • SkillBase
      • SkillManager
      • SkillRegistry
      • Skills
      • SwaigFunction
      • SwmlBuilder
      • SWMLService
    • RELAY
      • Overview
      • Actions
      • Call
      • Constants
      • Events
      • Message
      • RelayClient
      • RelayError
    • REST Client
      • Overview
      • Addresses
      • Calling
      • ChatResource
      • Compat
      • Datasphere
      • Fabric
      • ImportedNumbersResource
      • Logs
      • LookupResource
      • MFA
      • Number Groups
      • Phone Numbers
      • Project
      • PubSubResource
      • Queues
      • Recordings
      • Registry
      • RestClient
      • RestError
      • Short Codes
      • SIP Profile
      • Verified Callers
      • Video
LogoLogoSignalWire Docs
Log inSign up
Support
On this page
  • InfoGathererConfig
  • questions
  • questionCallback
  • name
  • route
  • agentOptions
  • Methods
  • setQuestionCallback
  • Built-in Tools
  • Example — static mode
  • Example — dynamic mode
  • createInfoGathererAgent
AgentsPrefabs

InfoGathererAgent

|View as Markdown|Open in Claude|
Was this page helpful?
Edit this page
Previous

ReceptionistAgent

Next
Built with

Sequentially asks a caller a list of questions and stores each answer in global_data. Supports static mode (questions provided at construction) and dynamic mode (questions resolved per request via a callback).

1import { InfoGathererAgent } from '@signalwire/sdk';
2
3const agent = new InfoGathererAgent({ /* InfoGathererConfig */ });

InfoGathererConfig

questions
InfoGathererQuestion[]

Questions to ask (static mode). Each InfoGathererQuestion has:

  • key_name (string, required) — key used to store the caller’s answer.
  • question_text (string, required) — the question to ask.
  • confirm (boolean) — when true, the agent insists the caller confirms the answer before moving on.

Omit this field to run the agent in dynamic mode (see questionCallback / setQuestionCallback()).

questionCallback
InfoGathererQuestionCallback

Convenience alternative to calling setQuestionCallback() after construction. Consulted only when questions is not provided. Signature:

1(queryParams, bodyParams, headers) => InfoGathererQuestion[] | Promise<InfoGathererQuestion[]>

If the callback throws or is not registered in dynamic mode, the agent falls back to a built-in two-question list (name + “how can I help”).

name
stringDefaults to "info_gatherer"

Agent display name.

route
stringDefaults to "/info_gatherer"

HTTP route for the agent.

agentOptions
Partial<AgentOptions>

Additional AgentBase options forwarded to the constructor.

Methods

setQuestionCallback

1setQuestionCallback(callback: InfoGathererQuestionCallback): this

Register (or replace) the callback that resolves questions per request. Only used in dynamic mode (when questions was not supplied at construction).

Built-in Tools

ToolDescription
start_questionsBegin the question sequence with the first question.
submit_answerSubmit the caller’s answer to the current question and advance.

Example — static mode

1import { InfoGathererAgent } from '@signalwire/sdk';
2
3const agent = new InfoGathererAgent({
4 questions: [
5 { key_name: 'full_name', question_text: 'What is your full name?' },
6 { key_name: 'email', question_text: 'What is your email address?', confirm: true },
7 { key_name: 'issue', question_text: 'How can we help you today?' },
8 ],
9 name: 'intake-agent',
10});
11
12agent.serve();

Example — dynamic mode

1import { InfoGathererAgent, type InfoGathererQuestion } from '@signalwire/sdk';
2
3const agent = new InfoGathererAgent({
4 questionCallback: async (queryParams) => {
5 const tenant = queryParams['tenant'] ?? 'default';
6 const rows = await db.loadQuestions(tenant);
7 return rows.map<InfoGathererQuestion>((r) => ({
8 key_name: r.key,
9 question_text: r.prompt,
10 confirm: r.requiresConfirmation,
11 }));
12 },
13});
14
15agent.serve();

createInfoGathererAgent

1import { createInfoGathererAgent } from '@signalwire/sdk';
2
3const agent = createInfoGathererAgent({
4 questions: [
5 { key_name: 'name', question_text: 'What is your name?' },
6 { key_name: 'issue', question_text: 'Describe your issue' },
7 ],
8});