# AskGov

### Welcome to the AskGov Self-Hosting Guide

<div align="left" data-full-width="false"><figure><img src="/files/7CQAvwhDSXvKWZSUrIuP" alt=""><figcaption></figcaption></figure></div>

**Replicate the success of Singapore government using AskGov** to:

* **Create a unified knowledge base** for citizen inquiries across all agencies
* **Reduce duplicate questions** with AI-powered search capabilities
* **Maintain complete data sovereignty** within your jurisdiction
* **Integrate with existing government systems** and identity providers
* **Build citizen trust** through transparent, accessible information

Whether you're:

* A government agency evaluating citizen engagement solutions
* A public sector IT team planning your deployment strategy
* A developer customizing AskGov for your specific needs

...this guide aims to assist your path from evaluation to production.

**📖 Documentation Sources**

* **This GitBook** - Complete, currently developed, self-hosting guide
* [**AskGov GitHub Repository**](https://github.com/opengovsg/askgov) - Source code and development resources
* Deploy a test instance locally to evaluate the platform capabilities

<details>

<summary><strong>What is AskGov?</strong></summary>

AskGov is a comprehensive Q\&A platform that enables government agencies to:

* **Answer citizen questions once** and make them discoverable to everyone
* **Reduce repetitive inquiries** through intelligent search and related questions
* **Track citizen feedback** to continuously improve answer quality
* **Provide agency-specific portals** while maintaining a unified knowledge base

Key Features:

* **Hybrid Search**: Combines vector search (semantic understanding) with keyword matching
* **Multi-agency Support**: Each agency maintains its own portal and content
* **Citizen & Officer Modes**: Different access levels for public users and government staff
* **Interactive Guides**: Step-by-step walkthroughs for complex procedures
* **Feedback Analytics**: Track answer effectiveness and citizen satisfaction

This is **not** the end-user manual. For guides on managing questions and answers, visit your deployed instance's help documentation.

</details>

### :anchor: Choose Your Starting Point

This guide **assumes you (or your team) have a reasonable level of technical aptitude**. Specifically, experience with:

* Basic Linux server administration
* Docker or container orchestration
* Managing environment variables and secrets
* Working with Node.js applications
* Database administration (PostgreSQL/CockroachDB)

{% hint style="warning" %}
While we have aimed to make this guide as clear and complete as possible, it is **not an all-encompassing tutorial** for **every possible environment or level of expertise**.

Civic tech teams have different practices, infrastructure, and skillsets. You are expected to adapt instructions as needed for your own context.
{% endhint %}

<table data-view="cards"><thead><tr><th></th><th></th><th data-type="content-ref"></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td>🎯 Decision Maker</td><td><em>"Should my organization adopt AskGov?"</em></td><td></td><td>Get frameworks for cost-benefit analysis, technical feasibility assessment, and understanding how AskGov fits into your digital government strategy.</td><td></td></tr><tr><td>👨‍💻 Developer</td><td><em>"I want to try AskGov locally first"</em></td><td></td><td>Get a local development environment running in 30 minutes to test AskGov's capabilities and understand the architecture hands-on.</td><td></td></tr><tr><td>🏗️ Mature Team</td><td><em>"We want to deploy to production"</em></td><td></td><td>Step-by-step AWS production deployment with security hardening, monitoring, and validation procedures.</td><td></td></tr><tr><td><span data-gb-custom-inline data-tag="emoji" data-code="2601">☁️</span> Cloud Migration</td><td><em>"AWS may not be for us"</em></td><td></td><td>A starting guide for deploying on Azure, GCP, or on-premise infrastructure.</td><td></td></tr><tr><td>🔧 Platform Engineering Team</td><td><em>"We need to integrate with existing systems"</em></td><td></td><td>Replace authentication, email, search, and other components with your organization's preferred alternatives.</td><td></td></tr><tr><td><span data-gb-custom-inline data-tag="emoji" data-code="2696">⚖️</span> Compliance Officer</td><td><em>"Is it okay to use AskGov?"</em></td><td></td><td>Covers legal and compliance requirements you must follow when forking AskGov.</td><td></td></tr></tbody></table>

{% hint style="success" %}
**📖** This guide is organized as a journey from evaluation through advanced deployment, with comprehensive reference materials.

Each section builds upon previous concepts while remaining modular for experienced teams who want to jump ahead.
{% endhint %}

### 🏛️ Key Architectural Components

Understanding AskGov's architecture helps you plan your deployment:

{% hint style="danger" %}
TODO: update remix -> nextjs
{% endhint %}

#### Core Stack

* **Framework**: Remix (React-based full-stack framework)
* **Database**: CockroachDB (distributed SQL, PostgreSQL-compatible)
* **Search Engine**: Weaviate (vector database for hybrid search)
* **UI Components**: Chakra UI with OGP Design System
* **Authentication**: Email/Password with OTP support

#### Integration Points

* **Email Service**: PostmanGovSG (replaceable with any SMTP service)
* **Monitoring**: Datadog RUM (optional)
* **Analytics**: Custom implementation (replaceable)
* **File Storage**: Local filesystem (extensible to S3/cloud storage)

#### Deployment Options

* **Container-based**: Docker/Kubernetes ready
* **Traditional**: VM or bare-metal deployment supported

### 🚀 Quick Feature Overview

Before diving into deployment, understand what AskGov offers:

#### For Citizens

* **Instant Answers**: Search across all government FAQs
* **Related Questions**: AI-powered suggestions for similar inquiries
* **Agency Portals**: Direct access to specific agency information
* **Feedback System**: Rate answers and provide improvement suggestions

#### For Government Officers

* **Content Management**: Create and manage Q\&As without technical knowledge
* **Analytics Dashboard**: Track popular questions and feedback trends
* **Multi-agency Collaboration**: Share knowledge across departments
* **Bulk Operations**: Import/export capabilities for migration

#### For Administrators

* **Superadmin Controls**: System-wide configuration and monitoring
* **Agency Management**: Create and configure agency-specific settings
* **User Management**: Control access levels and permissions
* **Search Configuration**: Fine-tune hybrid search parameters

### 📋 Pre-Deployment Checklist

Before beginning your AskGov journey, ensure you have:

* [ ] **Technical Resources**: Team with Node.js and database experience
* [ ] **Infrastructure Budget**: Estimate based on citizen population
* [ ] **Security Clearance**: Approval to deploy citizen-facing services
* [ ] **Integration Planning**: List of existing systems to connect
* [ ] **Branding Assets**: Agency logos and color schemes ready
* [ ] **Content Strategy**: Plan for initial FAQ migration

### 🤝 Support and Community

While self-hosting means managing your own deployment, you're not alone:

* **GitHub Issues**: Report bugs and request features
* **Documentation Updates**: This guide is continuously improved
* **Community Forum**: Connect with other government teams using AskGov
* **Professional Services**: Commercial support available through OGP partners

### ⚖️ License and Attribution

AskGov is open-source software released under the MIT License. When deploying:

1. **Remove Singapore-specific branding** (required)
2. **Maintain open-source attribution** (required)
3. **Customize for your jurisdiction** (recommended)
4. **Contribute improvements back** (encouraged)

***

{% hint style="info" %}
**Ready to begin?** Start with the Evaluation Guide to assess if AskGov meets your needs, or jump straight to the Quickstart to see it in action.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://international.open.gov.sg/self-hosting/askgov.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
