streamlit-chatbot
Streamlit Chatbotは、Claudeと連携する軽量でモジュール式のチャットボットインターフェースです。クリーンで直感的なチャットインターフェースを提供し、リアルタイムのメッセージストリーミングやセッションベースのチャット履歴をサポートしています。異なるLLMプロバイダーと簡単に拡張できる設計が特徴です。
GitHubスター
0
ユーザー評価
未評価
フォーク
0
イシュー
0
閲覧数
1
お気に入り
0
README
Streamlit Chatbot
A lightweight, modular chatbot interface built with Streamlit that connects to Claude for natural language interactions.
Features
- Clean, intuitive chat interface
- Real-time message streaming
- Session-based chat history
- Easy to extend with different LLM providers
- Responsive design with sidebar controls
Setup
- Clone the repository:
git clone <repository-url>
cd streamlit_chatbot
- Install dependencies:
pip install -r requirements.txt
- Set up environment variables:
Create a
.envfile in the project root with your API key:
ANTHROPIC_API_KEY=your-api-key-here
- Run the application:
streamlit run app.py
The app will be available at http://localhost:8501
Project Structure
app.py: Main Streamlit application with chat interfacellm.py: LLM provider abstraction layerrequirements.txt: Project dependencies
Architecture
The application uses a modular design with the following components:
- Frontend: Built with Streamlit's native chat components for a responsive and intuitive interface
- LLM Integration: Abstracted through the
LLMProviderclass, making it easy to switch between different LLM providers - Session Management: Uses Streamlit's session state to maintain chat history during user sessions
Extending
To add support for a different LLM provider:
- Create a new class that inherits from
LLMProviderinllm.py - Implement the required methods:
_initialize_model()andget_response() - Update the
get_llm_provider()factory function to return your new provider
Roadmap & Future Improvements
Persistent Chat History
- PostgreSQL/MongoDB integration for chat storage
- User session management and authentication
- Chat history search and filtering capabilities
- Export/import conversation functionality
MCP Tool Integration
- Slack integration for team collaboration
- Send/receive messages
- Channel monitoring
- Thread management
- Email integration for notifications
- Send email summaries
- Process email inquiries
- Attachment handling
- Google Docs integration
- Document processing and analysis
- Content generation
- Collaborative editing
- Custom MCP servers for each integration
- Modular server architecture
- Secure credential management
- Rate limiting and error handling
Vector Database Integration
- Pinecone setup for semantic search
- Document embedding and retrieval
- Similar conversation finding
- Knowledge base integration
- Chat history vectorization
- Contextual conversation search
- Pattern recognition
- User behavior analysis
- Enhanced context management
- Dynamic context window
- Relevance scoring
- Memory optimization
Development Timeline
Phase 1 (Current): Basic Chatbot ✓
- Streamlit interface with native chat components
- Claude integration with abstraction layer
- Session-based chat history
- Basic error handling and user feedback
Phase 2: Persistence & Search
- Database integration for permanent storage
- Vector database setup for semantic search
- Enhanced chat history management
- User authentication system
Phase 3: MCP Integration
- Tool server implementation
- External service connections
- Enhanced context handling
- Advanced error recovery
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
MIT
作者情報
スレッド