A legal document question-answering system built with RAG (Retrieval-Augmented Generation) using LangChain, FAISS, and Llama3.
- Extract text from PDF legal documents
- Build vector store for efficient document retrieval
- FastAPI web server for question answering
- Local LLM integration with Ollama (Llama3)
- CORS enabled for frontend integration
- Install dependencies:
pip install -r requirements.txt- Extract PDF texts:
python extract_pdf_to_json.py- Build vector store:
python build_vectorstore.py- Run the FastAPI server:
uvicorn app:app --reloadGET /- Welcome pagePOST /ask- Submit legal questions
- Python 3.11+
- Ollama with Llama3 model installed
- PDF documents in the
pdfs/folder