Skip to content

Which scenario?

Each scenario is a complete build, not a snippet: the problem, the code, what comes back, and — most importantly — the specific failure it protects you from. Start with the one whose failure mode you recognise. One of them — Wrong subject, right source — documents a failure CiteNexus does not yet prevent; it is here because a docs set that only lists wins is not a docs set you can plan against.

Contract review

Answer clause questions with the exact quote, page and bbox. Protects against: a confident answer that no clause actually supports. Read →

Conflicting sources

Two documents assert opposite things. Protects against: rank order silently deciding which truth you see. Read →

Wrong subject, right source

A perfectly grounded, top-authority citation about the wrong kind of thing. A known open gap — read it before you trust an answer unread. Read →

Regulated audit

Prove the index is derived from exactly the agreed corpus. Protects against: citing a document nobody agreed was in scope. Read →

Right to erasure

Revoke a document and prove every byte is gone. Protects against: a delete that reports success and leaves the text behind. Read →

Multilingual desk

Ask in one language over a corpus in another. Protects against: a translated quote being passed off as the evidence. Read →

Cross-lingual corpus

The binding clause is in a script the query shares no tokens with. Protects against: a superseded document answering, verbatim and correctly cited. Read →

Evaluate a corpus

Score groundedness and abstention against a golden set. Protects against: shipping a change that answers more and cites less. Read →

Support assistant

A help-desk bot that says “I don’t know” correctly. Protects against: inventing a refund policy that never existed. Read →

Every scenario below starts from one of these three entry points. They are different shapes, not translations of each other: Python owns the corpus for you (storage, ingest, models, config); Go and JavaScript take the corpus as an argument and hand back the identical cite-or-abstain Result.

from citenexus import CiteNexus
from citenexus import OpenAICompatibleEmbedding, OpenAICompatibleGenerator
rag = CiteNexus(
"./citenexus-data", # a local directory, or s3://bucket
embedder=OpenAICompatibleEmbedding(
base_url="http://localhost:11434/v1", model="bge-m3"),
generator=OpenAICompatibleGenerator(
base_url="http://localhost:11434/v1", model="qwen2.5"),
)
rag.ingest("employee-nda.pdf")
response = rag.ask("Can the employee disclose confidential information?")

Nothing is bundled. Every model is an injected OpenAI-compatible endpoint, so the same code runs against Ollama on your laptop, a self-hosted vLLM inside your VPC, or a hosted API — which is what makes an EU-sovereign or air-gapped deployment a configuration choice rather than a fork.

Every scenario page below is written against this facade: ingest / ask / retrieve / evaluate / delete / reconcile, with storage on disk or S3.