Skip to main content

Project Overview

Aceh Agentic RAG + OCR is the backend for a self-hosted government document intelligence platform. It serves internal Pemprov Aceh users, retrieves from 100,000+ documents, answers in Bahasa Indonesia and English, and keeps all document storage, inference, retrieval, prompt management, and observability inside client-controlled Huawei Cloud.

Platform boundary

The platform provides backend APIs and WebSocket surfaces for chatbot, dashboard, batch-upload, and integration clients. It includes upload, ingestion status, search, query, OCR, retrieval, answer synthesis, Policy Guard, observability, and administrative API capabilities.

Primary users and documents

The platform is designed for 10-50 internal concurrent users. The corpus includes government legal, public-information, open-data, and one-data material from JDIH, PPID, OpenData, and SatuData, plus manually uploaded or batch-ingested documents.

Core capabilities

CapabilityPurposeAvailability
Multi-format ingestionParse, OCR, validate, chunk, embed, and index documentsCore capability, with source connectors expanding over time
OCR SystemExtract text from scanned images/PDFs and route low-confidence text to reviewCore capability, with human-review workflows layered on top
Hybrid retrievalSemantic pgvector search plus PostgreSQL full-text search fused by RRFCore capability
Grounded answeringSynthesizer returns cited answers with a faithfulness checkCore capability
Policy GuardAnti-SARA, anti-jailbreak, government communication filteringCore capability, hardened through evaluation
Long-Term MemoryConversation persistence and session resumePlanned API capability for multi-turn use
Agentic orchestrationRouter, Planner, Executor wrapping the SynthesizerPlanned capability for complex questions
Tool registryVector Search plus Excel Query, SQL Query, Legal Check, Summarizer, Cross-ReferenceVector Search first, then domain-specific tools
EvaluationGolden dataset, retrieval metrics, answer faithfulness, citation accuracyAcceptance and continuous-quality capability

System spine

API clients
-> FastAPI service
-> ingestion / query / search service layer
-> PostgreSQL + pgvector + full-text search
-> LiteLLM / model endpoints
-> Langfuse tracing and prompt management
-> audit log

The platform prioritizes the ingestion to retrieval to grounded-answer path first. Agentic orchestration and multi-turn memory build on that retrieval spine so answers stay grounded in indexed government documents.

Non-negotiable constraints

  • Data and inference stay inside Huawei Cloud. No external SaaS or data egress for delivered operation.
  • Delivered dependencies must be OSI-licensed open source.
  • Retrieval is hybrid by default. Semantic-only retrieval is not acceptable.
  • Every answer needs source citations and faithfulness gating.
  • OCR confidence is recorded, and low-confidence OCR is not indexed as normal text.
  • Government Policy Guard wraps every generated answer.