Skip to content

feat: Add Streamlit chat demo with multi-agent routing#415

Open
OlegHQ wants to merge 5 commits intoawslabs:mainfrom
OlegHQ:fix/issue-173
Open

feat: Add Streamlit chat demo with multi-agent routing#415
OlegHQ wants to merge 5 commits intoawslabs:mainfrom
OlegHQ:fix/issue-173

Conversation

@OlegHQ
Copy link

@OlegHQ OlegHQ commented Jan 10, 2026

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 application
  • examples/python/chat-demo/weather_tool.py - Weather API tool integration
  • examples/python/chat-demo/README.md - Documentation with architecture and examples

Files modified:

  • examples/python/imports.py - Added boto3 and streamlit imports
  • examples/python/main-app.py - Integrated chat demo as new page
  • examples/python/pages/home.py - Added chat demo to navigation
  • examples/python/readme.md - Updated documentation

User 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

cd examples/python
pip install -r requirements.txt
streamlit run main-app.py
# Navigate to Chat Demo page and test queries

All existing tests pass (97/97):

npm test
# Test Suites: 11 passed, 11 total
# Tests: 97 passed, 97 total

Checklist

If your change doesn't seem to apply, please leave them unchecked.

  • I have performed a self-review of this change
  • Changes have been tested
  • Changes are documented
  • I have linked this PR to an existing issue (required)
Is this a breaking change? No

RFC issue number:

Checklist:

  • Migration process documented
  • Implement warnings (if it can live side by side)

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.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: Chat demo in streamlit

1 participant