Skip to content

Embedding models

ContextSage Pro unlocks larger embedding models via the bridge. Choosing the right model directly affects how well documents are retrieved — not just how fast they load.

Available models

ModelContext windowSizeBest for
MiniLM L6-v2256 tokens80 MBQuick setup, short documents
BGE Large EN v1.5512 tokens1.3 GBLegal documents, contracts, long clauses ✅
Nomic Embed8192 tokens270 MBVery long documents, research papers
mxbai-embed-large512 tokens1.3 GBGeneral purpose, strong retrieval

The embedding model converts each chunk of text into a vector. If a chunk is longer than the model’s context window, the tail is silently truncated — the vector only represents the first N tokens, and the rest of the chunk is invisible to retrieval.

For legal contracts, this is a critical issue. A non-compete clause or limitation of liability paragraph typically runs 300–500 tokens. With MiniLM’s 256-token window, more than half the clause is cut off before embedding.

Measured on a real contract (Quaker non-compete agreement, 8 pages)

ModelContext windowChunks over windowResult
MiniLM L6-v2256 tokens11 / 16 (69%)Most clauses partially embedded
BGE Large EN v1.5512 tokens0 / 16 (0%)Every clause fully embedded ✅

With MiniLM, 11 of 16 chunks exceeded the 256-token limit. The non-compete restriction itself (chunk 5, 484 tokens) — the most important clause in the document — had nearly half its content truncated during embedding. Retrieval on the truncated vector would return the chunk, but the model would only see an incomplete clause.

BGE Large embeds all 16 chunks in full. The same document, zero truncation.

Chunk size calibration

The chunk sizes ContextSage uses are calibrated to match the active embedding model’s context window. Switching models re-calibrates automatically:

ModelDefault chunk sizeMax chunk size
MiniLM L6-v2200 tokens256 tokens
BGE Large EN v1.5400 tokens512 tokens

This means switching to BGE Large produces fewer, larger chunks per document — each chunk contains a complete legal clause rather than a mid-sentence fragment. A typical 8-page contract produces ~16 well-formed chunks with BGE Large vs ~20 smaller fragments with MiniLM.

How to switch models

  1. Make sure the bridge is running (pnpm bridge)
  2. Open Settings → Embedding model in the app
  3. Select your model — the bridge downloads it on first use
  4. Re-ingest any documents you uploaded under the previous model