Skip to main content

DeepLightRAG

PyPI version License: MIT

High-performance document indexing and retrieval system. Works with any LLM.

Features

  • Dual-Layer Graph: Visual-Spatial + Entity-Relationship architecture
  • GLiNER2 NER: Zero-shot entity extraction with fastino/gliner2-base-v1
  • DeepSeek-OCR: Visual token compression for efficient document processing
  • TOON Format: Token-efficient context formatting via toon-python
  • Any LLM: Works with OpenAI, Gemini, Claude, Ollama, MLX

Installation

pip install deeplightrag

With GPU (CUDA):

pip install "deeplightrag[gpu]"

macOS (Apple Silicon):

pip install "deeplightrag[macos]"

Quick Start

Python API

from deeplightrag import DeepLightRAG

# Initialize
rag = DeepLightRAG()

# Index document
rag.index_document("document.pdf", document_id="doc_001")

# Retrieve
result = rag.retrieve("What are the key findings?")
print(result["context"])

CLI

# Index
deeplightrag index document.pdf

# Query
deeplightrag retrieve "What is the main topic?"

Architecture

┌─────────────────────────────────────────────┐
│              DeepLightRAG                   │
├─────────────────────────────────────────────┤
│  DeepSeek-OCR → Visual Token Compression    │
├─────────────────────────────────────────────┤
│  Dual-Layer Graph                           │
│  ├── Layer 1: Visual-Spatial (WHERE)        │
│  └── Layer 2: Entity-Relationship (WHAT)    │
├─────────────────────────────────────────────┤
│  GLiNER2 → Entity Extraction                │
├─────────────────────────────────────────────┤
│  Adaptive Retriever → Context Generation    │
└─────────────────────────────────────────────┘

Configuration

# config.yaml
ocr:
  model_name: "deepseek-ai/DeepSeek-OCR"
  resolution: "gundam"

ner:
  model_name: "fastino/gliner2-base-v1"
  confidence_threshold: 0.3

retrieval:
  top_k: 5

Requirements

  • Python >= 3.9
  • CUDA GPU recommended for DeepSeek-OCR
  • Dependencies: gliner2, toon-python, networkx, torch

License

MIT License

Metadata

Release files for deeplightrag 1.0.22

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for deeplightrag 1.0.22
File Interpreter ABI Platform Actions
deeplightrag-1.0.22-py3-none-any.whl Python 3 none any Details for deeplightrag-1.0.22-py3-none-any.whl

Release files / deeplightrag-1.0.22-py3-none-any.whl

Download URL deeplightrag-1.0.22-py3-none-any.whl
Size 100.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3a7483c173abce0721598b139a2653ad18abc115b5ed2ac07b65d928fbbaf753
BLAKE2b-256 checksum
How to use checksums
fe9b060e46ace047964a0c0181736c9d99947f2380f4f55ea45739b0940b5316
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Security for deeplightrag 1.0.22

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page