cairnsearch: A privacy-first hybrid search and local RAG system for personal document collections
cairnsearch is an open-source document search and question-answering system that runs entirely on the user’s machine. It indexes PDFs (including scanned ones via OCR), Word and Excel files, CSV, plain text, Markdown, HTML, and images into a single SQLite FTS5 index for lexical search and a NumPy-backed vector index for dense retrieval. The two signals are fused with a weighted sum; an optional cross-encoder reranks the top candidates. Questions are answered by a local LLM served through Ollama, with citations pointing back to the source chunks. The same core engine is exposed as a FastAPI web service, a single-page browser UI, and a Typer CLI. The intended users are people who need to search or query documents they cannot send to a cloud service: lawyers, clinicians, journalists, researchers, and anyone managing a personal archive. This paper describes the system’s architecture, its ingestion and retrieval pipeline, the built-in safeguards (PII detection, extraction guardrails, failed-file quarantine), and how it is deployed in practice.
Institutions
- Dallas Independent School District (US)
Publication Details
- Journal
- SoftwareX
- Published
- 2026-05-27
- DOI
- https://doi.org/10.1016/j.softx.2026.102742
- Primary Topic
- Data Quality and Management
- Type
- article
- Field-Weighted Citation Impact
- 0.00