AI

Agent

Docus Agent provides AI-powered features for your documentation, including a chat assistant and automated PR documentation reviews.

Agent

Docus Agent provides AI-powered features for your documentation, including a chat assistant and automated PR documentation reviews.

About Docus Agent

The agent enhances your documentation workflow and user experience through two main features:

  • Chat Assistant: Answers user questions directly on your documentation site using natural language and source citations.
  • Review Agent: Automatically reviews Pull Requests and suggests or commits documentation updates to keep your docs in sync with code changes.
The agent requires an AI Gateway API key to function.

Chat Assistant

The chat assistant answers questions about your documentation through natural language queries. It is embedded directly in your documentation site, so users can find answers quickly.

When users ask questions, the assistant:

  • Searches and retrieves relevant content from your documentation using an MCP server.
  • Cites sources with navigable links to take users directly to referenced pages.
  • Generates copyable code examples to help users implement solutions from your documentation.

Using the Assistant

Users can interact with the assistant in multiple ways:

Floating Input

On documentation pages, a floating input appears at the bottom of the screen. Users can type their questions directly and press Enter to get answers.

Use the keyboard shortcut I to focus the floating input.

Explain with AI

Each documentation page includes an Explain with AI button in the table of contents sidebar. Clicking this button opens the assistant with the current page as context, asking it to explain the content.

Slideover Chat

When a conversation starts, a slideover panel opens on the right side of the screen. This panel displays the conversation history and allows users to continue asking questions.

Review Agent

The Review Agent is a specialized documentation agent that keeps your docs in sync with your code. Triggered by GitHub webhooks, it analyzes Pull Request diffs and identifies necessary documentation updates.

  • Automated Reviews: Automatically scans every PR for changes that impact documentation.
  • Content Discovery: Uses the built-in MCP server to find existing pages related to the changed code.
  • Direct Commits: Can commit updated documentation directly to your PR branch or post suggestions as comments.

Setup for Review Agent

To enable the Review Agent, you need to provide GitHub App credentials:

Create a GitHub App

Create a new GitHub App with Read & Write permissions for Pull Requests and Repository Contents.

Generate Credentials

Generate a private key and a webhook secret for your app.

Set Environment Variables

Add the following to your environment:

.env
GITHUB_APP_ID=your-app-id
GITHUB_APP_PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----\n..."
GITHUB_WEBHOOK_SECRET=your-webhook-secret

Enable in Configuration

Enable the review feature in your nuxt.config.ts:

nuxt.config.ts
export default defineNuxtConfig({
  docus: {
    agent: {
      review: {
        enabled: true,
        mode: 'commit' // or 'comment'
      }
    }
  }
})

Quick Start

1. Set Environment Variables

Add your API key and GitHub credentials to your environment:

.env
AI_GATEWAY_API_KEY=your-api-key

# For Review Agent
GITHUB_APP_ID=...
GITHUB_APP_PRIVATE_KEY=...
GITHUB_WEBHOOK_SECRET=...

2. Configure Nuxt

The agent features are automatically detected based on environment variables, but you can explicitly configure them:

nuxt.config.ts
export default defineNuxtConfig({
  docus: {
    agent: {
      chat: {
        enabled: true
      },
      review: {
        enabled: true
      }
    }
  }
})

Configuration

Nuxt Configuration

Configure advanced options in nuxt.config.ts:

model
string
AI model to use (uses AI SDK Gateway format). Default: google/gemini-3-flash
mcpServer
string
MCP server path or URL. Default: /mcp
chat.enabled
boolean
Enable the chat assistant. Default: true (if API key present)
chat.apiPath
string
API endpoint for the chat assistant. Default: /__docus__/assistant
review.enabled
boolean
Enable the PR documentation review agent. Default: false
review.mode
string
Mode for the review agent: commit (direct commits) or comment (PR comments). Default: comment
review.githubRepo
string
Target GitHub repository (e.g., owner/repo). Auto-detected in CI.

App Configuration

The Chat Assistant UI can be customized through app.config.ts:

app.config.ts
export default defineAppConfig({
  assistant: {
    // Show the floating input on documentation pages
    floatingInput: true,

    // Show the "Explain with AI" button in the sidebar
    explainWithAi: true,

    // FAQ questions to display when chat is empty
    faqQuestions: [],

    // Keyboard shortcuts
    shortcuts: {
      focusInput: 'meta_i'
    },

    // Custom icons
    icons: {
      trigger: 'i-lucide-sparkles',
      explain: 'i-lucide-brain'
    }
  }
})

FAQ Questions

Display suggested questions when the chat is empty.

export default defineAppConfig({
  assistant: {
    faqQuestions: [
      'How do I install Docus?',
      'How do I customize the theme?'
    ]
  }
})

Programmatic Access

Use the useAssistant composable to control the assistant programmatically:

<script setup>
const { isEnabled, isOpen, open, close, toggle } = useAssistant()

function askQuestion() {
  // Open the assistant with a pre-filled question
  open('How do I configure the theme?', true)
}
</script>
isEnabled
ComputedRef<boolean>
Whether the agent's chat feature is enabled.
isOpen
Ref<boolean>
Whether the slideover is open.
open
Function
Open the assistant: open(message?: string, clearPrevious?: boolean)
close
Function
Close the assistant slideover.
toggle
Function
Toggle the assistant open/closed.
clearMessages
Function
Clear the conversation history.
Copyright © 2026