Back office ops · Production

Pair Search: hybrid semantic and keyword search over Singapore's 30,000+ Hansard parliamentary records

The problem

Singapore's official Hansard search was purely keyword-based, flooding results with documents that frequently mentioned a query word but were only tangentially related, while presenting no smart text snippets to help users evaluate relevance.

First attempt

The existing official Hansard search engine ranked results by single-word frequency rather than full-phrase or semantic relevance, causing searches on common terms such as 'covid' to return irrelevant documents with no snippet preview.

Workflow diagram · grounded in source
1
Hansard database ingestion
integration
“We undertook the challenging task of scraping and parsing the extensive Hansard database. This site contains over 30,000 reports starting from 1955. Given the evolving data formats over the decades, standardizing this diverse information…”
2
Hybrid keyword and semantic retrieval
ai_action
“The retrieval mechanism combines keyword-based and semantic search strategies. The keyword-based search utilizes Vespa's weakAnd operator alongside nativeRank and BM25 text matching algorithms to efficiently sift through vast amounts of …”
3
Multi-phase ColbertV2 reranking
ai_action
“Phase 1: each content node employs cost-effective algorithms to narrow down the initial set of results. Phase 2: a more resource-intensive re-ranking is performed using the ColbertV2 model, ensuring that the most relevant documents are p…”
4
Ranked results presented
output
“Information should be immediately presented in as useful a format as possible, to aid users in deciding which results are worth further investigating”
Reported outcome

Pair Search achieved dramatic improvements in search result quality and is averaging ~150 daily users and ~200 daily searches in its soft launch, with government policy officers reporting productivity gains and faster results.

Reported metrics
Daily users (soft launch)~150
Daily searches (soft launch)~200
Search result qualitydramatic improvements in search results
Productivity impact (user feedback)improve productivity by a few folds
Show all 5 reported metrics
daily users (soft launch)~150
daily searches (soft launch)~200
search result qualitydramatic improvements in search results
productivity impact (user feedback)improve productivity by a few folds
search speed (user feedback)Returns results much faster than the current one
Reported stack
Vespa.aie5 embeddingsColbertV2BM25
Source
https://hack.gov.sg/hack-for-public-good-2024/2024-projects/pairsearch/
Read source ↗

Frequently asked questions

What did this team achieve with this AI workflow?

Pair Search achieved dramatic improvements in search result quality and is averaging ~150 daily users and ~200 daily searches in its soft launch, with government policy officers reporting productivity gains and faster…

What tools did this team use?

Vespa.ai, e5 embeddings, ColbertV2, BM25.

What results were reported?

Daily users (soft launch): ~150; Daily searches (soft launch): ~200; Search result quality: dramatic improvements in search results; Productivity impact (user feedback): improve productivity by a few folds (source-reported, not independently verified).

What failed first in this deployment?

The existing official Hansard search engine ranked results by single-word frequency rather than full-phrase or semantic relevance, causing searches on common terms such as 'covid' to return irrelevant documents with n…

How is this back office ops AI workflow structured?

Hansard database ingestion → Hybrid keyword and semantic retrieval → Multi-phase ColbertV2 reranking → Ranked results presented.