PageSpace treats AI not as an isolated chatbot, but as contextual intelligence embedded within the workspace hierarchy. AI conversations are pages, they inherit context from their location, and they participate in the same collaborative, permission-based ecosystem as documents, folders, and channels.
AI conversations are AI_CHAT page types β first-class citizens in the PageSpace ecosystem:
π Project Alpha/
βββ π Requirements.md
βββ π Research/
β βββ π€ Research Assistant β AI_CHAT page
β βββ π Market Analysis.md
βββ π€ Project Planning AI β AI_CHAT page
This means:
Every message is immediately persisted to PostgreSQL as an individual row:
chat_messages:
id | pageId | userId | role | content | toolCalls | agentRole
msg-1 | page-123 | user-1 | user | "Analyze this" | NULL | PARTNER
msg-2 | page-123 | NULL | assistant | "Here's my..." | [{...}] | PARTNER
msg-3 | page-123 | user-2 | user | "Also check..." | NULL | PARTNER
This enables:
isActive flagAI conversations understand their position in the workspace hierarchy:
π Marketing Campaign/
βββ π Brand Guidelines
βββ π Target Audience
βββ π€ Campaign AI β Sees Brand Guidelines and Target Audience
Context flows upward: an AI can reference parent and sibling pages (with permission). Context is limited by the user's access permissions β AI can only see what you can see.
PageSpace supports 7 AI providers with a unified interface via the Vercel AI SDK:
| Provider | Key Models | Key Required |
|---|---|---|
| PageSpace | Free models via OpenRouter | No |
| OpenRouter | 200+ models including Claude, GPT, Gemini | User's key |
| Google AI | Gemini 2.5 Pro, Gemini Flash | User's key |
| OpenAI | GPT-5, GPT-4.1, o3 | User's key |
| Anthropic | Claude 4.1 Opus, Claude Sonnet | User's key |
| xAI | Grok 4 | User's key |
| Ollama | Any local model | Self-hosted |
API keys are stored encrypted per-provider. You can set different providers per drive or per individual AI page.
AI agents have access to 13+ workspace automation tools organized into 6 categories:
| Category | Tools | Capability |
|---|---|---|
| Core Page Ops | list_drives, list_pages, read_page, create_page, rename_page, move_page | Navigate and manage workspace |
| Content Editing | replace_lines | Precise line-based document editing |
| Trash Ops | trash, restore | Soft delete and recovery |
| Search | regex_search, glob_search, multi_drive_search | Pattern and cross-workspace search |
| Task Management | update_task | Create and update tasks on task lists |
| Agent Management | list_agents, multi_drive_list_agents, ask_agent, update_agent_config | Agent discovery and collaboration |
Tools are filtered by agent role and can be customized per page. See Tool Calling for details.
Three built-in agent roles with different capabilities:
| Role | Read | Write | Delete | Use Case |
|---|---|---|---|---|
| PARTNER | Yes | Yes | Yes | Collaborative AI partner with full capabilities |
| PLANNER | Yes | No | No | Strategic planning β read-only analysis |
| WRITER | Yes | Yes | Yes | Execution-focused β minimal conversation, maximum output |
Each role gets a different system prompt and filtered set of tools. You can further customize by setting enabledTools on individual AI pages.
AI messages are broadcast to all conversation participants via Socket.IO:
PageSpace automatically detects model capabilities:
If a model doesn't support tools, PageSpace falls back to text-only mode and suggests tool-capable alternatives.
Search docs, blog posts, and more.