A newer version of the Streamlit SDK is available:
1.49.1
metadata
title: LegalMind AI
emoji: 🧠
colorFrom: blue
colorTo: green
sdk: streamlit
sdk_version: 1.33.0
app_file: app.py
pinned: false
LegalMind AI
...
LegalMind AI
LegalMind AI is an intelligent legal research assistant specialized in Indian law. It uses advanced RAG (Retrieval Augmented Generation) technology to analyze legal documents and answer questions based on their content.
Features
- Upload and Process Legal Documents: Easily upload PDF documents including court judgments, legal acts, contracts, and more
- Advanced Document Processing: Smart chunking and analysis of legal text for better understanding
- Intelligent Question Answering: Ask natural language questions about the document content
- Source Citations: Responses include references to specific parts of the document
- History Management: Save and reload previous conversations
- Document Summaries: Automatic generation of document summaries
- Customizable Settings: Choose different language models and embedding options
Setup Instructions
Prerequisites
- Python 3.8+
- A Groq API key (sign up at groq.com)
Installation
Clone the repository:
git clone https://github.com/yourusername/legalmind-ai.git cd legalmind-ai
Create a virtual environment:
python -m venv myenv source myenv/bin/activate # On Windows: myenv\Scripts\activate
Install dependencies:
pip install -r requirements.txt
Create a
.env
file in the project root by copying the example:cp .env.example .env
Then edit the
.env
file to add your Groq API key (without quotes):GROQ_API_KEY=your_groq_api_key_here
Running the Application
Launch the application with:
streamlit run app.py
The application will be available at http://localhost:8501
.
Usage
- Upload a Document: Use the upload section to add a legal document (PDF format)
- Process the Document: Configure processing options if needed and click "Process Document"
- Ask Questions: Enter legal questions about the document in the question input field
- Save or Export: Save conversations for future reference or export results
Project Structure
app.py
- Streamlit web interfaceconfig.py
- Configuration settings and path managementrag_pipeline.py
- RAG implementation for question answeringutils.py
- Helper functions for document processingvector_database.py
- Vector database management for document embeddings
Known Limitations
- Currently only supports PDF files
- Best performance with legal documents in English
- Focused primarily on Indian legal system
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Built with Streamlit, LangChain, and Groq LLMs
- Uses FAISS for vector storage and efficient retrieval