Skip to content

A Legal Researcher Multi Agent AI Project BY SLIIT Y3S1 Data Science Specialization Group Project For IRWA (Information Retrieval and Web Analytics) Module

Notifications You must be signed in to change notification settings

chamodSN/VeritasAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

VeritasAI – Multi-Agent Legal Research System

VeritasAI is an advanced multi-agent system for comprehensive legal case research and analysis. It orchestrates multiple AI agents to parse queries, search legal databases, summarize case opinions, extract citations, analyze arguments, and provide insights through a modern React frontend.

πŸš€ Quick Start

Prerequisites

  • Python 3.10+ (Windows users: prefer Python 3.10/3.11 for best compatibility)
  • Node.js 18+
  • CourtListener API key (get from CourtListener)
  • MongoDB (atlas cloud instance)

Setup Instructions

1. Clone and Setup Environment

# Clone the repository
git clone <repository-url>
cd VeritasAI

# Create and activate virtual environment
python -m venv venv

# Windows
venv\Scripts\activate

# Linux/Mac
source venv/bin/activate

2. Install Dependencies

# Install Python dependencies
pip install -r requirements.txt

# Install frontend dependencies
cd frontend
npm install
cd ..

3. Environment Configuration

Create a .env file in the root directory:

# Required Environment Variables
OPENAI_API_KEY=your_openai_api_key_here
GOOGLE_CLIENT_ID=your_google_client_id_here
GOOGLE_CLIENT_SECRET=your_google_client_secret_here
MONGO_URI=your_mongodb_atlas_uri_here
DATABASE_NAME=veritas_ai
LLM_MODEL=gpt-4o-mini
API_BASE_URL=https://api.openai.com/v1
TEMPERATURE=0.4
SESSION_SECRET_KEY=your_session_secret_key_here
JWT_SECRET=your_jwt_secret_key_here
COURTLISTENER_API_KEY=your_courtlistener_api_key_here
ENCRYPTION_KEY=your_32_character_encryption_key_here

4. Start the Application

# Start all backend services
python run.py

# In a separate terminal, start the frontend
cd frontend
npm start

The application will be available at:

πŸ“– Usage Guide

Getting Started

  1. Authentication: Log in with your Google account
  2. Query Search: Enter legal queries in natural language
  3. PDF Analysis: Upload legal documents for comprehensive analysis
  4. History: Access your previous searches and results

Features

πŸ” Query-Based Research

  • Enter legal questions in natural language
  • Get comprehensive analysis including:
    • Case summaries
    • Legal issues identified
    • Argument analysis
    • Citation verification
    • Analytics and patterns

πŸ“„ PDF Document Analysis

  • Upload legal PDF documents
  • Extract and analyze case text
  • Generate comprehensive summaries
  • Identify key legal arguments and citations

πŸ“Š Analytics Dashboard

  • View legal patterns and trends
  • Analyze jurisdictional insights
  • Track precedential analysis
  • Monitor citation networks

Example Queries

- "contract breach damages remedies"
- "constitutional rights violations first amendment"
- "employment discrimination workplace harassment"
- "intellectual property patent infringement"
- "criminal procedure fourth amendment search"

πŸ‘₯ Contributors

Team Members & Responsibilities

Member Role Components
Chamod Team Leader Orchestrator, Argument Agent
Sandun Backend Developer Citation Agent, Frontend
Monali AI Specialist Summarization Agent, Analytics & Patterns Agent
Lihini Research Specialist Issue Agent

Individual Contributions

Chamod (Team Leader)

  • Orchestrator: Main coordination system that manages all agents
  • Argument Agent: Analyzes legal arguments and reasoning
  • System Architecture: Overall system design and integration

Sandun (Backend Developer)

  • Citation Agent: Extracts and verifies legal citations
  • Frontend Development: React-based user interface
  • API Integration: CourtListener API integration

Monali (AI Specialist)

  • Summarization Agent: Creates comprehensive case summaries
  • Analytics Agent: Generates insights and pattern analysis
  • AI Models: LLM integration and prompt engineering

Lihini (Research Specialist)

  • Issue Agent: Identifies and extracts legal issues
  • Legal Research: Domain expertise and validation
  • Quality Assurance: Legal accuracy and compliance

πŸ—οΈ Repository Structure

VeritasAI/
β”œβ”€β”€ πŸ“ agents/                          # AI Agent Services
β”‚   β”œβ”€β”€ πŸ“ analytics/                   # Analytics & Patterns Agent (Monali)
β”‚   β”‚   └── analytics_agent.py
β”‚   β”œβ”€β”€ πŸ“ argument/                    # Argument Analysis Agent (Chamod)
β”‚   β”‚   └── argument_agent.py
β”‚   β”œβ”€β”€ πŸ“ citation/                    # Citation Extraction Agent (Sandun)
β”‚   β”‚   β”œβ”€β”€ citation_agent.py
β”‚   β”‚   └── citation_service.py
β”‚   β”œβ”€β”€ πŸ“ issue/                       # Issue Extraction Agent (Lihini)
β”‚   β”‚   └── issue_agent.py
β”‚   β”œβ”€β”€ πŸ“ pdf/                         # PDF Processing Service
β”‚   β”‚   └── pdf_service.py
β”‚   └── πŸ“ summary/                     # Summarization Agent (Monali)
β”‚       └── summarization_agent.py
β”œβ”€β”€ πŸ“ common/                          # Shared Utilities
β”‚   β”œβ”€β”€ config.py                       # Configuration management
β”‚   β”œβ”€β”€ encryption.py                   # Data encryption utilities
β”‚   β”œβ”€β”€ logging.py                      # Logging configuration
β”‚   β”œβ”€β”€ models.py                       # Data models
β”‚   β”œβ”€β”€ responsible_ai.py              # Responsible AI framework
β”‚   β”œβ”€β”€ security.py                     # Security utilities
β”‚   └── utils.py                        # Common utilities
β”œβ”€β”€ πŸ“ controller/                      # Main Orchestration (Chamod)
β”‚   β”œβ”€β”€ auth_controller.py             # Authentication controller
β”‚   └── orchestrator.py                # Main orchestrator service
β”œβ”€β”€ πŸ“ data/                           # Data Storage
β”‚   └── πŸ“ embeddings/                 # Vector embeddings
β”œβ”€β”€ πŸ“ frontend/                        # React Frontend (Sandun)
β”‚   β”œβ”€β”€ πŸ“ public/
β”‚   β”œβ”€β”€ πŸ“ src/
β”‚   β”‚   β”œβ”€β”€ πŸ“ components/
β”‚   β”‚   β”‚   β”œβ”€β”€ ChatInterface.js        # Main chat interface
β”‚   β”‚   β”‚   β”œβ”€β”€ CitationsSection.js     # Citations display
β”‚   β”‚   β”‚   β”œβ”€β”€ ExportActions.js        # Export functionality
β”‚   β”‚   β”‚   β”œβ”€β”€ HomePage.js             # Landing page
β”‚   β”‚   β”‚   β”œβ”€β”€ NavBar.js               # Navigation bar
β”‚   β”‚   β”‚   β”œβ”€β”€ PDFUpload.js            # PDF upload component
β”‚   β”‚   β”‚   └── ResultSection.js        # Results display
β”‚   β”‚   β”œβ”€β”€ App.js                      # Main app component
β”‚   β”‚   └── index.js                    # App entry point
β”‚   β”œβ”€β”€ package.json                    # Frontend dependencies
β”‚   └── tailwind.config.js             # Tailwind CSS config
β”œβ”€β”€ πŸ“ model/                          # Data Models & Services
β”‚   β”œβ”€β”€ case_indexer.py                 # Case indexing service
β”‚   β”œβ”€β”€ citation_verifier.py           # Citation verification
β”‚   β”œβ”€β”€ courtlistener_advanced.py      # Advanced CourtListener features
β”‚   β”œβ”€β”€ courtlistener_client.py         # CourtListener API client
β”‚   β”œβ”€β”€ issue_extractor.py              # Issue extraction logic (Lihini)
β”‚   β”œβ”€β”€ legal_term_expander.py          # Legal term expansion
β”‚   └── user_model.py                   # User data models
β”œβ”€β”€ πŸ“ view/                           # API Views
β”‚   β”œβ”€β”€ api_view.py                     # Main API endpoints
β”‚   └── auth_view.py                    # Authentication endpoints
β”œβ”€β”€ πŸ“ logs/                           # Application logs
β”œβ”€β”€ πŸ“ tests/                          # Test files
β”œβ”€β”€ πŸ“ venv/                           # Virtual environment
β”œβ”€β”€ run.py                             # Application entry point
β”œβ”€β”€ requirements.txt                   # Python dependencies
└── README.md                          # This file

πŸ”§ Architecture Overview

Multi-Agent System

  • Orchestrator (Port 8000): Main coordination service
  • Citation Service (Port 8003): Citation extraction and verification
  • PDF Service (Port 8005): PDF document processing
  • Frontend (Port 3000): React-based user interface

Key Features

  • Responsible AI Framework: IBM-based AI ethics and compliance
  • Data Encryption: End-to-end encryption for user data
  • Multi-Service Architecture: Microservices for scalability
  • Real-time Processing: Live agent coordination and status updates

πŸ“ License

This project is for academic and research purposes. Please verify downstream data source terms (CourtListener API) before commercial use.

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests for new functionality
  5. Submit a pull request

πŸ“ž Support

For questions or issues, please contact the development team or create an issue in the repository.


Built with ❀️ by the VeritasAI Team

About

A Legal Researcher Multi Agent AI Project BY SLIIT Y3S1 Data Science Specialization Group Project For IRWA (Information Retrieval and Web Analytics) Module

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •