Private Document Analysis AI
A privacy-first document intelligence prototype, built for a client, that answers questions about uploaded documents and spreadsheets using a three-tier query architecture. Deterministic logic handles what it can, a schema engine handles what it should, and a local LLM with RAG handles the rest. No document content is sent to external AI services.
The Challenge
A three-tier query engine answers questions across 25+ file formats on a dedicated private GPU server, with no document content sent to external AI services - solving the confidentiality problem off-the-shelf tools like ChatGPT can't.
Organisations handling sensitive documents - legal transcripts, membership records, internal reports - need to query and analyse that data without sending it to third-party AI services. Off-the-shelf tools like ChatGPT require uploading content to external servers, which is unacceptable when confidentiality is non-negotiable.
The system needed to run entirely on private infrastructure, accept a wide range of file formats (spreadsheets, PDFs, Word documents, images), answer questions with verifiable accuracy where possible, and only invoke AI when simpler methods genuinely could not answer the question.
Approach
Results
The three-tier architecture means the majority of data questions are answered instantly and deterministically, reserving AI processing for questions that genuinely require reasoning or synthesis. Tiers 1 and 2 were validated against 96 test queries with zero hallucination by design - they use deterministic logic, not probabilistic generation.
The split report architecture solves a problem that plagues most AI document tools: when numbers and narrative are generated by the same model, the AI can invent statistics. Here, quantitative outputs (charts, counts, tables) are produced by Python code rather than generated by the model, while qualitative analysis (themes, quotes, insights) is generated by the AI from document passages. The two streams are kept strictly separate and stitched together only at presentation.
For the client, the prototype demonstrated the analytical capability of a modern AI assistant with the data control of a dedicated private deployment. Sensitive documents could be queried, cross-referenced, and analysed without any document content being sent to an external AI provider.
How it was tested
- Tiers 1 and 2 validated against 96 test queries; they use deterministic logic, not probabilistic generation.
- Numbers and narrative are kept apart: charts, counts and tables come from Python code, and only the qualitative analysis comes from the AI, so the model cannot invent statistics.
- Client prototype: Tier 3 answers come from the AI model and are grounded in retrieved passages, not deterministic like Tiers 1 and 2.