How to Configure Context
๐ Prompt ยท ๐ฌ Conversation
The agent can resolve what the user is currently looking at and inject that information into the conversation automatically. Without this, the user has to repeat context in every message. With context resolution, the agent already knows.
When calling the Chat API directly, pass context either as top-level conversation_context or as a context entry in message content_parts. See Passing Context for the API request shapes.
List and Enable Context Sourcesโ
za agents capabilities context-sources list
za agents capabilities context-sources configure <source-name>
Configure Provider Settingsโ
za agents capabilities context-sources settings
| Setting | Type | Default | Description |
|---|---|---|---|
injection_mode | "system_prompt" | "conversation" | "both" | "conversation" | Where context appears โ as a system prompt section or injected into the conversation history |
content_format | "json" | "xml" | "xml" | Serialization format for context items (xml recommended for Claude models) |
max_item_content_length | int or null | null | Max characters for a single item's serialized content; exceeded items are marked as summarized |
Context Sourcesโ
| Source | CLI name | Default | Description |
|---|---|---|---|
| Document Context | documents | enabled | Metadata of documents the user is currently viewing |
| Filter Context | filters | enabled | Active search filters from the UI |
| Tag Context | tags | enabled | Tag metadata and document listings when viewing a tag |
| User Documents | user-documents | enabled | User's uploaded documents when on the My Documents page |
| User Workspace | user-workspace | disabled | Lightweight workspace snapshot (tag count, document count) |
| Image Context | conversation-images | enabled | Registers images from the conversation and assigns short IDs |
| Custom Context | custom | enabled | Pass-through for arbitrary context from the calling application |
| Scheduled Task | scheduled-task | disabled | Task parameters when running as a recurring job |
Document Contextโ
Injects metadata of documents the user is currently viewing or has selected in the frontend. Questions like "summarize this" work without specifying which document.
za agents capabilities context-sources configure documents
No additional configuration beyond enabled.
Filter Contextโ
Surfaces active UI search filters so the agent includes them in search calls automatically.
za agents capabilities context-sources configure filters
No additional configuration beyond enabled.
Tag Contextโ
When the user is viewing a tag (curated document collection), injects the tag metadata and document listings. Questions like "what's in this collection?" work immediately.
za agents capabilities context-sources configure tags
No additional configuration beyond enabled.
User Documentsโ
When the user is on their My Documents page, injects their uploaded documents with metadata and previews. Questions like "summarize my uploads" or "find the paper I uploaded last week" work without specifying which documents.
za agents capabilities context-sources configure user-documents
No additional configuration beyond enabled.
User Workspaceโ
A lightweight snapshot of the user's workspace โ tag count, names, and document count. Gives the agent enough awareness to make relevant suggestions.
za agents capabilities context-sources configure user-workspace
Configurationโ
| Setting | Type | Default | Description |
|---|---|---|---|
include_tags | bool | true | Include tag summary (count and names, up to 10) |
include_private_documents | bool | true | Include private document count |
Image Contextโ
Scans conversation messages for images, registers each with a short ID, and makes them available for image tools. Enabled by default.
za agents capabilities context-sources configure conversation-images
No additional configuration beyond enabled.
Custom Contextโ
Pass-through for arbitrary context items provided by the calling application via the API's custom_context.items field. Enabled by default.
za agents capabilities context-sources configure custom
No additional configuration beyond enabled.
Scheduled Task Contextโ
Injects scheduled task parameters when the agent is running as a recurring job. Instructs the agent to focus on new information since last execution and use inline citations.
za agents capabilities context-sources configure scheduled-task
No additional configuration beyond enabled.