Skip to content
Back to all work

LegalMind AI

A question-answering system over legal documents. Upload PDFs, ask in plain English, and get answers with citations to the exact passages they came from.

Type
AI, retrieval-augmented generation
Status
Open source
Built with
Python, LangChain, FAISS, HuggingFace embeddings, Groq, Streamlit
Links
View the code

The problem

Legal and religious texts are long, dense and full of cross-references. Finding the paragraph that answers a specific question means reading far more than you need to, and a general chatbot will happily invent an answer that sounds right.

What I built

A retrieval-augmented generation (RAG) system. Documents are split into chunks, turned into embeddings with HuggingFace sentence transformers and indexed in FAISS. When someone asks a question, the most relevant chunks are retrieved and passed to a fast LLM on Groq, which answers using only that material.

  • Works with PDF and text files
  • Every answer shows the source passages it was built from
  • Choose which documents to search
  • Adjustable chunk size, overlap and temperature
  • A simple Streamlit interface, orchestrated with LangChain

Why it matters for clients

This is the same architecture behind the AI website assistant I build for businesses: answers that come from the business’s own content, with the source to prove it.

Tell me what is slowing you down

Describe your business, or your client's, and the problem you want solved. I'll reply within one working day with how I would approach it and a fixed price to start.