Building SuchanaAI: Indexing & Searching Nepal’s Government Notices at Scale
How we engineered SuchanaAI to ingest thousands of fragmented PDF circulars, run bilingual Devanagari OCR, and enable semantic vector search across Nepal’s public sector notices.
In Nepal, public sector notices, civil service openings (Lok Sewa Aayog), and ministerial circulars are published across dozens of disparate government portals. Most documents are uploaded as low-resolution scanned PDFs with non-standard Devanagari fonts or raw image bitmaps.
Finding a single scholarship announcement or procurement tender historically meant opening fifteen browser tabs, refreshing slow servers, and manually scanning hundred-page Gazette issues. We built SuchanaAI to solve this problem by combining automated web crawling, multi-stage OCR pipelines, and semantic vector search.
1. The Ingestion Engine & PDF Extraction Pipeline
The primary engineering hurdle is not language modeling; it is data ingestion fidelity. Government circulars are rarely clean UTF-8 text. They consist of:
- Pre-Unicode font encodings (Preeti, Kantipur) where glyph codes collide with English ASCII.
- Photocopied and stamped sheets with skewed baselines and bleed-through ink.
- Irregular tabular columns spanning multiple portrait and landscape pages.
// Pipeline extraction contract
export interface NoticeDocument {
id: string;
sourceUrl: string;
ministry: string;
publishedDateBs: string;
rawText: string;
cleanText: string;
embeddings: number[];
ocrConfidence: number;
}
To handle this, our crawler feeds raw PDFs into an asynchronous Python worker pool orchestrated with FastAPI and Redis queues. We apply adaptive binarization, deskewing, and custom Unicode font transliteration before invoking Tesseract 5 with specialized Nepali language training sets.
2. Bilingual Semantic Vector Search with pgvector
Keyword matching in Devanagari often fails due to inflectional suffixes, spelling variations, and colloquial search terms. A user querying "शिक्षक भर्ना" (teacher recruitment) should match notices containing "अध्यापन अनुमति पत्र" (teaching license exam) or "माध्यमिक तह दरबन्दी".
We utilize a dense retrieval architecture using multi-lingual sentence embeddings coupled with PostgreSQL's pgvector extension.
-- Hybrid semantic + full-text query in PostgreSQL
SELECT
id,
title,
ministry,
published_date,
1 - (embedding <=> $1::vector) AS semantic_score,
ts_rank(tsv_body, plainto_tsquery('simple', $2)) AS text_score
FROM notices
WHERE (1 - (embedding <=> $1::vector)) > 0.68
ORDER BY (semantic_score * 0.7 + text_score * 0.3) DESC
LIMIT 20;
By blending cosine distance from high-dimensional embeddings with lexical full-text ranks, SuchanaAI returns high-precision results within 45 milliseconds across over 100,000 indexed documents.
3. Real-Time Indexing and Alert Subscriptions
Beyond on-demand search, users can configure personalized alerts for specific ministries or keywords. When new notices are published:
- The crawler detects new PDF links via checksum diffing.
- Ingestion completes in under 30 seconds.
- Notification triggers match subscriber criteria and dispatch instant push notifications and WhatsApp summaries.
Engineering SuchanaAI taught our team that applied AI is 90% systems design, robust data pipelines, and error resilience. Solving real information accessibility challenges in Nepal remains one of the most rewarding milestones in our engineering journey.


