1# Install from PyPI
2pip install lexrag
3
4# Or clone from source
5git clone https://github.com/eulogik/LexRAG.git
6cd LexRAG
7pip install -r requirements.txt
8
9# Configure
10cp .env.example .env
11# Edit .env with your API keys
12
13# Run
14python -m uvicorn api.main:app --host 0.0.0.0 --port 8000
15# Open http://localhost:8000
1flowchart TD
2 UI[HTML/CSS/JS SPA] <-->|SSE / API| FastAPI[FastAPI Server]
3 FastAPI <-->|History| SQL[(SQLite)]
4 Query --> Detect[Auto-Jurisdiction]
5 Detect --> Search{Hybrid Search}
6 Search -->|Dense| Dense[BGE-small-en-v1.5]
7 Search -->|Sparse| Sparse[Splade_PP_en_v1]
8 Dense & Sparse -->|RRF| Qdrant[(Qdrant)]
9 Qdrant -->|Candidates| Rerank[BGE-Reranker-Base]
10 Rerank -->|Top Docs| Context[Build Prompt]
11 Context --> LLM{LLM Router}
12 LLM -->|Cloud| Groq[Groq]
13 LLM -->|Cloud| OpenRouter[OpenRouter]
14 LLM -->|Local| Ollama[Ollama]
AGPL v3 — Free for open-source and internal use.
Commercial licenses available from
Evolucent AI for proprietary deployments.