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

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
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

cairnsearch: A privacy-first hybrid search and local RAG system for personal document collections

SoftwareX
Data Quality and Management
article

cairnsearch: A privacy-first hybrid search and local RAG system for personal document collections

article en

Abstract

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.

SoftwareXVol. 34
Dallas Independent School District (US)
Openalex Percentile: Top 5%
Data Quality and Management
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.