A web-based chatbot interface for the Open Source Mentor Bot hackathon project. This application allows users to upload documentation files, vectorize them, and interact with an AI mentor powered by LiteMAAS and Qdrant vector database.
- File Upload & Vectorization: Upload PDF, TXT, MD, and DOCX files
- Semantic Search: Find relevant documentation chunks using Qdrant vector database
- Chat Interface: Interactive conversation with AI mentor
- Dark Mode: Toggle between light and dark themes
- Real-time Processing: Progress tracking for file uploads
- Statistics Dashboard: View vectorization metrics
- Responsive Design: Works on desktop and mobile devices
- Red Hat Values: Built with open collaboration principles
βββββββββββββββββββββββ
β Frontend (React) β
β - File Upload β
β - Chat Interface β
β - Vectorization UI β
ββββββββββββ¬βββββββββββ
β HTTP/JSON
ββββββββββββΌβββββββββββ
β FastAPI Backend β
β - File Processing β
β - Vectorization β
β - Query Handling β
ββββββββββββ¬βββββββββββ
β
ββββββββββββΌβββββββββββ
β β β
β ββββββββΌβββ βββββΌβββββββββ
β β LiteMAASβ β Qdrant β
β β- LLM In β β- Vector DB β
β β- Embed. β β- Search β
β βββββββββββ ββββββββββββββ
βββββββββββββββββββββββββββββββββββ
- All vector search and document chunk storage is powered by Qdrant
- Qdrant runs as a container in the
servicessection of each team compose file - You can inspect the live database at http://localhost:6333 (default admin interface)
- Adapters for Qdrant are integrated in backend Python code via
qdrant-client
- All builds use
Containerfile(OCI-compatible, works seamlessly with Docker if needed) - Multi-container local dev and deployment is via
podman-compose - OpenShift- and Kubernetes-ready by design
- Vendor-neutral, dockerless container infrastructure
services:
qdrant:
image: qdrant/qdrant:v1.7.3
ports:
- 6333:6333
backend:
build: ./Backend
depends_on:
- qdrant
environment:
- QDRANT_HOST=qdrant
- LITEMAAS_BASE_URL=http://litemaas:8000
frontend:
build: ./Frontend
ports:
- 8000:8000
depends_on:
- backend- Docker & Docker Compose (or Podman & Podman Compose)
- Python 3.11+ (for local development)
- Node.js (optional, for development tools)
-
Clone and navigate to project:
git clone <repo> cd mentor-bot
-
Create environment file:
cp .env.example .env # Edit .env with your configuration -
Install dependencies:
pip install -r requirements.txt
-
Start the server:
python server.py
-
Open browser:
http://localhost:8000
-
Build image:
podman build -t mentor-bot:latest . -
Run with Compose:
podman-compose up -d
-
Access application:
http://localhost:8000 -
Access Qdrant interface:
http://localhost:6333
-
Set environment variables:
export TEAM_SUBDOMAIN=team1 export HOST_SUFFIX=192.168.1.100.sslip.io export LITEMAAS_BASE_URL=http://litemaas:8000 export LITEMAAS_API_KEY=your-key export QDRANT_HOST=qdrant
-
Deploy with compose:
podman-compose -f compose.yaml up -d
-
Access via Traefik routing:
http://team1.192.168.1.100.sslip.io
mentor-bot/
βββ index.html # Main HTML page
βββ styles.css # Styling and layout
βββ app.js # Frontend application logic
βββ server.py # FastAPI backend server
βββ requirements.txt # Python dependencies
βββ Containerfile # Container image definition
βββ compose.yaml # Docker Compose configuration
βββ .env.example # Environment template
βββ README.md # This file
βββ DEPLOYMENT.md # Deployment documentation
βββ DEVELOPMENT.md # Development guide
βββ GUIDE.md # Team-specific information
| Variable | Description | Default |
|---|---|---|
LITEMAAS_BASE_URL |
LiteMAAS API endpoint | http://litemaas:8000 |
LITEMAAS_API_KEY |
API authentication key | dev-key |
LITEMAAS_MODEL |
Model to use for inference | Llama-4-Scout-17B |
QDRANT_HOST |
Qdrant server host | localhost |
QDRANT_PORT |
Qdrant server port | 6333 |
TEAM_SUBDOMAIN |
Traefik subdomain | team1 |
HOST_SUFFIX |
Domain suffix (sslip.io) | localhost |
UPLOAD_DIR |
Directory for uploaded files | /tmp/mentor_bot_uploads |
PORT |
Server port | 8000 |
- PDF (
.pdf) - Requires pdfplumber for full extraction - Markdown (
.md) - Full support - Text (
.txt) - Full support - Word (
.docx) - Requires python-docx for full extraction
Maximum file size: 10MB
- Upload files (PDF/TXT/MD/DOCX) from browser
- Files are split and embedded (Locally or via cloud LLM)
- Chunks stored & indexed in Qdrant
- User asks questions in chat interface
- Backend retrieves relevant chunks from Qdrant, sends to LiteMAAS
- LLM generates answer shown in UI
- Click the upload area or drag files
- Select supported file formats
- Wait for vectorization to complete
- View progress in the stats panel
- Type a question in the chat input
- Press Enter or click Send
- Bot searches vectorized documents in Qdrant
- Response based on relevant content + LiteMAAS inference
- View all uploaded files in the sidebar
- See file size, status, and chunk count
- Remove files with the Γ button
- Stats update automatically
GET /health
GET /api/statsPOST /api/upload
GET /api/files/{file_id}
DELETE /api/files/{file_id}POST /api/query
{
"query": "How to contribute to open source?",
"context": "Optional additional context"
}- File Extraction: Text content extracted from uploaded file
- Chunking: Content split into overlapping ~512 character chunks
- Embedding: Each chunk converted to numerical vector via LiteMAAS or local model
- Storage: Chunks indexed in Qdrant vector database
- Search: Query matched against chunks using vector similarity scoring
The application uses Qdrant for scalable, high-performance vector storage:
- Cosine similarity on embeddings
- Persistent vector database
- REST API for query operations
- Real embedding models via LiteMAAS or specialized services
The bot integrates with LiteMAAS for:
- LLM Inference: Generate responses based on context
- Embeddings: Generate numerical vectors for semantic search
- Model Selection: Switch between available models (e.g., Llama-4-Scout-17B)
Fallback Behavior:
- If LiteMAAS unavailable: Uses local response generation
- If embedding fails: Uses deterministic hash-based vectors
- Graceful degradation ensures application stays functional
- Header: Branding, theme toggle
- Sidebar: File upload, document list, stats
- Chat Area: Message display, input field
- Theme Toggle: Light/Dark mode (persisted to localStorage)
- Desktop: Full sidebar + chat layout
- Tablet: Flexible layout
- Mobile: Stacked layout with scrolling
The stats panel shows:
- Total Files: Number of uploaded documents
- Documents: Processed documents
- Total Chunks: Combined text chunks from all files stored in Qdrant
Example: 3 files β 4 documents (with redundancy) β 247 chunks
- Upload a markdown file with documentation
- Ask questions about the content
- Verify responses use uploaded documents
- Test file deletion
- Toggle dark mode
- Test on mobile
# Upload file
curl -X POST -F "file=@document.pdf" http://localhost:8000/api/upload
# Query
curl -X POST http://localhost:8000/api/query \
-H "Content-Type: application/json" \
-d '{"query": "Tell me about open source"}'
# Get stats
curl http://localhost:8000/api/stats
# Check Qdrant
curl http://localhost:6333/health- File too large: Shows error, doesn't upload
- Unsupported format: Rejects with helpful message
- API unavailable: Falls back to local responses
- No documents: Prompts user to upload files
- Qdrant unavailable: Returns error with helpful troubleshooting steps
All errors logged to server console for debugging.
β οΈ No authenticationβ οΈ No input validationβ οΈ In-memory storage (lost on restart)β οΈ Qdrant accessed without credentials (development mode)
- Add authentication (OAuth, API keys)
- Validate file content, not just extension
- Use persistent database (PostgreSQL + vector extension)
- Enable Qdrant API key authentication
- Implement rate limiting
- Sanitize LLM inputs
- Add audit logging
- Use HTTPS/TLS
- Containerize with read-only root filesystem
- Advanced vector database configuration
- Advanced RAG (Retrieval-Augmented Generation)
- Multi-language support
- User authentication & file permissions
- File preview in UI
- Streaming responses
- Export chat history
- Admin dashboard with Qdrant metrics
- Kubernetes manifests
- OpenShift deployment templates
- GitOps integration (ArgoCD)
- CI/CD pipeline (GitHub Actions)
- Helm charts for Qdrant + Backend
To contribute improvements:
- Make changes in isolated branch
- Document your changes
- Test locally with
podman-compose - Submit PR with description
- Follow Red Hat values principles
See CONTRIBUTING.md for detailed guidelines.
- FastAPI backend:
teams/team1/Backend/orteams/team2/services/ - Qdrant config: In
compose.yamlunder each team, and asqdrantservice - Frontend:
teams/team1/Frontend/orteams/team2/static/ - Compose, Containerfile: at team root
- Source code publicly available
- Clear architecture documentation
- Template setup for team contributions
- Encouraged to fork and modify
- Logging of all operations
- Clear error messages
- Stats visible to users
- Architecture clearly documented
- Helps beginners learn open source
- Answers questions from uploaded docs
- Encourages documentation sharing
- Built for hackathon collaboration
- Containerized deployment with Podman
- Automated vectorization pipeline
- Background file processing
- Health checks built-in
- Respects user uploads
- No external data tracking
- Clear data handling practices
- Simple, auditable code
# Check logs
podman logs mentor-bot
# Verify port availability
lsof -i :8000
# Check environment variables
env | grep LITEMAAS
env | grep QDRANT# Check if Qdrant container is running
podman ps | grep qdrant
# Check Qdrant logs
podman logs qdrant
# Verify port 6333 is accessible
curl http://localhost:6333/health
# Verify QDRANT_HOST environment variable
echo $QDRANT_HOST- Check file size (max 10MB)
- Verify file format (PDF, TXT, MD, DOCX)
- Check disk space in UPLOAD_DIR
- View browser console for errors
- Verify Qdrant is running and accessible
- Verify LiteMAAS is running and accessible
- Check LITEMAAS_API_KEY is correct
- Verify Qdrant connection in server logs
- Look for API errors in server logs
- Try local response generation (disable API temporarily)
- Reduce chunk size in config
- Limit number of documents indexed
- Increase Qdrant vector cache
- Implement caching for frequent queries
- Check Qdrant admin interface for optimization tips at http://localhost:6333
- Check logs:
podman logs mentor-bot - Review API endpoints:
http://localhost:8000/docs(Swagger) - View Qdrant dashboard:
http://localhost:6333 - See configuration: Check
.envfile - Full documentation: See
DEPLOYMENT.md,DEVELOPMENT.md,GUIDE.md - Red Hat documentation: Red Hat Knowledge Base
GPL-3.0 (as per parent project)
- Built for Red Hat Hackathon: "Open Source Mentor Bot"
- Qdrant for blazing fast and scalable semantic search
- Podman used for vendor-neutral, dockerless container infrastructure
- LiteMAAS for LLM inference
- Inspired by open collaboration and Red Hat values
- Community contributions welcome!
Team repository structure has been modularized for multiple team experiments (teams/team1, teams/team2) β the team2 folder was used for our final pitch
I, Mihael Atanasov, worked on a second autonomous approach (team1) for my personal learning effect. --> NOT FULLY FUNCTIONAL ANYMORE