Skip to main content

A lightweight RAG exploration tool.

Project description

LightRAG Exploration

LightRAG Exploration is a Python FastAPI application for exploring Retrieval-Augmented Generation (RAG) workflows. It provides a modern web interface for chat, graph visualization, and RAG experimentation using local LLMs via Ollama. The app is designed for easy local use and sharing as a pipx CLI tool.

Features

  • RAG Chat: Interact with a RAG pipeline using your own documents and local LLMs.
  • Classic Chat: Simple chat interface with model selection and context summarization.
  • Graph Viewer: Visualize the entity/relation graph extracted from your research data.
  • Modern Web UI: Clean, responsive interface built with Tailwind CSS.
  • Easy Setup: Installable as a pipx CLI for global use.
  • Ollama Integration: Uses Ollama for local LLM inference and embeddings.
  • Configurable: Uses .env for research output directory and Ollama host.

Prerequisites

  • Python 3.9+
  • pipx
  • Ollama installed and running with required models (e.g. gemma3:1b, nomic-embed-text:latest)

Install system dependencies (macOS example)

brew install pipx
pipx ensurepath
source ~/.zshrc  # or restart your terminal

Install with pipx

pipx install lightrag-exploration

Usage

  • The API will run on http://localhost:8080 by default.
  • Open your browser and navigate to:
    • /frontend — Home page
    • /frontend/chat — Classic chat interface
    • /frontend/rag-chat — RAG chat interface
    • /frontend/graph-viewer — Graph visualization
    • /docs — FastAPI API docs

How It Works

  • RAG Pipeline: Uses LightRAG and Ollama for retrieval, embedding, and LLM completion.
  • Templates: Web UI is served from the templates/ directory.
  • Config: Set research_output_dir and ollama_host in .env or .env.example.

Development

  • All source code is in the root and routers/ directory.
  • The entrypoint is main.py, which runs the FastAPI app.
  • You can run locally with:
    python main.py
    
  • Or install and run globally with pipx as above.

Test your pipx build locally before uploading to PyPI!

You can install your built wheel or sdist with pipx to verify everything works as expected:

python -m build
pipx install --force dist/lightrag_exploration-0.1.0-py3-none-any.whl
# or
pipx install --force dist/lightrag_exploration-0.1.0.tar.gz
lightrag-exploration
pipx uninstall lightrag-exploration

Packaging & Distribution

To build and publish to PyPI:

  1. Upgrade build and twine:
    python -m pip install --upgrade build twine
    
  2. Build your package:
    python -m build
    
  3. (Optional) Check your package:
    python -m twine check dist/*
    
  4. Upload to PyPI:
    python -m twine upload dist/*
    

Troubleshooting

  • If you see errors about missing templates, ensure you installed with pipx after running pipx ensurepath and that your terminal session is up to date.
  • Make sure Ollama is running and the required models are pulled.
  • If you see errors about missing research output, check your .env and that the directory exists.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lightrag_exploration-0.1.1.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lightrag_exploration-0.1.1-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

Details for the file lightrag_exploration-0.1.1.tar.gz.

File metadata

  • Download URL: lightrag_exploration-0.1.1.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for lightrag_exploration-0.1.1.tar.gz
Algorithm Hash digest
SHA256 719e2953a8d55157669f3409e7bcd75e6b553a4bfa24a5dade1bec4681abb2a7
MD5 6dd0a8ade9b3e49a95820e271dd60f38
BLAKE2b-256 a87bc796768cc6a694b210c2cf2f20c4ec6dfb57f5f436c6ab030da294d2c732

See more details on using hashes here.

File details

Details for the file lightrag_exploration-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for lightrag_exploration-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9c4f1c299f6be1745ea4f4dba50268578994735b6c3404b893013646adb19d2f
MD5 da5f889d075846b19e864a3718054145
BLAKE2b-256 1358a16aa9c12e098f40a5d554095c1aff88ff7ab3efd89dc88e1370a9c9ddff

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page