← All work
Public code 2026

Engineer Companion — offline RAG

Offline RAG over radiotherapy equipment documentation. Hybrid LanceDB + BM25 retrieval, local embeddings and reranker, CPU-only. Answers cite document, page and drawing region.

Engineer Companion chat answering with document and page citations
Answer with evidence links: document, page, drawing region.

Problem

A field engineer servicing a clinical linear accelerator works in an RF-shielded bunker with no internet and needs the exact page of a specification in seconds — out of tens of thousands of pages of manuals.

Approach

  1. One Python core: PDF indexing, chunking, embeddings, LanceDB retrieval and a fact catalogue.

  2. Hybrid retrieval: dense vectors + BM25, with a cross-encoder reranker.

  3. Local quantized inference (Gemma-3-4B, GGUF / llama.cpp); every answer carries an evidence link to document, page and drawing region.

Results

facts indexed
21,214
benchmark accuracy
96/100
p50 latency · CPU
130 ms
tests passing
768/775

Stack

  • Python
  • LanceDB
  • BM25
  • multilingual-e5-small
  • mmarco reranker
  • Gemma-3-4B (GGUF)
  • llama.cpp
  • PySide6
  • pytest

What is public

Public code. The repository contains the retrieval and generation code and the test suite; the benchmark harness is internal.