> For AI agents: the complete documentation index is available at /Prism/llms.txt, the full documentation bundle is available at /Prism/llms-full.txt.

# Reading, Citations, Multimodal & Tree Chats

Prism lives directly inside Zotero's right-hand pane so you can read, verify citations, crop figures, queue follow-ups, and branch discussions without copy-pasting PDFs into external browser tabs.

## 1. Automatic Context Scopes, Context Bar & Status Banners

Prism automatically tracks what you are viewing in Zotero and displays it in the top **Context Bar**:

| Context Mode                        | How It Activates                                                                                                                                                     | Where Chats Are Stored                                       |
| ----------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ |
| **Single Paper**                    | Open a PDF, EPUB, or Web Snapshot tab, or select a paper in the Library                                                                                              | Directly on that Zotero paper item                           |
| **Multi-Paper (`Synthesis` badge)** | Automatically activates whenever **any `@` mention** (`item`, `pdf`, `collection`, or `tag`) is attached, or when you multi-select items / use **Add to Prism Chat** | Current paper item or synced `[Prism AI Research Workspace]` |
| **Collection**                      | Select a Zotero collection without a specific item selected, or right-click a collection → **`Ask Prism about this collection`**                                     | Synced `[Prism AI Research Workspace]` item                  |
| **Library / Workspace**             | Open a Workspace synthesis session or library-wide chat                                                                                                              | Synced `[Prism AI Research Workspace]` item                  |

### What Else Appears in the Context Bar & Top Banners

- **Removable Attachment Pills:** Explicit `@` mentions, dragged quotes, and attached files display per-item token estimates (`~Xk`) and `×` remove buttons.
- **Active Persona & Language Pills:** Click the **`Persona`** pill to pause/resume your Research Persona in one click; click the **Preferred Response Language** badge (e.g. `EN`, `中文`, shown when set to non-Auto) to jump to language settings.
- **Token Meter, Session Cost & Manual Compaction:** Shows `used / cap` context tokens alongside cumulative **session estimated USD cost**, warns if a prompt exceeds your cap, and offers one-click **`Compact`** (plus **`Cancel`** while compacting).
- **Pinned Store Return Banner:** When viewing a Workspace chat or a session opened from Global Search while another paper is active in Zotero, a top bar offers one-click **`Back to active paper`**.
- **Offline Status Banner:** When Zotero goes offline, Prism displays either a green **`Offline mode · Running locally via {name}`** bar (when a local LLM is active) or an amber **`You are offline · Cloud endpoints unavailable`** bar with **`Use {localProvider}`** or **`Add Local LLM`**.

## 2. Explicit References with `@` Mentions

Type **`@`** inside the composer (at line start or after whitespace—never inside email addresses) to pull exact items from Zotero into your turn.

Use the **5 filter tabs** in the `@` picker (**`All`**, **`Papers`**, **`Notes`**, **`Collections`**, **`Tags`**) and navigate with **`↑` / `↓`** + **`Enter`** or **`Tab`**:

- **`@Paper`** — Pins another paper (metadata + primary PDF) for instant comparison.
- **`@PDF` / `@Snapshot`** — Attaches standalone/supplementary PDFs, HTML web snapshots, or stored image files.
- **`@Note`** — Includes child or standalone Zotero notes (ideal with `/edit-note`, `/check-citations`, or `/review-note`).
- **`@Collection`** — Pulls in a Zotero collection (displaying its full hierarchical path and including subcollections).
- **`@Tag`** — References items carrying a specific user tag (up to `250` user tags; internal `_ai_*` tags are hidden).

Every attached `@` mention and invoked `/` skill renders as a compact chip on your sent user bubble (which also has a **`Copy message`** button) and stays **preserved and editable** during **Edit & Regenerate**.

## 3. Paper Annotations Drawer, File Picker & Drag-and-Drop

Click the **highlighter icon** in the sidebar header to open the **Paper Annotations** drawer for the currently active paper:

- **Filters:** Search annotation text, filter by **8 Zotero colors**, filter by type (**`All`**, **`Highlight`**, **`Underline`**, **`Image`**, **`Note`**), and expand **`Filters`** for **`Comment`**, **`Tag`** (with autocomplete), **`From date`**, and **`To date`**. _(For cross-library filtering by author or collection, ask Prism in chat or run `/find-annotations`, which uses the `search_annotations` tool.)_
- **Actions on Every Match:** **`Jump to PDF`**, **`Add to Chat`**, or **drag directly** into the Prism composer.

Paper Annotations Drawer — Color, Type & Tag Filters

![Search PDF highlights and comments by color, type, tag, or date, then jump straight to the PDF or add any match to chat.](/Prism/images/annotation-search.png)

Search PDF highlights and comments by color, type, tag, or date, then jump straight to the PDF or add any match to chat.

### Attaching Files via `+` Button or Drag-and-Drop

Click the **`+` Attach Files** button in the composer toolbar—or drag, drop, or paste directly into the composer (while reading in Zotero Reader with Prism open, Prism suppresses Zotero's automatic switch back to the Library tab so OS file drops land cleanly in Prism):

- **Zotero items, collections, and `zotero://` links** from the Library pane.
- **Zotero PDF annotations** (highlights, underlines, image/area crops, free-text `Add Text`, sticky notes, and ink annotations) as well as raw selected PDF text (with automatic page-number extraction).
- **Images** (screenshots, plots, clipboard pastes): auto-resized to max **`1600px`**, up to **`4 MB`**.
- **External PDFs:** up to **`25 MB`**.
- **Text, code, and scientific data files** (`.py`, `.r`, `.tex`, `.csv`, `.json`, `.fasta`, `.vcf`, `.slurm`, or any UTF-8 text file): up to **`2 MB`**.

## 4. Grounded Click-to-Jump Citations

Whenever Prism cites a paper—using `[1]`, `[p. 4]`, `[Author 2024, p. 4]`, or natural parenthetical references like `(p. 4)`—it renders compact numbered inline badges (**`1`**, **`2`**, …) directly in the prose _(numeric `[1]` auto-grounding is intentionally disabled during `/translate` so bibliography numbers inside translated text aren't mislinked)_:

- **Hover or focus any badge** to open an anchored preview card displaying **Author-Year** (or paper title), **Section / Page**, the **verbatim quote**, and the clickable footer **`Highlights passage on page N`**.
- **Click any badge** to jump straight to that exact page in Zotero's **PDF, EPUB, or Web Snapshot** reader (across both **Personal and Group libraries**) with a **multi-pulse flashing highlight** centered on the passage.

Grounded Inline Citations & Flashing PDF Jump

Hover an inline badge for the verbatim quote, or click to jump straight to the flashing highlighted passage in Zotero.

## 5. Reader Popups, One-Click Page Capture & Crop-to-Chat

Send passages, figures, and whole pages straight from Zotero's Reader:

- **Text Selection & Highlight Popup:** Select text (or click a saved highlight) to see:
  - **`Ask Prism`** _(click to attach quote to composer, or drag the button directly into the composer)_
  - **`Translate with Prism`** _(opens sidebar and immediately runs `/translate` using your independent Target Translation Language)_
- **Area / Image Selection Popup (Crop-to-Chat):** Draw an area annotation over a figure, table, or equation to see:
  - **`Ask Prism`** _(attaches the cropped image to the composer; also draggable)_
  - **`Explain figure/table`** _(attaches the PNG crop and pre-fills `/explain …` in the composer so you can add a specific question before sending)_
- **One-Click Composer Page Capture:** While viewing a PDF in Zotero Reader, click the **Crop icon** (`Capture current PDF page figure/table as image`) in the composer toolbar to capture the visible PDF page as an image in one click.
- **Reader Right-Click Context Menus:**
  - Page menu: **`Ask Prism`**, **`Explain figure/table (capture page)`** _(pre-fills composer)_.
  - Annotation sidebar menu (up to **5 selected annotations**): **`Add Annotation to Prism Chat`**, **`Translate with Prism`**.

Multimodal Reader Integration

![Select passages to Ask or Translate, capture the current PDF page in one click, or crop figures and equations directly into Vision chat.](/Prism/images/reader-crop-and-popup.png)

Select passages to Ask or Translate, capture the current PDF page in one click, or crop figures and equations directly into Vision chat.

## 6. WYSIWYG Composer, Thinking Cards & Offline Visual Rendering

### Typora-Style Markdown Composer

- **Resizable Height:** Drag the composer's top resize handle (`36px – 520px`, persisted across sessions), double-click (or focus + `Enter`) to reset to auto-fit, or nudge with `↑`/`↓`.
- **Live Formatting:** Supports live `#` headings, syntax-highlighted code fences (exit via closing fence or triple-Enter), live GFM pipe tables (`Tab` / `Shift+Tab`), nested task checklists (`- [ ]`), `==highlight==`, `~sub~`, `^sup^`, `<kbd>`, `<abbr>`, `:emoji:` shortcodes, smart Markdown paste (even from VS Code/Cursor/terminals carrying syntax-colored HTML), `⌘Click` / `Ctrl+Click` to open links, and **clickable KaTeX math** (press `⌘⇧M` / `Ctrl+Shift+M` or type `$$` + `Enter`; click any formula to edit in a live **KaTeX preview popover**).

### Thinking / Reasoning Disclosure & Rich Offline Output

- **Live Activity & Thinking Cards:** Shows live phase status (`Preparing context…`, `Uploading PDF…`, `Connecting to MCP tools…`, `Waiting for model…`, `Preparing tool call…`), live extracted thinking step titles, an elapsed timer (`Thought for X.Xs`), tool execution chips with **`Auto-routed → {target}`** badges, and a **`Copy reasoning`** button when expanded.
- **Extended Academic Markdown (100% Offline, Zero CDN):**
  - **KaTeX** math (including built-in `\RR`, `\NN`, `\ZZ`, `\EE`, `\PP` macros), **highlight.js** code blocks with **`Copy`**, GFM tables with **`Copy table`**, **13 GitHub/Obsidian Callout Admonitions** (`NOTE`, `INFO`, `ABSTRACT`, `SUMMARY`, `TIP`, `HINT`, `IMPORTANT`, `WARNING`, `CAUTION`, `DANGER`, `EXAMPLE`, `QUESTION`, `QUOTE`, including foldable `[!TYPE]+` / `[!TYPE]-`), **Markdown Footnotes** (`[^1]` with hover previews), and collapsible `<details>` blocks.
  - **Interactive Visual Cards:** Renders **10 Mermaid diagram families** (`flowchart`, `sequenceDiagram`, `stateDiagram`, `mindmap`, `pie`, `timeline`, `classDiagram`, `erDiagram`, `xychart-beta`, `gantt`), **Graphviz DOT**, sanitized **inline SVG**, **JSON charts** (`Chart.js`, `Vega-Lite`, `echarts`/`plot`, `bar`, `line`, `area`, `pie`, `doughnut`, `scatter`), **CSV/TSV tables**, and ASCII box diagrams. Every card includes an inline toolbar: **`Zoom`**, **`Save to Note`**, **`Save`**, **`Source` / `Preview` toggle**, and **`Copy`**.
  - **Generated Images & Audio Output:** Assistant-generated images display a **`Generated with {model}`** badge plus inline **`Save to Note`** and **`Save`** buttons; up to the **6 most recent generated images** automatically carry forward into subsequent turns so vision models can iteratively refine figures. Models returning audio render an inline HTML5 `<audio controls>` player with optional transcript.

Multimodal Image Generation & Multi-Turn Refinement

![Generate scientific visuals inline via your Image Generation route and iteratively refine angle, layout, or details across follow-up turns.](/Prism/images/multimodal-interaction-generation-1.png)

Generate scientific visuals inline via your Image Generation route and iteratively refine angle, layout, or details across follow-up turns.


Interactive Offline Charts & Data Plots

![Turn paper tables into crisp, theme-aware grouped bar charts and diagrams right inside the sidebar—complete with Zoom, Save to Note, SVG export, and inline citations.](/Prism/images/multimodal-interaction-generation-2.png)

Turn paper tables into crisp, theme-aware grouped bar charts and diagrams right inside the sidebar—complete with Zoom, Save to Note, SVG export, and inline citations.

## 7. Streaming: Background Execution, Queue Mode & Auto-Follow Scroll

- **Background Streaming Across Paper / Tab Switches:** Switching to another paper, collection, or Zotero tab while Prism is replying **never aborts the stream**—generation continues bound to the originating session and smoothly restores live text, thinking timer, tool activities, and proposals when you switch back.
- **Smart Auto-Follow Scroll:** Scrolling up while Prism streams pauses auto-scroll without fighting you and shows a floating **`Scroll to latest`** (`↓`) button to jump back and resume following.
- **Sending While Assistant Is Replying (`Settings → General Settings → Agent & Cost Guardrails`):**
  - **`Queue` _(Default)_:** Follow-ups collect in the **Queue Tray** above the composer and auto-send in FIFO order. Inside the tray you can **Move up**, **Edit in composer** (restoring text, mentions, skills, quotes, and images), **Send now**, **Remove**, or **Clear**. The queue pauses safely if you click **Stop** / press `Esc`, or on an **error** or **Privacy Guardrail block** (resume with **`Send next`**).
  - **`Send now`:** Cleanly aborts the active stream and dispatches your new prompt immediately.
  - **One-Off Override:** Press **`⌘⇧↵` / `Ctrl+Shift+Enter`** or open the send-button split menu (**`Send this draft now`** / **`Queue this draft instead`**) without changing your default setting.

Queued Streaming Mode & Queue Tray

![Queue follow-up thoughts while Prism streams—reorder, edit, pause, or send immediately anytime.](/Prism/images/queue-tray-streaming.png)

Queue follow-up thoughts while Prism streams—reorder, edit, pause, or send immediately anytime.

## 8. Sessions Drawer, Tree Branching, Auto-Compaction & Search

### Sidebar `Chat sessions` Drawer

Click the **History icon** in the sidebar header to manage sessions for the active paper (or Workspace) without leaving the sidebar: view the live **Sync Status Pill** (`Attachment sync` / `Note sync` / `Saving…` / `Sync error`), **Pinned / Recent** grouping with message & branch counts (`X msgs · Y br`), **double-click any title to rename**, pin/unpin, delete, **`+ New`**, **`Clear all`**, **`Search all`**, or open the standalone **`All history`** window. Empty chats also include a **`Customize prompts`** shortcut on the welcome screen.

Chat Sessions Drawer & All Chat History Window

![Switch sessions from the sidebar drawer or open All Chat History to search, pin, and manage synced paper and Research Workspace chats.](/Prism/images/chat-history.png)

Switch sessions from the sidebar drawer or open All Chat History to search, pin, and manage synced paper and Research Workspace chats.

### Non-Destructive Branching Tree History

- Click **Edit** on any previous user message (supporting adding/removing attached images, `@` mentions, and `/` skills) or **Retry** on any assistant reply to create a non-destructive sibling branch.
- Switch branches anytime with the **`< 1 / 2 >`** pager; Prism remembers the active leaf inside each branch.

### Automatic & Manual Context Compaction

- Enable **`Auto-compact long conversations`** in **Settings → General Settings** _(default: on; triggers at **`82%`** of context)_, or click **`Compact`** in the Context Bar token meter (or **`Compact Context Now`** on overflow error banners).
- Uses **OpenAI Native `/responses/compact`** or **Claude Native compaction** _(eligible at `>= 45,000` estimated tokens, API trigger `50,000`)_ when available, or builds a client-side checkpoint via your **Fast / Cheap** route preserving Zotero keys and tool outcomes. Each compaction renders as a collapsible card with a method badge (**`OpenAI Native`**, **`Claude Native`**, or **`Checkpoint`**).

### Turn Navigator, In-Chat Find, Global Search & Clarifications

- **Turn Navigator Rail:** Appears on the right edge once a chat has **2+ user turns**—hover to preview the turn outline and click to jump directly to any turn.
- **In-Chat Find (`⌘F` / `Ctrl+F`):** Highlights up to `2,000` matches, includes an **`Aa` Match Case** toggle, supports `F3` / `Shift+F3` navigation, and automatically expands collapsed thinking (`<details>`) blocks when a match is inside.
- **Global Cross-Paper Search (`⌘⇧F` / `Ctrl+Shift+F`):** Searches text, `@` mentions, `/` commands, and quotes across every paper, workspace chat, and alternate branch with **`All` / `Pinned` / `Papers` / `Workspace`** chips.
- **Clarifying Question Cards:** On ambiguous organization, comparison, or multi-step prompts, Prism may proactively inspect your library first and pause with a tabbed multi-question card (`1–6` questions, `2–8` options each, **`Recommended`** badges, optional **`Other`** input up to `1,000` chars, **`Back` / `Next`**, **`Skip`** to use defaults, and collapsible answered summary).

Interactive Quick Clarification Card

![On open-ended workflows like /annotate, Prism pauses inline with a tabbed multi-question card, Recommended defaults, and custom Other input before acting.](/Prism/images/agent-clarification-card.png)

On open-ended workflows like /annotate, Prism pauses inline with a tabbed multi-question card, Recommended defaults, and custom Other input before acting.