Sova searches local PDF and Markdown documents by meaning and exact terms. It returns source passages with file locations. Models run locally through llama-server.
The installer requires macOS, Python 3.14 or later, uv, and llama.cpp with llama-server in your PATH.
Run the installer from the repository directory:
uv run sova-installIt installs Sova in ~/.local/bin and configures launchd model services. Add ~/.local/bin to your PATH. Model services start on demand.
Index a document directory, then use its project ID to search:
sova index /path/to/documents
sova projects
sova search <project-id> "your query"Sova reads .pdf and .md files directly in the source directory, without searching subdirectories. It keeps source files unchanged.
sova help # Show help
sova projects # List projects and IDs
sova index <project-id> # Update or resume indexing
sova list <project-id> # List documents and indexing status
sova search <project-id> "query" # Return up to 10 results
sova search <project-id> "query" -n 20 # Return up to 20 results
sova <project-id> "query" # Short search form
sova remove <project-id> # Unregister the project. Keep its data
sova remove <project-id> --delete-data # Also delete project data after confirmationRe-running index reuses completed work when the source and pipeline are unchanged. Sova saves progress after each PDF conversion, document tokenization, generated context, and embedding batch. It re-extracts changed PDFs and removes deleted source documents from the search index. Generated Markdown in Sova's data directory is not treated as a source document.
Progress updates in place in an interactive terminal. When output is piped, status goes to stderr and results to stdout. For agents and scripts, use newline-delimited JSON:
sova --json search <project-id> "your query"See the agent instruction example for a search workflow.
flowchart LR
A["Documents"] --> X["Text extraction"]
X --> B["Tokenization and chunking"]
B --> C["Context generation"]
C --> D["Embedding"]
D --> E["Vector store"]
C --> F["FTS index"]
Sova converts PDFs to Markdown and splits documents into chunks using the embedding model's tokenizer, targeting 768 tokens per chunk. Scanned pages and image regions are read on the CPU with Indra OCR [4], which downloads about 75 MB of weights from Hugging Face on first use. A scanned page that the OCR classifier skips is read again with OCR forced; pages that still yield no text are reported as warnings. Headings through level five start new chunks, and each chunk keeps its full heading path. Code fences and code-like # comments are not treated as headings. Source lines stay intact, so a long table row can exceed the target.
At index time, qwen3.8-27b (Unsloth UD-Q4_K_XL) generates a one-sentence context for each chunk within its document and heading path [1]. Both search indexes use the document name, heading path, generated context, and source text. The stored source text stays unchanged.
qwen3-embedding-4b produces 2560-dimensional embeddings for vector search. The full-text search (FTS) index uses BM25 and Porter stemming to match exact terms and related word forms.
To limit memory use, Sova prepares sources, tokenizes documents, generates context, and embeds chunks in separate phases. Both models are unloaded during source preparation, including OCR. Each model is unloaded before the next phase.
flowchart LR
Q["Query"] --> QE["Query embedding"]
QE --> VC["Vector search"]
Q --> FC["Full-text search"]
VC --> RRF["Reciprocal rank fusion"]
FC --> RRF
RRF --> DV["Diversity selection"]
DV --> OUT["Source passages"]
Sova combines vector and full-text results with reciprocal rank fusion [3]. Exact matches receive bonuses. Chunks resembling tables of contents or index pages receive penalties based on text density [2]. Diversity selection reduces similar passages in the output.
The vector cache reuses candidates only for an identical query embedding and candidate count. Each query still needs an embedding. Full-text search and final ranking use the current query. Use --no-cache to bypass cache reads and writes. Full-text search matches any query term and ranks matches with BM25; it also works when no vector candidates are available.
See the benchmark guide for the committed question bank, pinned corpus, source-based evaluation, resumable judges and comparison reports.
Run from the repository directory:
uv run sova-remove # Stop services and remove Sova. Keep project data
uv run sova-remove --purge-data # Also delete ~/.sova without confirmation[1] Anthropic, "Contextual retrieval," 2024.
[2] C. Kohlschütter, P. Fankhauser, and W. Nejdl, "Boilerplate detection using shallow text features," WSDM, 2010.
[3] G. V. Cormack, C. L. A. Clarke, and S. Büttcher, "Reciprocal rank fusion outperforms condorcet and individual rank learning methods," SIGIR, 2009.
[4] Datalab, "Indra OCR," 2026.
MIT. Indra OCR model weights are licensed separately under a modified OpenRAIL-M license.