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

# Semantic Index, Privacy Guardrail, Sync & Customization

Prism is engineered for researchers managing multi-thousand-paper libraries alongside unpublished manuscripts, grant drafts, and confidential peer reviews.

## 1. Device-Local Semantic Index (Tier 1 & Tier 2 Hybrid Search)

Open **Prism Settings → Semantic Index** to give Prism fast, conceptual library-wide recall—stored strictly on your local disk at `<ZoteroProfile>/prism-cache/semantic-index.v1.json` (never uploaded to WebDAV or third-party clouds).

### Prerequisite: Configure an Embedding Model

Assign an embedding model under **Prism Settings → Model Routing → Embedding** (for example, local Ollama **`nomic-embed-text`** or **`bge-m3`** for 100% offline indexing—working with either `http://localhost:11434/v1` or bare `http://localhost:11434`—or an OpenAI / Google embedding model).

### Two Indexing Tiers

| Tier                                | What It Indexes                                                                                                                                          | How to Build                                                                                                                                                            | Best For                                                                           |
| ----------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
| **Tier 1 (Fast Library Discovery)** | Title, authors, year, venue, up to `16` tags, abstract (`<= 1,400` chars), up to `6` child notes, and up to `14` PDF annotations (`<= 3,200` chars/item) | Click **`Build / Update Tier 1 Index`** (incremental via FNV-1a hashes) or **`Full Rebuild`**; auto-updates in the background as you edit Zotero (`2.5s` debounce)      | Finding related papers across your entire library in milliseconds                  |
| **Tier 2 (Deep Full-Text PDFs)**    | Overlapping page-indexed PDF chunks (\~`1,000` chars with `160`-char overlap, up to `80` chunks/paper)                                                   | On-demand via **`Index Current PDF`** or **`Index Collection`**, or enable **`Automatically index PDF body (Tier 2) in the background when opened`** _(off by default)_ | Locating specific methods, equations, or experiments buried deep inside PDF bodies |

### Hybrid Ranking & Graceful Offline Degradation

Queries combine **dense cosine similarity (`0.72`)** and **BM25-style lexical matching (`0.28`)** via Reciprocal Rank Fusion (`k=40`), capping at `2` chunks per paper to preserve cross-paper diversity. If chunks already exist locally while your embedding API is offline, Prism degrades gracefully to **lexical-only** ranking over your indexed chunks. You can **`Cancel`** an in-progress run or click **`Clear Local Vector Index`** anytime.

Settings — Local Semantic Index (Tier 1 & Tier 2)

![Monitor Tier 1 library papers, Tier 2 full-text PDF chunks, and vector dimensions, and trigger incremental updates strictly on your local disk.](/Prism/images/semantic-index.png)

Monitor Tier 1 library papers, Tier 2 full-text PDF chunks, and vector dimensions, and trigger incremental updates strictly on your local disk.

## 2. Local-Only Privacy Guardrail (Fail-Closed)

Open **Prism Settings → Spend & Privacy → Local-Only Privacy Guardrail** to guarantee that confidential drafts, clinical data, or unpublished manuscripts never leave your machine.

### Configuration

- Toggle **`Block cloud transmission for protected items`** on.
- Add up to **40 protected Zotero tags** (quick-add chips: `confidential`, `unpublished`, `private`) and up to **60 protected collections** (**all nested subcollections** are automatically protected too).
- Keep **`Block cloud semantic embeddings for protected items`** enabled _(default: on)_.

### Fail-Closed Enforcement & Allowed Local Endpoints

Whenever any attached paper, collection, mention, or tool lookup touches a protected item—**or if an item's metadata cannot be verified (`metadata_ambiguous`)**—Prism blocks the request **before data leaves your computer**:

- Blocks cloud chat turns, follow-ups, context compaction, Extraction Matrix runs, vision crops, cloud embeddings, external Crossref lookups, and remote HTTP MCP calls.
- **Strictly allowed endpoints:** Only true local loopback and `.local` hosts (`localhost`, `127.x.x.x`, `::1`, `0.0.0.0`, `*.local`, `*.localhost`—even remote LAN IPs are blocked for fail-closed safety).
- **One-Click Recovery Banner:** When blocked in the sidebar, Prism displays an inline banner with **`Switch to {localProvider} & Retry`** (showing up to 3 configured local providers), **`Configure Local LLM`**, and **`Privacy Rules`** (in the Extraction Matrix window, the banner offers **`Switch to {localProvider} & Retry`**, **`Configure Local LLM`**, and **`Cancel`**).

Settings — Local-Only Privacy Guardrail

![Protect sensitive Zotero tags and collections (including nested subcollections) with fail-closed local-only enforcement.](/Prism/images/privacy-guardrail.png)

Protect sensitive Zotero tags and collections (including nested subcollections) with fail-closed local-only enforcement.

## 3. Chat History Sync Modes, Conflict-Free Merge & What Stays Local

Choose how Prism persists your branching tree conversations under **Prism Settings → General Settings → Chat History Sync Mode** (or directly in Zotero's **Preferences → Prism** pane):

| Mode                                                  | How It Stores Conversations                                                                                                                                                                                                                 | Best For                                                                                      |
| ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| **Stored Child Attachment** _(Default & Recommended)_ | Saves `prism-chat-history.json` (tag `_ai_chat_store`) and cropped/generated media (`prism-media-*.ext`, tag `_ai_chat_media`) as child attachments under each paper item (or `[Prism AI Research Workspace]` for Collection/Library chats) | Zotero File Storage & WebDAV users—fast, clean, and supports synced cropped figures & audio   |
| **Child Note**                                        | Encodes chat trees inside structured Zotero child note(s) (`data-prism-chat-store="1"`), automatically rolling over large histories across notes                                                                                            | Users relying solely on free **Zotero Data Sync** or Group Libraries without attachment quota |

### Conflict-Free Cross-Device Chat Auto-Merge

If you chat offline on two different computers before Zotero finishes syncing, Prism deterministically **merges both chat trees by immutable node UUID** instead of overwriting either history—preserving sessions, sibling branches, media attachments, and latest pin timestamps from both machines (showing a merge notice banner) while respecting intentional deletions so deleted chats are never resurrected.

### What Never Syncs (Strictly Device-Local)

Even with Zotero Sync enabled, the following stay exclusively on your computer inside your Zotero Profile directory:

- All **API keys**, **MCP bearer tokens**, and **web-search keys** (OS-encrypted in Zotero Login Manager).
- **Local Semantic Index** (`prism-cache/semantic-index.v1.json`).
- **Local Usage & Spend Ledger** (`prism-cache/usage-ledger.v1.json`).
- **Extraction Matrix History** (`prism-cache/extraction-history.v1.json`).
- **Local chat search caches** (`prism-cache/stores/`, `prism-cache/media/`).

## 4. Research Persona & Empty-State Starter Prompts

### Research Persona (`Settings → General Settings`)

Tailor how Prism reads and critiques papers in your field:

- **Global Instructions (`<= 4,000` chars):** Describe your discipline, preferred mathematical notation, evaluation standards, or writing style.
- **Per-Collection Instructions (`<= 2,500` chars each):** Add project-specific rules for individual Zotero collections (e.g., _"Grant Aim 2: focus on sample size power and clinical endpoints"_). Rules are sorted deterministically so they stay prompt-cache friendly.
- **One-Click Pause:** Pause your persona anytime from the **`Persona`** pill in the sidebar Context Bar without losing your saved instructions.

### Empty-State Starter Prompts (`Settings → General Settings`)

Prism ships with **4 paper starters** and **4 synthesis starters** localized across all 6 UI languages. Customize up to **12 quick starters** (`title <= 80` chars, `prompt <= 600` chars), reorder or delete them, click **`Pin /skill…`** to turn any slash skill into a 1-click starter card, or **`Reset defaults`**.

## 5. Secret-Free Settings Backup & Multi-Device Migration

Under **Prism Settings → General Settings → Settings Backup & Restore (Secret-Free)**, click **`Export Settings (JSON)…`** to save a portable configuration snapshot (`schemaVersion: 1`, `secretFreeGuarantee: true`):

- **Included:** Provider profiles (name, family, wire style, sanitized Base URL, active model, capability/reasoning overrides, added models), 5-slot Task Routing, per-provider effort levels, all UI/behavior preferences, Research Persona, Empty-State Starter Prompts, Library `Prism Actions`, Privacy Guardrail rules, Agent Operation Permissions, Inbound/External MCP definitions (minus secrets), and custom `SKILL.md` skills (plus disabled built-in skill states).
- **Guaranteed Excluded / Scrubbed:** All API keys, MCP bearer tokens, web-search keys, sensitive HTTP headers (`Authorization`, `x-api-key`, `Cookie`, `Bearer`, `sk-`, `AIza`, `tvly-`), secret environment variables (`*_KEY`, `*_TOKEN`, `*_SECRET`, `*_PASSWORD`), web search engine settings, chat histories, vector index, spend ledger, and extraction history.
- **Conflict-Safe Import:** On another computer, click **`Import Settings (JSON)…`** to review a summary preview (showing which providers will be added/updated and which need API keys re-entered locally) and click **`Apply Backup`**. Existing local keys for matching provider IDs are preserved automatically.
