Creating Dynamic User Inputs
Learn to dynamically render user choices, gather additional context interactively, and enhance decision-making within your AI agents.
Last updated
Learn to dynamically render user choices, gather additional context interactively, and enhance decision-making within your AI agents.
Last updated
Dynamic user inputs allow your AI workflows to adapt and respond to earlier outputs by presenting users with choices or prompts that reflect prior data. This approach makes your AI agents more interactive, relevant, and powerful.
In a basic setup, you might scrape a URL and extract entities (e.g., people, organizations) mentioned in an article. The next step could involve presenting the user with these entities to choose one for further research.
To do this:
Use a Generate Text block to return a list of entities in a specific JSON format.
The JSON should be an array of objects, each with label
and subtitle
keys:
Save this as a variable, e.g., entities
.
Add a User Input block.
Select Text Choice.
Set the prompt (e.g., "Which entity would you like to research further?").
Under Dynamic Source, specify the variable holding your JSON (e.g., entities
).
The selected label
will be stored as the input value.
This enables workflows to dynamically populate input options based on AI-generated data.
Sometimes user input is too broad (e.g., just entering "dogs"). To handle this, MindStudio offers a User Context block to gather deeper context through AI-generated questions.
Collect a general topic input from the user.
Use a User Context block:
Set the topic as input.
Provide a prompt like: "Help the user refine the topic they’d like to research. Gather more contextual information in order to perform a full research report."
Choose the Interview Depth (Quick, Medium, or Thorough).
Set a Maximum Question Limit.
Save the results in a variable, e.g., topicDetails
.
Use topicDetails
downstream to:
Generate refined search queries
Provide detailed context to summarization or report-generation blocks
This results in much more specific, targeted output.
Collect topic
from the user.
Run a User Context block to gather more details.
Use topicDetails
to generate Google search queries.
Scrape and summarize each result in sub-workflows.
Aggregate findings and generate a detailed report.
This method creates highly accurate and contextual results.
User-Adaptive: Tailors the experience based on AI or previous input
Flexible: Works with structured JSON or free-text context
Scalable: Enables detailed processing of dynamic lists or open-ended tasks
Use dynamic user inputs when:
The user's next step should be informed by previous AI outputs
You need to collect deeper, more relevant context
You want to make AI workflows more flexible and responsive
Dynamic inputs are essential for building smart, adaptive AI agents that can guide users and gather meaningful context in real time.