# Ask Your Page Widget

**Technical ID**: `cf.cplace.citizenAi.askYourPageWidget`

## Overview

The Ask Your Page widget provides an AI-powered conversational interface that helps users explore and understand the current page through natural language questions. The widget automatically understands the page context including all attributes, relationships, and attached files, and provides intelligent responses with clickable links to related pages and documents.

This is a zero-configuration widget that works out of the box without requiring any Low-Code scripting. It maintains per-user conversation history on each page, enabling contextual follow-up questions and deeper exploration over time.

## Use Cases

### Page Exploration and Discovery

Use this widget when users need to quickly understand complex pages with many attributes or relationships:
- "What is this page about?"
- "Show me all the key information on this page"
- "What files are attached to this page?"
- "When was this page last modified and by whom?"

### Relationship Navigation

The widget excels at helping users navigate page relationships and understand connections:
- "Which other pages reference this one?"
- "Show me all projects that reference this requirement"
- "What tasks are linked to this milestone?"
- "Find all related documentation pages"

### Content Analysis

Users can analyze attached documents and page content without opening multiple windows:
- "Summarize the content of the attached document"
- "What are the main attributes of this page?"
- "What's the status of the linked project?"

### Cross-Page Information Gathering

The AI can retrieve information from related pages and their attachments:
- "Get details about page X that's referenced here"
- "Show me the content of the specification document attached to the related page"

## Design Considerations

### When to Use This Widget

**Information-rich pages**: Pages with many attributes, relationships, or attached documents where users benefit from AI-assisted exploration.

**Complex data structures**: Pages with multiple incoming/outgoing references where understanding relationships is important.

**Documentation and knowledge pages**: Technical specifications, requirements, or knowledge base articles that users need to query frequently.

**Project and task pages**: Where users need to understand dependencies and relationships quickly.

### When NOT to Use This Widget

**Simple pages with minimal content**: The widget adds overhead for pages that don't benefit from AI assistance.

**Data entry focused pages**: This is a read-only query interface, not designed for data input workflows.

**Public-facing pages**: The widget requires Low-Code permissions to embed (though any user can use it once embedded).

### Persistent Chat Memory

Each user maintains their own conversation history per page. This enables:
- Contextual follow-up questions ("What else?", "Tell me more")
- Building on previous queries within a session
- Understanding conversation flow when returning to a page

The chat history is limited by the configurable message limit (default 30 messages), with oldest messages automatically evicted when the limit is exceeded.

### AI Tool Capabilities

The widget provides the AI assistant with three specialized tools:
- **getPageById**: Retrieves detailed information about any page by its ID
- **getFileContent**: Accesses and reads content of files attached to pages
- **getReferencingPages**: Finds all pages that reference a given page of a specific type

These tools enable the AI to traverse relationships and access information beyond the embedding page itself.

### Transparency and Trust

The widget can optionally display when the AI is executing tools (e.g., "Getting page by ID..."), providing transparency into AI operations. This is controlled via the "Show Tool Executions" configuration and can be useful for:
- Understanding AI behavior during development
- Building user trust through operational visibility
- Debugging unexpected responses

## Common Pitfalls

### Expecting Write Operations

The widget is **read-only**. Users cannot use it to modify page data, create pages, or trigger workflows. For AI-powered data manipulation, use the Chat Widget with custom scripted tools.

### Using on Pages Without Context

The widget requires a page context to function. It automatically enters read-only mode if embedded outside a Page context (e.g., in type layouts). Always embed on specific pages where the context is meaningful.

### Overuse on Simple Pages

Adding this widget to every page creates unnecessary overhead. Focus on pages where AI assistance adds genuine value through complex content, relationships, or attached documents.

### Permission Confusion

While Low-Code permissions are required to **embed** the widget, any user with page view access can **use** the widget once it's embedded. Plan your deployment accordingly based on your security model.

## Related Widgets

- **Chat Widget** (`cf.cplace.lowcode.ai.chatWidget`) - A more flexible AI chat interface that supports custom Low-Code scripting, configurable data sources, custom tools, and shared chat history. Choose this when you need custom AI behavior or queries across multiple pages.
- **Table Widget** (`cf.cplace.platform.tableWidget`) - For structured data exploration when users know exactly what data they want to see and prefer a traditional UI over conversational interaction.
- **Embedded Search as Table** (`cf.platform.embeddedSearchAsTable`) - When users need to find and display specific pages across the workspace with sorting, filtering, and selection capabilities.

## Related Patterns

### Documentation Hub Pattern

Place this widget on central documentation pages to help users navigate complex technical information and find related documents quickly.

### Project Dashboard Pattern

Add to project overview pages to help stakeholders understand project status, dependencies, and related resources through natural questions.

### Knowledge Discovery Pattern

Use on knowledge base pages to enable users to explore related content, find specific information within documents, and understand connections between articles.
