A Streamlit-based user interface that can be used with any text-based Bedrock agent by updating the config.py
file.
To add your own agent:
- Add a new configuration to the
bot_configs
list inconfig.py
:
{
"bot_name": "Your Bot Name", # Display name in the UI
"agent_name": "your_agent_id", # Your Bedrock agent ID
"start_prompt": "Initial message to show users",
"session_attributes": { # Optional: Include if your agent needs specific session attributes
"sessionAttributes": { # Custom key-value pairs for your agent's session
"key1": "value1",
"key2": "value2"
},
"promptSessionAttributes": {} # Additional prompt-specific attributes if needed
}
}
The following demos have been tested with this UI and can be found in their respective folders:
- Sports Team Poet (
/examples/multi_agent_collaboration/team_poems_agent/
): Creates poems about sports teams - Portfolio Assistant (
/examples/multi_agent_collaboration/portfolio_assistant_agent/
): Analyzes stock tickers - Trip Planner (
/examples/multi_agent_collaboration/trip_planner_agent/
): Generates travel itineraries - Voyage Virtuoso (
/examples/multi_agent_collaboration/voyage_virtuoso_agent/
): Provides exotic travel recommendations - Mortgages Assistant (
/examples/multi_agent_collaboration/mortgage_assistant/
): Handles mortgage-related queries - Custom Orchestration (
/examples/agents/custom_orchestration_agent/
): Demonstrates ReWoo (Reasoning without Observation) orchestration for a restaurant assistant agent
-
Follow the setup instructions in each agent's respective folder before using them in the demo UI:
/examples/multi_agent_collaboration/mortgage_assistant/README.md
/examples/multi_agent_collaboration/voyage_virtuoso_agent/README.md
/examples/multi_agent_collaboration/trip_planner_agent/README.md
/examples/multi_agent_collaboration/team_poems_agent/README.md
/examples/agents/custom_orchestration_agent/README.md
/examples/multi_agent_collaboration/portfolio_assistant_agent/README.md
-
Ensure you have:
- Python 3.x
- AWS credentials configured with appropriate permissions
-
Create and activate a Python virtual environment:
python3 -m venv .venv source .venv/bin/activate
-
Install required dependencies:
pip install -r src/requirements.txt
-
Configure your AWS credentials with appropriate permissions
-
Run the Streamlit application:
cd examples/agents_ux/streamlit_demo/; streamlit run demo_ui.py
-
Optionally, specify a specific bot using the BOT_NAME environment variable:
BOT_NAME="<bot-name>" streamlit run demo_ui.py
Supported BOT_NAME values:
- "Portfolio Assistant"
- "Sports Team Poet"
- "Trip Planner"
- "Voyage Virtuoso"
- "Mortgages Assistant" (default)
- "Custom Orchestration"
- The UI will display the selected bot's interface (defaults to Mortgages Assistant if not specified)
- Enter your query in the chat input field
- The agent will:
- Process your request
- Show the collaboration between different agents
- Display thought processes and tool usage
- Provide a detailed response
The demo UI integrates with Amazon Bedrock Agent Runtime for agent execution and showcases multi_agent_collaboration features including:
- Dynamic routing between specialized agents
- Knowledge base lookups
- Tool invocations
- Code interpretation capabilities
Below is an example of the demo UI in action, showing the Mortgages Assistant interface: