Privacy-first, 100% offline PDF intelligence for your desktop.
LexisLocal ingests your PDFs, extracts text and definitions, chunks and embeds everything locally, and lets you ask natural-language questions about your documents — all without a single byte leaving your machine. No API keys, no telemetry, no cloud. The only network call is to a llama-server process on your own localhost.
- Local RAG Chat — Ask questions about your documents. Answers are grounded in the actual text via embedding similarity search (M-TREE vector index) with BM25 full-text fallback.
- Pixel-Perfect PDF Viewer — A canvas-rendered PDF with a transparent, natively-selectable text overlay via PDF.js. Every text span lines up 1:1 with its canvas bitmap.
- Smart Definitions — Key terms and explanations extracted automatically on ingest via LLM, displayed as hover cards over the PDF text layer.
- Anomaly Detection — Flags contradictions, missing clauses, and unusual language in your documents.
- Liquid Navigation — Answers include the source page number; clicking jumps the PDF viewer directly to that page.
- Auto-Spawned AI — The app boots its own
llama-serversidecar on a free port and shuts it down on exit. - Embedded Database — SurrealDB with SurrealKv engine. Zero configuration, no separate server process.
- Section Extraction — Pure-regex section heading detection with cross-reference tracking between sections.
# Prerequisites: Rust, Node.js 18+, llama-server on PATH + a GGUF model
git clone https://github.com/your-org/lexis-local.git
cd lexis-local
npm install
# Point at your GGUF model (defaults to ~/.cache/lexis/model.gguf)
export LEXIS_MODEL_PATH=/path/to/your/model.gguf
npm run tauri devSee CONTRIBUTING.md for detailed setup instructions and development commands.
- Rust (latest stable) + Tauri 2 system deps
- Node.js 18+
- llama-server binary (from llama.cpp) on
$PATH - A GGUF model supporting
/v1/embeddingsand/v1/chat/completions(e.g. nomic-embed-text-v1.5, 768-dim)
PDF bytes ─▶ pdf_extract ─▶ documents table
│
├─▶ chunk_text (1024/128) ─▶ embed() ─▶ chunks (+ vector, page)
└─▶ extract_definitions ─▶ definitions table
ask(question) ─▶ embed ─▶ M-TREE KNN search ─▶ context ─▶ chat ─▶ answer (+ page)
Stack: Tauri 2 (Rust) · React 19 / TypeScript / Tailwind 4 · SurrealDB (SurrealKv) · PDF.js 6 · llama.cpp (sidecar)
| Document | Description |
|---|---|
docs/architecture.md |
System architecture with Mermaid diagrams and data flow |
docs/api-reference.md |
Tauri commands, HTTP endpoints, and SurrealDB schema |
CONTRIBUTING.md |
Developer onboarding, setup, and code conventions |
CODE_OF_CONDUCT.md |
Community guidelines |
plan.md |
Phased build plan and current status |
CLAUDE.md |
Agent guide and architecture constraints |
npm run dev # Frontend only (Vite hot-reload)
npm run build # tsc typecheck + Vite production build
npx tsc --noEmit # Frontend typecheck only
cd src-tauri && cargo check -j 4 && cargo test -j 4 && cd ..Low-RAM note: use
-j 4with cargo on machines with <16 GB to avoid OOM.