Live example · runs in your browser
Ask your documents, get cited answers.
Pick a sample document set or paste your own text, then ask a question. The answer is taken word for word from the documents, with a numbered citation for each sentence and the source passages listed below it. Nothing is uploaded: the search runs on this page.
PDF and Word files are not supported on this page. The production version reads them.
Suggested questions
Your answer will appear here.
How this works
Retrieval, ranked passages, cited answer
The page contains no language model. It finds the passages that match the question and quotes them, so it cannot say anything the documents do not say.
Retrieval
The documents are cut into passages of roughly 80 to 150 words, each keeping its section title. The question and the passages are lowercased, stripped of common words and reduced to word stems, so "refund" matches "refunds" and "reimbursed".
Ranked passages
Each passage gets a BM25 score: rare words count for more, repeated words count for less, and long passages are not favoured. The best passages are kept in order.
Answer with citations
The most relevant sentences from the top passages are quoted, each followed by a number that points to its source passage below. When the match is weak, the page says so instead of guessing.
What the production version adds
Beyond keyword matching
This page shows the principle. A delivered assistant is built around your documents and your channels.
Better answers
- Embeddings and reranking, so questions are matched by meaning and not only by shared words.
- A language model that writes the answer only from the cited passages, with a fallback to the plain passages.
- An evaluation set of real questions, run on every change, so quality is measured and not assumed.
Better reach
- PDF, DOCX and HTML ingestion with a scheduled refresh when documents change.
- Telegram, WhatsApp or a widget on your website.
- Handover to a person when the assistant is not sure, with the conversation attached.
See the document assistant service → Open-source repository: doc-rag-api →