03 // HOW SO SMART?

NOT MAGIC.
TWO SEARCHES
+ A JUDGE.

Vagus makes local evidence easy to retrieve. BM25 remembers the words, vectors remember the meaning, and a state-of-the-art agent harness reads the evidence and finishes the job.

ONE QUERY // TWO INSTINCTS

WORDS ON THE LEFT.
MEANING ON THE RIGHT.

QUERY_PACKET“why did Firefox stall on the first request?”send down both channels ↓
CHANNEL_A // LEXICALBM25TANTIVY

Tokenize the query, reward rare matching terms, account for repetition and document length, then rank chunks containing the literal vocabulary.

  1. 01split into termsfirefox · stall · first · request
  2. 02weight rare termsIDF(firefox) > IDF(request)
  3. 03rank exact evidenceerror codes win here

BEST AT filenames, commands, ticket IDs, error strings, product names, and wording you can quote.

CHANNEL_B // SEMANTICVECTOREMBEDDINGGEMMA

Turn the query into 768 local numbers, compare its direction with indexed chunk vectors, then rank passages whose meaning points the same way.

  1. 01prompt as a search querytask: search result | query:
  2. 02embed locallytext → [0.03, −0.11, …] × 768
  3. 03rank by cosinegist survives paraphrase

BEST AT concepts, paraphrases, descriptions, and the memory you can explain but cannot quote.

RECIPROCAL RANK FUSION // k = 60

DON'T MIX SCORES.
MIX RANKS.

BM25 scores and cosine values live on unrelated scales. RRF ignores those raw magnitudes and adds rank evidence instead. A chunk can survive by dominating either channel; agreement lifts it higher.

RRF(d) = Σ 1 / (60 + rankchannel(d))
Illustrative candidate ranks
candidate chunkBM25vectorfused signal
cold-load diagnosis#4#1both agree
literal Firefox error#1#12exact survives
generic browser advice#9#5falls behind

Illustration only—the real lists are chunk IDs, deeper than these three rows, and deterministic ties use a stable ID.

01BM25 + VECTORindependent ranked lists
02RRF / 60high-recall candidate pool
03JINA?optional cross-encoder
04FULL BODIESnot snippet theater
05AGENT JUDGEuseful · nonredundant · cited

Below 10,000 embedded chunks, semantic search uses exact cosine automatically; larger vaults use the local usearch HNSW sidecar. --exact remains the ground-truth escape hatch. The optional reranker can improve precision, but it is measured rather than presumed better.

INDEX TIME // PAY ON CHANGE

UNCHANGED NOTES
COST NO EMBEDDINGS.

EVERY RUNWALK .MD → CHECK MTIMEcomplete snapshot catches new and deleted notes
NEW / CHANGED / FORCEDREAD + HASHonly this branch pays the model
01PARSEfrontmatter + Markdown
02CHUNKbounded sections
03EMBED768d document vectors
04WRITE ×3SQLite · Tantivy · usearch
05COMMITderived state durable

MEASURED CHANGED-NOTE PATH

THE EMBEDDER
OWNS THE CLOCK.

A synthetic five-section note was filed five times in an isolated vault on an M1 Pro with model files cached. The median instrumented run took 1.878 s.

The exact shape depends on note length, model cache, hardware, and index size. These bars explain the work; they are not a universal speed promise.

INDEX_PROFILE // MEDIAN OF 51,878 ms total
MODEL LOAD + ORCHESTRATION*scan/open/vector persist residual
~1,017 ms
DOCUMENT EMBEDDINGEmbeddingGemma inference
794 ms
TANTIVY COMMITcommit + merge wait
84 ms
CHUNK + ROW/VECTOR INSERTall measured hot writes
~2 ms

*Residual is honest subtraction, not a separately instrumented phase. It includes embedder initialization and local-store orchestration. Phase medians need not sum exactly to the median total.

SEARCH TIME // 5,022 CHUNKS

FUSION IS CHEAP.
MODELS ARE NOT.

PLAIN HYBRID1,075.8 msmedian retrieval core
BM25 + query embedding + exact vector + RRF
1,074.0 ms
result hydration (“fuse” timer)
0.9 ms
BM25-only warm total
4.1 ms

The query embedder dominates a one-shot CLI process. BM25 and rank fusion are tiny by comparison.

HYBRID + RERANK2,089.7 mscontext 0 · capped prefix
hybrid retrieval
1,010.0 ms
Jina model load
132.6 ms
cross-encoder forward pass
953.9 ms
result hydration (“fuse” timer)
0.9 ms

Reranking roughly doubles this query. Wider adjacent context costs more, so it stays explicit.

MEASUREMENT BOUNDARY

Vagus v0.13.0 · Apple M1 Pro · 566 notes / 5,022 chunks · median of five separate invocations · model files present locally; no network · fixed non-private query · --no-index. Exact cosine is automatic at this corpus size. The timer covers the retrieval core, not agent reasoning or shell startup.

Normal search first performs an incremental mtime refresh. When nothing changed, it does not load the document embedder. open timing record ↗

EXPECTED CONTROL PLANE // BRING A SOTA HARNESS

VAGUS RETRIEVES.
YOUR AGENT THINKS.

Vagus deliberately stops short of pretending a rank is an answer. We expect a state-of-the-art, shell-capable harness—pi, Codex CLI, Claude Code, or equivalent—to read full candidates, apply current ticket and repository context, and decide what is actually useful.

PICODEX CLICLAUDE CODEYOUR NEXT ONE
01 // INTAKETICKET

Issue, task, meeting, or investigation enters the harness with live project context.

02 // RECALLVAGUS SEARCH

Hybrid retrieval returns exact + semantic candidates and their full bodies.

03 // REASONAGENT JUDGE

The harness rejects weak or redundant hits and cites the evidence it actually used.

04 // WORKEXECUTE

The harness edits code, answers the ticket, and captures the durable outcome as Markdown.

05 // LOCATEVAGUS SUGGESTS

Similar notes and existing PARA folders become candidate destinations—not commands.

06 // FILEHARNESS + USER

Ticket context and Vagus recommendations meet; your approval policy controls the move.

THE TANDEM

ONE KNOWS THE TICKET.
ONE KNOWS THE VAULT.

The harness knows what just happened in the repository. Vagus knows which local notes and PARA neighborhoods resemble the result. Let the harness file away completed ticket knowledge in tandem with Vagus location recommendations instead of asking either side to guess alone.

RECOMMENDATION ≠ AUTHORITY // KEEP HUMAN APPROVAL OR SET YOUR OWN EXPLICIT POLICY

ticket_memory_loop.shHARNESS
# 1. retrieve evidence for the active ticket
$ vagus search "$ticket" \
    --json --full --rerank --exact

# 2. create-note skill pipes the outcome to 00-Inbox
$ note=$(vagus add-note "$title" --source "$ticket" \
    --print-path <<'NOTE'
<durable ticket outcome>
NOTE
)

# 3. ask the vault topology; harness evaluates
$ vagus file "$note" --suggest --json
→ ["10-Projects/…", "30-Resources/…"]

# 4. after the configured approval gate
$ vagus file "$note" --to "$destination"
BUNDLEDCLAUDE CODEvagus skills install
BUNDLEDPIvagus skills install --agent pi
OPEN CONTRACTCODEX / OTHERSvagus … --json

Want the corpus numbers behind the claims?

04 // inspect field data →