Metadata-Version: 2.4
Name: lexrag
Version: 3.3.0
Summary: Legal Intelligence Terminal — Hybrid RAG for UAE & Indian Law, Tax and Compliance
Author-email: Evolucent AI <hello@evolucentai.com>
Maintainer-email: Eulogik <engineering@eulogik.com>
License: AGPL-3.0-or-later
Project-URL: Homepage, https://github.com/eulogik/LexRAG
Project-URL: Repository, https://github.com/eulogik/LexRAG
Project-URL: Documentation, https://github.com/eulogik/LexRAG#readme
Project-URL: Changelog, https://github.com/eulogik/LexRAG/releases
Project-URL: Issues, https://github.com/eulogik/LexRAG/issues
Project-URL: Organization, https://eulogik.com
Project-URL: Product, https://evolucentai.com
Project-URL: HuggingFace, https://huggingface.co/evolucentai
Keywords: legal-rag,legal-ai,legal-research,retrieval-augmented-generation,uae-law,indian-law,gst,vat,corporate-tax,fastembed,qdrant,hybrid-search,rag,legal-tech,compliance,tax-research,case-law,artificial-intelligence,nlp,legal-intelligence
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Legal Industry
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Office/Business :: Financial :: Accounting
Classifier: Topic :: Office/Business :: Financial
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: fastapi>=0.136.0
Requires-Dist: uvicorn>=0.34.2
Requires-Dist: fastembed>=0.8.0
Requires-Dist: qdrant-client>=1.13.3
Requires-Dist: sentence-transformers>=5.4.1
Requires-Dist: httpx>=0.28.1
Requires-Dist: httpx-sse>=0.4.3
Requires-Dist: python-dotenv>=1.1.0
Requires-Dist: sqlite-utils>=0.38
Requires-Dist: unstructured>=0.16
Requires-Dist: pydantic>=2.11
Requires-Dist: PyMuPDF>=1.25
Requires-Dist: beautifulsoup4>=4.13
Requires-Dist: lxml>=5.3
Requires-Dist: schedule>=1.2
Requires-Dist: sse-starlette>=2.2
Requires-Dist: aiofiles>=24.1
Requires-Dist: orjson>=3.10
Dynamic: license-file

---
library_name: lexrag
pipeline_tag: text-generation
tags:
  - legal-rag
  - legal-ai
  - legal-research
  - retrieval-augmented-generation
  - uae-law
  - indian-law
  - gst
  - vat
  - corporate-tax
  - hybrid-search
  - fastembed
  - qdrant
  - legal-tech
  - compliance
  - tax-research
  - case-law
  - evolucentai
  - eulogik
license: agpl-3.0
language:
  - en
datasets:
  - Indian Kanoon
  - UAE Legislation Portal
metrics:
  - retrieval-recall
  - grounding-accuracy
widget:
  - text: "What is the GST rate on online gaming contest prizes in India?"
  - text: "UAE VAT on financial services"
  - text: "TDS under Section 194B on winnings"
  - text: "UAE Corporate Tax free zone treatment"
co2_eq_emissions: 0
---

<div align="center">
  <br/>
  <h1>⚖️ LexRAG — The Legal Intelligence Terminal</h1>
  <p>
    <strong>Enterprise-Grade Hybrid RAG for UAE & Indian Law, Taxation & Compliance</strong>
  </p>
  <p>
    <a href="https://github.com/eulogik/LexRAG/stargazers">
      <img src="https://img.shields.io/github/stars/eulogik/LexRAG?style=flat-square&logo=github" alt="Stars"/>
    </a>
    <a href="https://github.com/eulogik/LexRAG/blob/main/LICENSE">
      <img src="https://img.shields.io/github/license/eulogik/LexRAG?style=flat-square" alt="License"/>
    </a>
    <a href="https://pypi.org/project/lexrag/">
      <img src="https://img.shields.io/pypi/v/lexrag?style=flat-square&logo=pypi" alt="PyPI"/>
    </a>
    <a href="https://huggingface.co/evolucentai">
      <img src="https://img.shields.io/badge/%F0%9F%A4%97-Hugging%20Face-ffcc00?style=flat-square" alt="HuggingFace"/>
    </a>
  </p>
  <br/>
</div>

---

## What is LexRAG?

**LexRAG** is a professional-grade, high-performance Retrieval-Augmented Generation (RAG) platform purpose-built for **UAE and Indian laws, taxation, accounting standards, and corporate compliance**. It combines hybrid dense-sparse retrieval, neural reranking, auto-jurisdiction detection, and multi-provider LLM streaming into a zero-latency terminal interface.

> ⚡ **Built by [Evolucent AI](https://evolucentai.com)** — Premium Legal Technology Solutions  
> 🛠️ **Engineered by [Eulogik](https://eulogik.com)** — Enterprise AI & Systems Integration

---

## Key Capabilities

| Capability | Technology |
|------------|------------|
| **Dense Retrieval** | `BAAI/bge-small-en-v1.5` via fastembed |
| **Sparse Retrieval** | `prithivida/Splade_PP_en_v1` via fastembed |
| **Hybrid Fusion** | Reciprocal Rank Fusion (RRF) |
| **Neural Reranker** | `BAAI/bge-reranker-base` (CrossEncoder) |
| **Vector Database** | Qdrant (on-disk, no Docker required) |
| **LLM Providers** | Groq, OpenRouter, Ollama (dynamic model catalog) |
| **Jurisdiction** | Auto-detect India/UAE/Both with manual override |
| **Confidence Tiers** | GROUNDED / PARTIAL / SYNTHESIZED |
| **Streaming** | SSE with heartbeat keep-alive |
| **Persistence** | SQLite chat history with session management |

---

## Quick Start

```bash
# Install from PyPI
pip install lexrag

# Or clone from source
git clone https://github.com/eulogik/LexRAG.git
cd LexRAG
pip install -r requirements.txt

# Configure
cp .env.example .env
# Edit .env with your API keys

# Run
python -m uvicorn api.main:app --host 0.0.0.0 --port 8000
# Open http://localhost:8000
```

---

## Architecture

```mermaid
flowchart TD
    UI[HTML/CSS/JS SPA] <-->|SSE / API| FastAPI[FastAPI Server]
    FastAPI <-->|History| SQL[(SQLite)]
    Query --> Detect[Auto-Jurisdiction]
    Detect --> Search{Hybrid Search}
    Search -->|Dense| Dense[BGE-small-en-v1.5]
    Search -->|Sparse| Sparse[Splade_PP_en_v1]
    Dense & Sparse -->|RRF| Qdrant[(Qdrant)]
    Qdrant -->|Candidates| Rerank[BGE-Reranker-Base]
    Rerank -->|Top Docs| Context[Build Prompt]
    Context --> LLM{LLM Router}
    LLM -->|Cloud| Groq[Groq]
    LLM -->|Cloud| OpenRouter[OpenRouter]
    LLM -->|Local| Ollama[Ollama]
```

---

## Ecosystem

| Platform | Link | Description |
|----------|------|-------------|
| **GitHub** | [eulogik/LexRAG](https://github.com/eulogik/LexRAG) | Source code & issues |
| **PyPI** | [lexrag](https://pypi.org/project/lexrag/) | Python package |
| **HuggingFace** | [evolucentai/lexrag](https://huggingface.co/evolucentai) | Model card |
| **Eulogik** | [eulogik.com](https://eulogik.com) | Engineering partner |
| **Evolucent AI** | [evolucentai.com](https://evolucentai.com) | Product & commercial |

---

## License

**AGPL v3** — Free for open-source and internal use.  
Commercial licenses available from [Evolucent AI](https://evolucentai.com) for proprietary deployments.

---

<div align="center">
  <sub>
    Built by <a href="https://evolucentai.com">Evolucent AI</a> — 
    Engineered by <a href="https://eulogik.com">Eulogik</a>
  </sub>
</div>
