LegalAI Crew is a robust AI-powered system designed for comprehensive legal research, analysis, writing, and review. Using state-of-the-art large language models (LLMs) and custom tools, it automates the workflow of legal research professionals, ensuring efficient, accurate, and high-quality outputs.
-
Multiple Specialized Agents:
- Legal Research Analyst: Performs in-depth research on legal topics.
- Legal Content Writer: Generates detailed legal analysis.
- Legal Editor: Reviews and ensures the accuracy of legal documents.
-
Task Automation: Streamlined task execution for research, writing, and editing, with predefined goals and outputs.
-
Advanced Search Integration: Utilizes the TavilySearchResults tool for precise and advanced internet-based legal research.
-
LLM-Driven: Powered by Ollama LLM (
llama3:8b) for high-quality language understanding and generation. -
Collaborative Workflow: Agents work together in a structured pipeline to deliver a finalized legal analysis document.
-
Legal Research Analyst:
- Goal: Research laws and regulations.
- Tool: Tavily Internet Search.
- LLM: Ollama LLM.
-
Legal Content Writer:
- Goal: Create a comprehensive legal document.
- LLM: Ollama LLM.
-
Legal Editor:
- Goal: Review and finalize legal documentation.
- LLM: Ollama LLM.
-
Research Task:
- Description: Gather information on the specified legal topic in the target country.
- Output: Detailed research report.
-
Writing Task:
- Description: Draft a legal analysis document with citations.
- Output: Comprehensive legal analysis.
-
Editing Task:
- Description: Review and validate the analysis for accuracy and compliance.
- Output: Finalized legal document.
- Python 3.8+
- Required Libraries:
crewailangchain_communitypydantic
-
Clone the Repository:
git clone https://github.com/Saiteja1244/LegalAI-Crew.git
-
Install Dependencies:
pip install -r requirements.txt
-
Run the Code:
python main.py
-
Set Up the LLM: Ensure the Ollama LLM is running on
http://localhost:11434. -
Add Tavily API Key: Replace
tvly-xxxxxxwith your own Tavily API Key in the code. -
Customize Inputs: Modify the
inputsincrew.kickoff()for the desired country and query. -
Run the Crew: Execute the tasks to generate a comprehensive legal document.
crew.kickoff(
inputs={
"country": "United States",
"query": "Data Privacy Regulations"
}
)- A finalized legal analysis document saved to
Legal Research\md_files\legal_analysis.md.
The name reflects the collaborative nature of the system and its focus on legal research and document generation using AI agents.
We welcome contributions to enhance this project. Please fork the repository and create a pull request for review.
This tool is designed for educational and research purposes. Users must ensure compliance with local laws and regulations when using the system for legal analysis.
