← ALL POSTS · /BLOG

Cover: “Cohere RAG with XERJ” in large display type, then “Private. Confident. Verifiable.”; beside it a flow of four boxes joined by arrows: 01 XERJ finds the passages (yellow), 02 Rerank orders them (coral), 03 Command answers from them (deep green), 04 you check the file and page (outlined)
COHERE ON-PREM RAG · V1.0.0-RC.102 · 2026-11-10

COHERE RAG WITH XERJ:
PRIVATE, CONFIDENT, VERIFIABLE.

Ask Command about years of your own documents, code and records. Get an answer you can check, with the file and page it came from.

XERJ is a new way for AI to search for data. It runs on a CPU server next to your data, finds the passages, and hands them to Cohere Rerank and Command. All three Cohere hooks shipped in rc.102.

01 · WHAT A COHERE TEAM CAN DO NOW

Point it at the data you already have

Before, giving Command your data meant building a pipeline: export, chunk, embed, store, then keep it in sync. Now you point one binary at the folders and the database where they already live.

COMPLIANCE

"How long does a member have to appeal a claim decision?"

Asked across policy PDFs and claims manuals. Command answers, and each citation names the file and the page.

ENGINEERING

"Where do we retry a failed payment, and why?"

Asked across your repositories and design docs. The answer cites the files it read.

OPERATIONS

"How many denied claims in the West, and their total?"

Asked against a live Postgres table. The count and the sum come from the data, not from the model.

02 · HOW IT FLOWS

Find, order, answer, check

A flow in four steps. XERJ finds the passages. Cohere Rerank orders them. Cohere Command answers from them. You check each citation against its file and page. 01XERJfinds the passagesBM25 + kNN + RRF → 02RERANKorders themrerank-v5.0-fast → 03COMMANDanswers from themChat endpoint → 04YOU CHECKeach citationfile + page STEPS 01 TO 03 STAY INSIDE YOUR NETWORK WHEN COHERE RUNS IN YOUR PRIVATE DEPLOYMENT
03 · PRIVATE

Your data stays where it is

XERJ indexes files, code and live Postgres tables on one CPU server inside your network. A stock node never calls Cohere. Each hook is off until you set a key and an endpoint.

Point those endpoints at a Cohere private deployment, on-prem or in your VPC, and the question, the passages and the answer stay inside. Point them at Cohere's API and this is what leaves:

The query, the model name and the text of up to window hits. Sent to api.cohere.com/v2/rerank, or the endpoint you set.

04 · CONFIDENT

Good passages in, exact numbers out

05 · VERIFIABLE

Every citation points at a page

XERJ indexes one record per PDF page or section, and each record keeps its file path and page. The best hits go to Command's Chat endpoint as documents, with the XERJ _id as the document id and the file and page as the source:

{"id": "<XERJ _id>",
 "data": {"title": "...", "snippet": "...", "source": "<path>#page=<page>"}}

When Command cites a document, the cookbook reads the record back from XERJ by that id and prints where it came from:

$ python3 command_rag.py ask "What is the appeal deadline?" --assert-citations
...
Citations:
  '<cited text>' -> <path> page <page> (_id <XERJ _id>)

A worked example with 13 public NIST and CMS documents and a live 200,000-row Postgres table is in the Cohere RAG worked example.

06 · TRY IT

One prompt for your agent

FOR YOUR AI AGENT

Install XERJ from https://xerj.org/llms.txt and index the folder I point you to. Turn on Cohere Rerank for _search with my COHERE_API_KEY, using the setup at https://xerj.org/integrations/cohere. Run one search with and without rerank, and show me both top 5 lists and the _rerank block.

07 · SETUP

Two blocks of config

# xerj.toml
[rerank.cohere]
api_key  = "co-..."                            # or COHERE_API_KEY
endpoint = "https://api.cohere.com/v2/rerank"  # or your private deployment

[embedding]
mode = "proxy"
default_endpoint = "https://api.cohere.ai/compatibility/v1"
default_model = "embed-v5.0-pro"

Rerank models accepted: rerank-v5.0-fast, rerank-v5.0-pro, rerank-v3.5. The Command cookbook is in docs/examples/cohere/command-rag, and cohere-tools.json gives Command six XERJ search and memory tools. Full reference: the Cohere integration page and docs/COHERE.md. XERJ is not affiliated with Cohere.