UK parish councils publish thousands of documents: meeting minutes, agendas, budgets, audit reports, planning notices. But there was no way to search across them.
Council clerks and residents who needed to find a specific decision, figure, or outcome had to open individual PDFs one by one. A question like "what did the council decide about the car park in 2024?" meant hours of manual digging through dozens of files.
No cross-document search existed. No way to ask a question in plain English and get an answer with a source.
The Solution
I built an AI-powered search system that ingests parish-council documents, embeds them using Google Gemini, and answers plain-English questions with exact citations pulled from the source PDFs.
How it works:
Document ingestion pipeline — automated scrapers pull new documents from council websites within hours of publication
OCR pipeline — handles scanned PDFs that aren't machine-readable
Vector embeddings + hybrid search — PostgreSQL with pgvector stores document embeddings; combines semantic search with keyword matching for better recall
Cross-encoder reranking — sentence-transformers rerank results to surface the most relevant passages
Citation extraction — every answer includes the exact source document and passage, so users can verify
Plain-English interface — non-technical users (clerks, residents) can query complex topics with no training
Streamlit admin panel — for managing documents, monitoring ingestion, and system configuration
Automated updates — GitHub Actions CI/CD keeps the system current as new documents are published
The Architecture
Frontend: Next.js
Backend: FastAPI + SQLAlchemy + Alembic
AI/ML: Google Gemini embeddings, cross-encoder reranking (sentence-transformers)
Database: PostgreSQL + pgvector for vector storage and hybrid search