﻿# cairnsearch: local RAG paper claims and the current implementation

Compare the personal-search paper with pinned vector-store, reranker and locality-guard code before reusing its historical timing or architecture.

Author: Retrivium editorial team
Updated: 2026-11-05
Canonical URL: https://retrivium.ai/journal/cairnsearch-local-rag-paper-current-code-boundaries/
Language: en

## Read the paper as a versioned integration case

The [cairnsearch paper](https://doi.org/10.1016/j.softx.2026.102742) describes personal-document search combining SQLite lexical retrieval, dense retrieval and locally generated answers with source references. Its small M4 laptop experiment reports approximately 28 ms per embedded chunk. That is an indexing-stage observation, not retrieval quality or complete answer latency. The paper explicitly characterizes quality evaluation as qualitative.

This is a useful engineering case because it assembles extraction, indexing and answering around a personal collection. But component names do not determine whether the right passage is found or whether an answer faithfully uses it. A cited chunk provides an inspectable evidence path; the citation still needs to support the associated claim. The historical timing also needs its corpus and configuration before becoming a capacity estimate for another archive.

## Inspect the current vector implementation separately

The [pinned vector-store source](https://raw.githubusercontent.com/smwaqas89/cairnsearch/eb5bf13605343e75e3aaf6ce0d8d2ecef8748d93/src/cairnsearch/rag/vector_store.py) stores embeddings in SQLite, reads eligible rows, calculates cosine similarity in Python and sorts the results. This differs from the paper's description of a NumPy-backed vector index. It is a concrete implementation observation, not a performance measurement of the pinned revision.

An exhaustive scan and an approximate index have different scaling questions. The relevant comparison needs the actual chunk count, embedding dimensions and eligibility filters. A small collection may behave acceptably while a larger one exposes linear scan costs. Neither the paper's per-chunk embedding time nor an untested index label establishes that scaling. Keep indexing cost, query embedding and vector comparison as separately labeled stages.

## Name the reranker that is actually selected

The [reranker implementation](https://raw.githubusercontent.com/smwaqas89/cairnsearch/eb5bf13605343e75e3aaf6ce0d8d2ecef8748d93/src/cairnsearch/rag/reranker.py) explicitly describes its default as listwise scoring through the local Ollama model, rather than a separate cross-encoder. Reranking is disabled by default. If the backend is unavailable or scoring fails, the implementation can preserve original order. An unchanged ranking therefore does not itself prove that a reranker executed successfully.

The practical evaluation should record which path ran and retain candidate lists before and after rescoring. Otherwise an apparent no-regression result may compare retrieval with itself. The [hybrid-retrieval guide](/journal/elasticsearch-rrf-linear-hybrid-retrievers/) explains why candidate generation and score combination also deserve separate controls. Its general lesson applies here without implying that cairnsearch implements Elasticsearch's interfaces.

## Define what local execution means

The [configuration source](https://raw.githubusercontent.com/smwaqas89/cairnsearch/eb5bf13605343e75e3aaf6ce0d8d2ecef8748d93/src/cairnsearch/rag/config.py) enables a strict-local provider guard by default. It classifies supported provider types; that helper does not inspect the configured Ollama host address. The [embedding implementation](https://raw.githubusercontent.com/smwaqas89/cairnsearch/eb5bf13605343e75e3aaf6ce0d8d2ecef8748d93/src/cairnsearch/rag/embeddings.py) sends requests to that configurable address. Consequently, the guard alone is not a proof that every permitted configuration stays on the same physical machine.

This is an implementation boundary, rather than evidence of an observed disclosure. A locality assessment should preserve resolved endpoints and distinguish initial model acquisition from document-query processing. No connection to a model backend or private document collection was made during this review. The source inspection establishes what the reviewed guard checks, while runtime network behavior would require a separate observation.

## Evaluate the collection before trusting the answer

A focused local test would include exact identifiers, paraphrases, scanned pages and questions unsupported by the corpus. Judge retrieval separately from generated answers and inspect returned evidence. The [citation-evaluation guide](/journal/rag-citation-precision-completeness/) explains why source support and completeness are distinct.

The paper remains a concrete local-search integration report. The pinned code adds important version boundaries: a different vector implementation, a listwise reranker with fallback behavior and a provider-based locality guard. Those facts should accompany any reuse of its historical timing or architectural description.
