LegalMind is an AI-powered legal assistant that helps users understand legal documents, ask legal questions in plain language, and generate contracts using advanced LLMs via the Groq API. It’s built using FastAPI, Jinja2 for templating, and LangGraph for stateful workflows.
- 🗂️ Upload & analyze legal documents (PDF/DOCX)
- 🧾 Generate AI-crafted contracts like NDAs and rental agreements
- 🤖 Chat with an intelligent legal assistant
- 🔁 Multi-step conversations with LangGraph
- 🌐 Simple and responsive web interface using Jinja2
- FastAPI – Web framework
- Groq API – LLM inference
- LangGraph – Stateful workflows
- Jinja2 – Templating
- pypdf/python-docx – Document parsing
- Clone the repository:
git clone https://github.com/sfantaye/legalmind.git cd legalmind - Create a virtual environment (recommended):
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
- Install dependencies:
pip install -r requirements.txt
- Configure environment variables:
- Create a
.envfile in the project root. - Add your Groq API key:
GROQ_API_KEY="YOUR_GROQ_API_KEY" GROQ_MODEL_NAME="llama3-8b-8192" # Optional: specify model
- Create a
- Run the application:
./run.sh # OR uvicorn app.main:app --reload - Access the application at
http://localhost:8000.