Case study
A Nepali legal research assistant that combines a Django backend, vector search, and a chat interface for grounded question answering.
Users needed a way to ask legally relevant questions in Nepali while keeping evidence grounded in trusted source material and isolated per-conversation document retrieval.
Implemented the backend + retrieval pipeline, conversation flow, and document management structure for a RAG-based legal assistant.
A full-stack Retrieval-Augmented Generation (RAG) chatbot for Nepali legal research. The backend is Django REST + ChromaDB, the frontend is Vite/React with Tailwind. Users can start conversations, upload per-conversation PDFs, and get grounded answers with source file badges.
GROQ_API_KEYgit clone <repo-url>
cd SevaBot-A-RAG-based-nepali-chatbot
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
.env or export before run)
DJANGO_SETTINGS_MODULE=backend.settingsSECRET_KEY=<django-secret>GROQ_API_KEY=<your-groq-key>CHROMADB_PATH=<absolute_path_to_chromadb_data> (default: ./chromadb_data)python manage.py migrate
permanent_knowledge/, then:
python manage.py load_permanent_knowledge --knowledge-dir=permanent_knowledge
# use --force-reload to rebuild the permanent collection
python manage.py runserver
Verified from the local repository folder D:\SevaBot-A-RAG-based-nepali-chatbot and its README instructions.
In development
cd frontend
npm install
npm run dev
http://localhost:8000/api. Adjust frontend/src/services/api.js if you change the backend host/port.chromadb_data/ (vector store) – auto-created at runtime.db.sqlite3 (Django DB) – create locally via migrations.media/pdfs/) – user data.permanent_knowledge/ locally; not tracked in git.chromadb_data/, rerun loaders.load_permanent_knowledge are safe on CPU-only boxes.ocrmypdf input.pdf output.pdf) and reload.ModuleNotFoundError: django: activate venv (source venv/bin/activate).GROQ_API_KEY env var.source_file metadata exists; permanent loader sets it from the PDF filename.# backend
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python manage.py migrate
python manage.py load_permanent_knowledge --knowledge-dir=permanent_knowledge # optional
python manage.py runserver
# frontend (new terminal)
cd frontend
npm install
npm run dev
Visit the frontend (default http://localhost:5173) and start chatting.