Ask AI
An AI-powered chat assistant that helps users understand your documentation with context-aware responses
The Ask AI feature provides an intelligent chat assistant built directly into your documentation. Users can ask questions about your docs and get instant, context-aware answers powered by AI. The assistant can search through your documentation, understand context, and provide helpful responses.
How It Works
The AI chat assistant is available in two ways:
1. Per-Page Quick Access
Each documentation page has an "Ask AI about this page" button in the table of contents sidebar. When clicked, it:
- Opens the chat interface
- Pre-fills a prompt asking the AI to read the current page
- Allows users to ask specific questions about that page
2. Global Chat Interface
Users can open the chat interface at any time by:
- Clicking the "Ask AI" button in the navbar
- Using the keyboard shortcut:
⌘I(Mac) orCtrl+I(Windows/Linux)
Once open, users can:
- Ask questions about any part of your documentation
- Upload files or images for context
- View AI-powered search results from your docs
- Get step-by-step guidance on complex topics
Features
Context-Aware Search
The AI assistant includes a built-in search_docs tool that:
- Searches through your documentation content
- Finds relevant pages based on the user's question
- Shows source citations with links to the referenced pages
- Uses the content to provide accurate, contextual answers
Persistent Chat History
Conversations are automatically saved to the browser's IndexedDB, providing:
- Chat history that persists across page reloads
- Ability to continue previous conversations
- Option to start a new chat or clear history
- Offline access to past conversations
Interactive Features
- Suggestions: First-time users see suggested questions to get started
- File Upload: Users can attach files or images for context
- Markdown Support: Responses are formatted with proper Markdown rendering
- Code Syntax Highlighting: Code blocks in responses include syntax highlighting
- Reasoning Display: In development mode, view the AI's reasoning process
Mobile-Responsive
The chat interface adapts to different screen sizes:
- Desktop: Slides in from the right side as a sidebar panel
- Mobile: Opens as a bottom drawer for easy access
Configuration
The environment variables AI_GATEWAY_API_KEY and NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL must be set, which you can read more about in the Environment Variables section.
The model used is openai/gpt-4.1-mini via the Vercel AI Gateway.
Suggested Prompts
You can customize the initial suggested prompts shown to users. These are configured in the Geistdocs configuration file, which you can read more about in the Configuration section.