Source code

1.3.0GPL-3.0

retrieval pipeline

Local RAG without a server

Retrieval over your own documents, running in the application you already opened. No container, no service to start, no API that sees your files in order to embed them.

Install KnowNote

What happens when you ask a question

Import and asking share one pipeline, and only its last step is allowed to touch the network.

Import
pdf · docx · pptx · httpEach format goes through its own parser — pdfjs-dist, mammoth, officeparser, turndown — so headings, page boundaries and slide structure survive where the format has them.
Split
~500 chars · 50 overlapText becomes passages, and each passage records its start and end offset in the extracted text. This is the step that makes citations possible later.
Embed
in-processPassages become vectors inside the application, using the built-in local backend. Nothing is sent anywhere to be embedded.
Retrieve
sqlite-vec · per notebookYour question is embedded the same way and matched against that notebook’s vectors only. Two notebooks never share a ranking.
Answer
your model, your endpointThe retrieved passages and the question go to the model connection you configured. The answer comes back with the citations pointing into the passages that produced it.

The embedder runs in this process

local backend

This is the part that usually requires a service. Here it is a library.

Model
Xenova/multilingual-e5-smallA multilingual sentence embedding model, so a question in one language can find a passage in another.
Runtime
ONNX, in-processIt runs inside the application. There is no service to start and no container to run.
Revision
pinned to one commitThe exact model revision is fixed. An upstream change cannot silently redefine the vectors your library was built from.
Quantisation
q8Quantised weights: a smaller download and a smaller resident footprint for a small accuracy cost.
Dimensions
384The width of each vector.
Prefixes
query: / passage:E5 was trained with an instruction prefix per side. Questions and passages are prefixed differently, which is why a question can find a passage that shares few words with it.
Download
once, on demandFetched the first time it is needed and cached on disk afterwards.
Network at inference
disabledRemote model loading is switched off, so a retrieval cannot quietly reach out.

One vector table per notebook

An embedding model defines a space, and vectors from two different spaces are not comparable — cosine similarity between them is a number, not a meaning. Change the model, the revision, the quantisation or the pooling, and you have a different space.

KnowNote derives an identity from the backend, model, revision, dtype, pooling, normalisation, prefixes and dimensions, and gives each notebook its own vector table carrying its own width. Vectors from different spaces are never compared, because there is nowhere for that comparison to happen. It is a structural guarantee rather than a check that has to remember to run.

What ends up on your disk

local state

Documents
your originals, untouchedImporting reads a file. It does not move, rewrite or upload it.
Extracted text and passages
SQLiteOne local database holds the extracted text, the passages and their offsets.
Vectors
sqlite-vecStored in the same database, in a table belonging to that notebook.
Notes
in the same databaseNotebooks, notes and their structure live beside everything else.
Model files
a cache directoryDownloaded once, reused across notebooks.

What still uses the network

“Local” is only a useful word if it is specific about the exceptions.

Asking a question
to your endpointThe retrieved passages and your question go to the model connection you configured. If that is a local server, nothing leaves the machine at all.
Importing and searching
nothingParsing, splitting, embedding and retrieval are all local.
First embedding run
one downloadThe model is fetched once. After that, retrieval works with the network off.