Answers that show their source.
Citewise answers questions from company documents. Every sentence carries a citation, and every citation is checked against the document before anyone sees it.
In plain words
You ask a question about your company documents and get a short answer. Next to each sentence is the exact line it came from. When the documents do not hold the answer, it says so instead of guessing.
How it works
Ask in your own words
The question goes in the way a person would type it into a help chat.
Get an answer with its sources
Each sentence links to the passage it rests on. One click highlights the quoted line in the document.
Or an honest "I do not know"
A question the documents do not cover is refused. Nothing is filled in from general knowledge.
The problem
A document assistant that sounds right and points at a passage that does not say what the answer claims. Prompting harder does not fix it.
What we built
The answer is drafted as separate claims, each with a source and a word-for-word quote. Plain code then checks that the quote really is in that source. A claim that fails is dropped; if nothing is left, the assistant says it does not know.
How we know it works
| Test questions | 22 |
|---|---|
| Right passage in the top three | 94.4% |
| Answered and cited the right passage | 88.9% |
| Refused questions the documents do not cover | 100% |
| Citations that passed the check | 100% |
Two questions are missed and stay listed on the demo page: keyword search does not connect "lose my laptop" with "lost device".
- Built with
- TypeScript, Express, own BM25 search
- Model
- Any OpenAI-compatible endpoint; runs without one
- Checks
- 9 unit tests, eval gate
- Good fit for
- Help centers, internal handbooks, policy search
Under the hood
- DocumentsMarkdown, one chunk per heading
- SearchBM25 picks the closest passages
- DraftClaims, each with a source and a quote
- CheckThe quote must be in the source, word for word
- AnswerOnly claims that passedorRefusalNothing passed
The model path is covered by tests against a stubbed endpoint, including a fabricated quote that must be dropped. It has not been run against a live provider yet.
Decisions and why
The check is code, not a prompt
String matching does not depend on the model behaving. A made-up quote is dropped every time.
Keyword search before embeddings
BM25 needs no outside service, so the demo costs nothing to run. The index sits behind one class and can be swapped for embeddings or a hybrid.
The model is replaceable
It sits behind one interface. Without a key the answer is assembled from the best-matching sentences, so the whole pipeline runs with no model at all.
The misses stay visible
Two test questions fail and are shown on the demo page. They mark where keyword search stops.