- 📖 About the Project
- 💻 Getting Started
- 👥 Authors
- 🔭 Future Features
- 🤝 Contributing
- ⭐️ Show your support
- 📝 License
IT Support RAG Assistant is a powerful API designed to automate IT support queries using Retrieval-Augmented Generation (RAG). It combines the power of Large Language Models (Google Gemini) with a local knowledge base (ChromaDB) to provide accurate, context-aware answers to user questions.
The system features robust authentication, query history tracking, automatic query clustering using machine learning, and comprehensive experiment tracking with MLflow.
- FastAPI - Modern, high-performance web framework for building APIs.
- PostgreSQL - Advanced open-source relational database.
- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper.
- LangChain - Framework for developing applications powered by LLMs.
- ChromaDB - AI-native open-source vector database.
- MLflow - Open source platform for the machine learning lifecycle.
- Google Gemini - Generative AI models.
- Hugging Face - Platform for ML models (Embeddings).
- 🔐 Secure Authentication: User registration and login with JWT-based authentication stored in HTTP-only cookies.
- 🤖 RAG-Powered QA: Retrieval-Augmented Generation pipeline to answer support queries using your knowledge base.
- 📦 Query Clustering: Automatic clustering of user queries to categorize support topics using a trained ML model.
- 📊 Experiment Tracking: Full integration with MLflow to track RAG metrics (latency, number of chunks) and query results.
- 📜 History Management: Retrieve past user queries and generated answers.
- 🐳 Dockerized: Container-ready application with Dockerfile included.
- [Live Demo Link](link to deployed project)
To get a local copy up and running, follow these steps.
- uv (Recommended for managing dependencies and environments)
- Python 3.12+ (managed by uv)
- PostgreSQL
- Docker (optional)
Clone this repository to your desired folder:
git clone https://github.com/codehass/it-support-rag-assistant.git
cd it-support-rag-assistantInstall dependencies and create the virtual environment automatically:
uv syncCreate a .env file in the root directory and add your environment variables. You can copy .env.example as a template:
cp .env.example .envRequired .env Variables:
USER_DB=postgres
PASSWORD=your_password
DATABASE_HOST=localhost
PORT=5432
DATABASE=your_database_name
# HuggingFace & Google API
HF_TOKEN=your_huggingface_token_here
GOOGLE_API_KEY=your_google_api_key_here
# Authentication
SECRET_KEY=your_secure_secret
ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES=30
FRONTEND_URL=http://localhost:3000-
Start the Database: Ensure your PostgreSQL service is running and the database is created.
-
Run the API:
uv run fastapi dev app/main.py
The API will be available at
http://localhost:8000. -
Explore Documentation: Go to
http://localhost:8000/docsfor the interactive Swagger UI. -
Start MLflow UI (Optional, for tracking):
uv run mlflow ui
Access MLflow dashboard at
http://localhost:5000.
-
Run Linting (Ruff):
uv run ruff check . -
Run Tests (Pytest):
uv run pytest
Authentication
POST /api/v1/auth/register- Register a new userPOST /api/v1/auth/login- Login to get access token (cookie)POST /api/v1/auth/logout- Logout userGET /api/v1/auth/users/me- Get current user info
RAG Support
POST /api/v1/rag/query- Ask a question to the IT Support AssistantGET /api/v1/rag/history- Get your query historyGET /api/v1/rag/health- Check backend health status
👤 Hassan El Ouardy
- GitHub: @codehass
- Twitter: @hassanelourdy
- LinkedIn: @hassanelourdy
- Voice Interface: Enable voice-to-text for querying.
- Admin Dashboard: Analytics view for IT support managers.
- Feedback Loop: User feedback mechanism to improve RAG accuracy.
Contributions, issues, and feature requests are welcome!
Feel free to check the issues page.
If this project helps you, give it a ⭐️!
This project is MIT licensed.
