An AI-powered chat application with document upload, smart search, and user authentication. Built for efficiency with minimal memory footprint (~250MB).
A conversational AI assistant that lets users:
- Chat with an intelligent AI powered by OpenRouter API
- Upload documents (PDF, DOCX, TXT) and ask questions about them
- Get context-aware responses using recent text search
- Save chat history and documents securely
- 💬 AI Chat - Real-time conversation with OpenRouter API
- 📄 Document Upload - Extract and search from PDFs, Word docs, and text files
- 🔍 Smart Search - Retrieve relevant document content and memory
- 🔐 Google OAuth - Secure user authentication
- 👥 Multi-user Support - Isolated sessions for each user
- 📱 Mobile-Friendly - Responsive design with PWA support
- ⚡ Ultra-Lightweight - Only ~250MB for deployment (free Render tier compatible)
- Backend: FastAPI, Uvicorn, Supabase
- Frontend: HTML, CSS, JavaScript (vanilla, no frameworks)
- AI: OpenRouter (LLM API)
- Auth: Google OAuth 2.0, JWT tokens
- Cloud: Supabase (database), Docker-ready
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txtcp .env.example .envAdd to .env:
OPENROUTER_API_KEY=your_api_key
SUPABASE_URL=your_supabase_url
SUPABASE_KEY=your_supabase_keypython app.py
# Open http://localhost:8000rebot-ai/
├── app.py # Main FastAPI application
├── auth.py # Google OAuth & JWT
├── rag.py # Semantic search & embeddings
├── requirements.txt # Dependencies
├── Dockerfile # Docker setup
├── static/
│ ├── index.html # UI
│ ├── style.css
│ └── script.js
├── uploads/ # User uploaded files
└── vector_db/ # Local vector database
docker build -t rebot-ai .
docker run -p 8000:8000 \
-e OPENROUTER_API_KEY=your_key \
rebot-ai- Push to GitHub
- Connect to deployment platform
- Set environment variables
- Deploy
| Endpoint | Method | Purpose |
|---|---|---|
/ |
GET | Web interface |
/api/chat |
POST | Send chat message |
/api/upload |
POST | Upload document |
/auth/google |
POST | Google login |
Uses Google OAuth 2.0 for secure login. JWT tokens are generated for API access.
- See
AUTHENTICATION.mdfor auth setup - See
DEPLOYMENT.mdfor deployment specifics - See
DATABASE_SETUP.sqlfor Supabase schema
Ready to use! Install dependencies and run python app.py to get started.
Returns the web interface (index.html)
Health check endpoint for monitoring
curl http://localhost:8000/health
# {"status": "ok", "message": "Server is running"}Send a chat message
curl -X POST http://localhost:8000/chat \
-H "Content-Type: application/json" \
-d '{"message": "Hello!"}'
# {"reply": "Hello! How can I assist you?"}Upload a document (PDF, DOCX, TXT)
curl -X POST http://localhost:8000/upload \
-F "file=@document.pdf"OPENROUTER_API_KEY=your_api_key # For AI responses
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_KEY=your_anon_key # For data storage┌─────────────────────────┐
│ Web Interface (HTML) │
│ (static/index.html) │
└────────────┬────────────┘
│
┌────────────▼────────────┐
│ FastAPI Server │
│ - Chat endpoint │
│ - Upload endpoint │
│ - Health check │
└────────────┬────────────┘
│
┌───────┴───────┐
│ │
┌────▼─────┐ ┌─────▼──────┐
│ RAG Engine │ OpenRouter │
│ (rag.py) │ API │
└────┬─────┘ └────────────┘
│
┌──┴──────────────────┐
│ │
┌─▼────────┐ ┌───────▼──┐
│ChromaDB │ │Supabase │
│(Vector) │ │(Backup) │
└──────────┘ └──────────┘
- AI-powered conversation with memory
- Automatically retrieves relevant document context
- Integrates with OpenRouter for LLM access
- Supports PDF, DOCX, TXT files
- Automatic chunking and embedding
- Semantic search for relevant context
- Max file size: 20,000 characters
- ChromaDB for local vector storage
- Supabase for backup and persistence
- Automatic memory retrieval during chat
🎯 Total Size: ~450MB | Status: ✅ Optimized