feat: Add Streamlit chat demo with multi-agent routing#415
Open
OlegHQ wants to merge 5 commits intoawslabs:mainfrom
Open
feat: Add Streamlit chat demo with multi-agent routing#415OlegHQ wants to merge 5 commits intoawslabs:mainfrom
OlegHQ wants to merge 5 commits intoawslabs:mainfrom
Conversation
Add a new Streamlit-based chat demo to the Python examples that showcases the core multi-agent routing functionality of Agent Squad. The demo includes: - Tech Agent for technology and programming questions - Health Agent for wellness and medical information - Weather Agent with Open-Meteo API integration for live weather data - Math Agent with a safe expression evaluator The chat interface demonstrates automatic agent selection via BedrockClassifier, persistent conversation history, and real-time streaming responses. Fixes awslabs#173
- Remove insecure eval() usage in calculate() function - Use AST parsing with explicit operator whitelist - Remove broken screenshot reference from README Security improvement to prevent code injection attacks.
Use latest Claude Haiku 4.5 (anthropic.claude-haiku-4-5-20251001-v1:0) instead of the older Claude 3 Haiku model for better performance.
Pass classifier to AgentSquad constructor instead of calling non-existent set_classifier() method. The classifier parameter must be provided at initialization time.
- Rename README.md to readme.md (match repo convention) - Fix Python version: 3.8 -> 3.11 (per setup.cfg) - Simplify to ~35 lines (match other example READMEs) - Apply human-writing style: terse, natural language
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue Link (REQUIRED)
Fixes #173
Summary
Changes
Added a Streamlit-based chat demo showcasing the Agent Squad's intelligent routing capabilities. The demo includes four specialized agents (Tech, Health, Weather, Math) with the BedrockClassifier automatically routing queries to the appropriate agent.
Files added:
examples/python/chat-demo/chat-demo.py- Main Streamlit applicationexamples/python/chat-demo/weather_tool.py- Weather API tool integrationexamples/python/chat-demo/README.md- Documentation with architecture and examplesFiles modified:
examples/python/imports.py- Added boto3 and streamlit importsexamples/python/main-app.py- Integrated chat demo as new pageexamples/python/pages/home.py- Added chat demo to navigationexamples/python/readme.md- Updated documentationUser experience
Before: No interactive chat demo available to showcase agent routing
After: Users can run a Streamlit chat interface demonstrating real-time agent classification and routing with persistent conversation history
Verification
Environment: Darwin 25.0.0 (arm64)
Runtime: Node 24.11.1, Python 3.13.9
Test Steps
All existing tests pass (97/97):
Checklist
If your change doesn't seem to apply, please leave them unchecked.
Is this a breaking change?
NoRFC issue number:
Checklist:
Acknowledgment
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.