AI Reading Highlights

approvedunreviewed

by joshwong

Automatically highlights key sentences, terms, and concepts in your notes using an LLM you configure. Works in reading view and live preview, and never modifies note files.

Updated todayMIT

AI Reading Highlights

AI Reading Highlights marks what matters inside your notes. A language model you configure reads each block and highlights key sentences, key terms, and named concepts directly in the text, in both reading view and live preview. Note files are never modified.

It is built for dense technical notes in Chinese and English, the kind you scan for what the author concluded, what supports it, and which concepts carry the argument.

Highlights in a light theme

Highlights in a dark theme

What gets highlighted

HighlightMeaningStyling
KeypointThe sentence that carries a block's pointMarker-pen gradient wash
TermDomain keywords worth rememberingSolid indigo underline
ConceptNamed models, methods, lawsDotted teal underline, or a tinted pill

Hover any highlight to see its role in a small chip. Each category can be turned off in settings. Colors adapt to your theme. The plugin measures background luminance and adjusts hue brightness and wash intensity, so light, dark, and custom themes stay readable. Text contrast stays above 7:1 on light themes and above 4.5:1 on dark ones, guarded by tests.

Two engines produce the highlights:

  • API engine. Any OpenAI-compatible endpoint. The model returns verbatim quotes from each block; quotes that cannot be anchored back into the text are dropped, so a hallucinated highlight cannot render.

Network use

Classification sends the text blocks of the note you open to the OpenAI-compatible endpoint you configure, and to nothing and no one else. This is the plugin's only network access. The API engine requires an account with your chosen provider, and some providers charge for usage. Results are stored in the plugin's own cache file inside .obsidian/plugins/ai-reading-highlights/. Note content on disk is never modified. The offline heuristic works without an account.

Install and configure

  1. Install from the community directory, or copy main.js, manifest.json, and styles.css into <vault>/.obsidian/plugins/ai-reading-highlights/ and enable it in Settings → Community plugins.

If the plugin has not appeared in the in-app community browser yet (the directory and the in-app registry sync on a delay), install it with BRAT: add Joshwong1908/obsidian-ai-reading-highlights as a beta plugin and BRAT tracks every release. 2. Settings → AI Reading Highlights → Classification API. Fill in the base URL, API key, and model, then click Test connection. 3. Open a note. Heuristic highlights appear immediately, and API highlights follow within seconds.

ProviderBase URLNotes
Zhipu GLM Coding Planhttps://open.bigmodel.cn/api/coding/paas/v4Use the coding endpoint; /api/paas/v4 rejects plan keys. Keep "Disable model thinking" enabled; it cuts annotation time from minutes to seconds.
OpenAIhttps://api.openai.com/v1e.g. gpt-4o-mini
DeepSeekhttps://api.deepseek.com/v1e.g. deepseek-chat
Ollama (local)http://127.0.0.1:11434/v1Any non-empty key

Commands: Reclassify current note forces a fresh API pass. Diagnose rendering writes diagnosis.txt into the plugin folder. The Chinese user guide has a full walkthrough.

Behavior details

  • Annotations are cached per block, keyed by a hash of the block's normalized source text (5000-block LRU). Unchanged blocks are never re-annotated; an edit re-annotates only what changed.
  • Quotes are anchored by significant-character matching, so a highlight survives bold markers, link syntax, and re-wrapping.
  • Editing retriggers annotation after a 1.5s debounce. A failed API call keeps heuristic highlights and backs off for 60 seconds.
  • Notes larger than 16,000 characters are annotated in block-boundary chunks.

Development

bun install
bun test                                  # 48 tests: anchoring, parse, store, pipeline, mock-server e2e, palette
npm run build -- --production             # esbuild bundle to main.js

Design rationale, the two architecture candidates considered, and the palette measurements live in docs/design.md. Release steps live in docs/publish/RELEASING.md. MIT license, see LICENSE.

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.