# A library that answers questions and always shows its source

Entry E02. Sector: Specialist education institute. Status: in production. Delivered: 2026-07.
Source: https://ai.prospicience.in/work/knowledge-library-with-citations

Prospicience built a private question and answer library for a specialist education institute, live in two weeks. Staff ask in plain language and get answers drawn only from approved documents, each citing the document and page. When nothing matches well enough, the library says so before the AI is ever called, so it cannot invent an answer.

Speed: Live in two weeks.

## The challenge

Staff needed fast answers from a large set of approved documents, with proof of where each answer came from. A general chatbot could promise neither: it answers from anywhere and can make things up.

## Why it mattered

In education, a confident wrong answer does real damage: staff pass it on and nobody can trace where it came from. Searching the documents by hand cost time on every question. The institute needed answers it could stand behind, with the source one click away.

## What we built

- Built a private website where staff log in and ask questions in plain language.
- Replaced an unreliable ready made search with our own mid project, so answers come only from the approved library.
- Attached a citation to every answer: the document and the page, slide or video timestamp it came from.
- Added in app upload, so admins can add a PDF or spreadsheet and it joins the library straight away.

## The result

- A live library where every answer links to its exact source.
- Answers held to a minimum match of 65 out of 100, with a clear refusal below that instead of a guess.
- Admins add new documents themselves, with no developer involved.
- From brief to live in two weeks.

## Built for trust

The library answers only when a document clears a minimum match, and that check runs before the AI is called, so a made up answer has no way out. Instructions hidden inside documents are treated as content and never obeyed.

## AI at work

AI answers staff questions from the institute's approved documents and names the document and the page, slide or timestamp behind every answer. When nothing in the library matches well enough, it says so instead of guessing.

What it produces: answers with their source, citations to the page, slide or video timestamp, clear refusals when nothing matches, new uploads ready to search.

- Staff get an answer from one question instead of searching the documents by hand.
- Admins upload a PDF or spreadsheet and it joins the library straight away, so the library grows with no developer involved.
- The minimum match of 65 out of 100 is checked before AI is called, so a weak question costs nothing and never produces a guess.

How it works day to day: A staff member logs in and asks in plain language. The library finds the closest approved passages, and if they clear the bar AI writes the answer from them, with the citation taken from the source itself. Admins keep it current by uploading new documents.

## Figures from the delivered system

- minimum match before answering: 65 out of 100
- from brief to live: 2 weeks
- document storage: private, timed links
- who can see what: enforced per user

## The technology

- A private site where staff log in and ask a question
- Answers come only from your approved documents
- Every answer names the document and the page or slide
- If the library has no good match it says so rather than guessing

AI models used: Gemini (Google).

### Technical notes

- Self managed retrieval on Postgres with pgvector, after a managed file search product proved unreliable mid project
- 1536 dimension embeddings with cosine similarity search
- Hard abstain gate at a 0.65 similarity floor, evaluated before the model is invoked
- Citations built deterministically from the retrieved passage metadata, never generated by the model
- Retrieved documents treated as data and never as instructions, with an explicit prompt injection boundary
- Private object storage with short lived signed links, per user access enforced in the database

## Questions

### Can an AI answer only from our documents and never invent anything?

Yes. Retrieval runs first, and if nothing clears the minimum match the system returns a clear refusal without calling the model. A model that is never asked cannot invent an answer.

### How do we know where an answer came from?

Every answer carries the document name and the page, slide or timestamp. Citations are assembled from the source passage itself rather than written by the model, so they cannot be fabricated.

### What if a document contains text that tries to instruct the AI?

Retrieved content is treated as data, never as instructions. A document that says ignore your rules gets quoted, not obeyed. Injection attempts were tested on the live system and each one returned the refusal.

Capabilities: rag-with-citations, ai-governance-and-guardrails, document-intelligence.
