The problem
In many organisations, answers to routine questions live in long PDFs and wikis. Staff either search for a long time or ask a colleague, and the answers they get are not always current. This concept explores an assistant that answers from approved documents only, and shows where each answer came from.
Requirements
- Answer only from an approved document set; say “I don’t know” otherwise.
- Show the source document and passage for every answer.
- Respect document permissions so people only see what they are allowed to.
- Keep per-question cost predictable and visible to administrators.
- Let administrators add, update and retire documents without engineering help.
Approach
- Start with an evaluation set of real questions and expected sources before building the interface.
- Use hybrid retrieval (keyword + semantic) because policy documents often hinge on exact terms.
- Constrain generation to retrieved passages and validate that citations exist in the source.
- Log questions without personal data to find gaps in the documentation itself.
Architecture
- Interface
- React web app with chat-style Q&A, inline citations and a document viewer.
- API
- Node.js service handling auth, permission filtering, retrieval and model calls.
- Retrieval
- PostgreSQL with pgvector for embeddings plus full-text search, merged and re-ranked.
- Ingestion
- Background jobs that parse, chunk and embed documents when they change.
- Model
- Provider-agnostic adapter so the language model can be swapped or self-hosted.
Implementation plan
- Typed API contract shared between front-end and back-end.
- Evaluation script that runs the question set and reports answer and citation accuracy.
- Rate limiting and per-user cost caps enforced on the server.
- Admin screens for document upload, status and retirement.
Verified outcomes
None. This is a concept study, so there are no real-world results to report.