A newer version of the Streamlit SDK is available: 1.62.0
metadata
title: Matrix AI Chat with RAG
emoji: πΆοΈ
colorFrom: gray
colorTo: green
sdk: streamlit
sdk_version: 1.28.0
app_file: app.py
pinned: false
license: mit
πΆοΈ Matrix AI Chat with RAG
Enter the Matrix - Advanced AI chat with Retrieval-Augmented Generation (RAG) and multiple AI models.
β¨ Features
- Multi-Model Support: DeepSeek-R1, Llama-3.2-3B, Qwen2.5-VL-7B
- RAG System: Upload documents for context-aware responses
- Matrix UI: Cyberpunk green-on-black theme with animations
- Smart Memory: Persistent chat history and similarity search
- Session Management: Save/load conversations with unique IDs
π Quick Start
- Set HF Token: Add your Hugging Face token in Space settings
- Select Model: Choose from available AI models in sidebar
- Chat: Start conversing with Matrix-style streaming
- Upload Data: Add documents via "KNOWLEDGE MATRIX" section
π§ Configuration
Required Environment Variables
HF_TOKEN: Your Hugging Face API token with inference access
Supported Models
- DeepSeek-R1: Advanced reasoning (Together AI)
- Llama-3.2-3B: Efficient local model
- Qwen2.5-VL-7B: Vision-language model (Hyperbolic)
π Usage
Basic Chat
- Select AI model from sidebar
- Enter message in chat input
- Watch Matrix-style streaming response
RAG Documents
- Open "UPLOAD DATA" in sidebar
- Add title and content
- Click "INJECT DATA"
- AI will reference your documents automatically
Session Controls
- NEW JACK IN: Start fresh session
- PURGE ALL: Clear all data (double-click to confirm)
π οΈ Local Development
# Clone and install
git clone <repo-url>
pip install streamlit numpy sentence-transformers scikit-learn transformers torch huggingface-hub openai
# Set token and run
export HF_TOKEN="your_token_here"
streamlit run app.py
π¨ Troubleshooting
No HF Token Found
- Add
HF_TOKENto Space settings β Repository secrets
Model Connection Failed
- Check token validity and quota
- Verify internet connection
- Try different model
Data Not Saving
- Ensure sufficient storage space
- Check write permissions
π Data Storage
data/sessions/: Chat history and metadatadata/documents/: RAG documents and embeddingsdata/embeddings/: Vector embeddings for similarity search
All data persists between sessions. Use "PURGE ALL" to reset.
Welcome to the Matrix. The choice is yours. πΆοΈ