Contract review
Answer clause questions with the exact quote, page and bbox. Protects against: a confident answer that no clause actually supports. Read →
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 CiteNexusfrom 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?")package main
import ( "fmt"
"github.com/muthuishere/citenexus/golang/answer")
func main() { corpus := []answer.Doc{ {DocumentID: "employee-nda", Text: "The employee shall not disclose confidential information."}, }
res := answer.Ask(corpus, "Can the employee disclose confidential information?", answer.DefaultTopK)
fmt.Println(res.Evidence.Decision) // answered fmt.Println(res.Answer) // verbatim from the corpus — or the refusal fmt.Println(res.Sources[0].Document) // employee-nda}answeredThe employee shall not disclose confidential information.employee-ndaThe difference: there is no CiteNexus object, no ingest(), no storage and
no config — you pass the corpus in memory on every call. Ask runs on
deterministic in-process fakes (no endpoint needed); answer.AskWith(corpus, q, topK, answer.Providers{…}) puts your own models behind the same flow.
import { ask } from "@muthuishere/citenexus"
const corpus = [ { document_id: "employee-nda", text: "The employee shall not disclose confidential information." },]
const res = ask(corpus, "Can the employee disclose confidential information?")
console.log(res.evidence.decision) // answeredconsole.log(res.answer) // verbatim from the corpus — or the refusalconsole.log(res.sources[0].document) // employee-ndaansweredThe employee shall not disclose confidential information.employee-ndaThe difference: same as Go — no facade, no storage, corpus in memory. Note
topK lives inside the options object here (askWith(corpus, q, { embedding, generator, topK })), where Go takes it positionally.
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.
Go ships the deterministic core — the
faithfulness gate, the 14-script tokenizer, the chunker, BM25, RRF and Result,
at conformance parity with Python. It has no S3 storage layer, no ACL, no
vision, no evaluate() and no reconcile(); each page below says so in this
tab where the Python step depends on one.
JavaScript ships the same deterministic core as
Go, at the same conformance parity, with the same gaps — no storage, ACL, vision,
evaluate() or reconcile(). Each page below names the gap in this tab rather
than sending you elsewhere.