InfoGatherer
InfoGatherer is a pre-built agent that collects answers to a series of questions. It handles the conversation flow automatically, including optional confirmation of critical answers and dynamic question selection.
Basic Usage
Python
TypeScript
Question Format
Constructor Parameters
Importing InfoGathererAgent
Flow Diagram

Built-in Functions
InfoGatherer provides these SWAIG functions automatically:
Dynamic Questions
Instead of static questions, use a callback to determine questions at runtime:
Accessing Collected Data
The collected answers are stored in global_data:
Complete Example
Implementation Notes
InfoGatherer uses replace_in_history() internally to keep the conversation history clean. Each question/answer exchange is replaced in the LLM history so that the conversation context stays focused and doesn’t grow excessively with repetitive tool call entries. This is transparent to the user — they experience a natural conversation flow.
Best Practices
Questions
- Keep questions clear and specific
- Use confirm=true for critical data (email, phone)
- Limit to 5-7 questions max per session
- Order from simple to complex
key_name Values
- Use descriptive, unique identifiers
- snake_case convention recommended
- Match your backend/database field names
Dynamic Questions
- Use callbacks for multi-purpose agents
- Validate questions in callback
- Handle errors gracefully