> ## Documentation Index
> Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Governance Gap Analysis

> AI-powered compliance gap analysis that generates an assessment of gaps for a selected regulatory requirement.

This screen uses AI to analyze compliance gaps against a selected regulatory requirement at route `/gr/ai/gap-analysis`.

## Overview

The AI Gap Analysis page requires the AI Compliance Advisor to be enabled in GR settings. When disabled, it shows a blocked state. When enabled, users select a regulatory requirement from a dropdown populated by `useRegulatoryRequirementList`. Clicking **Run Analysis** sends a prompt to the AI containing the requirement title, description, category, and current status. Previous analysis results for the selected requirement are listed via `useAIGapAnalysesList`. An AI Chat Panel is accessible via **Ask AI Advisor**.

## Who it's for

Access follows your organization's role and module configuration. AI Compliance must be enabled in GR settings.

## Before you start

* AI Compliance must be enabled in GR settings (`/gr/settings`).
* Regulatory requirements must exist in the system.

## Steps

<Steps>
  <Step title="Navigate to Gap Analysis">Go to `/gr/ai/gap-analysis`.</Step>
  <Step title="Check feature availability">If the AI Compliance Advisor is disabled, click **Go to Settings** and enable it.</Step>
  <Step title="Select a requirement">Choose a regulatory requirement from the dropdown.</Step>
  <Step title="Run the analysis">Click **Run Analysis** to generate an AI gap assessment for the selected requirement.</Step>
  <Step title="Review analysis results">Review the generated and previously stored analyses listed below the selector.</Step>
  <Step title="Ask the AI Advisor">Click **Ask AI Advisor** to open the chat panel for follow-up questions.</Step>
</Steps>

## Key concepts

* **Gap analysis prompt** — includes requirement title, description, category, and current compliance status.
* **AI Compliance Advisor** — must be enabled in GR settings.
* **Previous analyses** — retrieved by `useAIGapAnalysesList` filtered by the selected requirement ID.

## Related

<Columns cols={2}>
  <Card title="Governance & Compliance" icon="scale-balanced" href="/gr/overview">
    Governance & Compliance core overview.
  </Card>

  <Card title="Governance & parity" icon="clipboard-check" href="/governance/index">
    Documentation coverage and governance.
  </Card>
</Columns>

<Note>
  This page documents shipped product behavior. It is not medical, legal, or
  billing advice. Verify against your organization's policies and applicable
  regulations before using it for clinical, compliance, or billing decisions.
  Protected health information (PHI) shown in the product is governed by your
  tenant's access controls and is never exposed in this documentation.
</Note>

<Accordion title="Documentation sources">
  * src/routes/gr.tsx
  * src/cores/gr/pages/AIGapAnalysis.tsx
  * src/cores/gr/hooks/useAIComplianceEnabled.ts
  * src/cores/gr/hooks/useRegulatoryRequirement.ts
  * src/cores/gr/ai/index.ts
</Accordion>
