An open-sourced research agent system deeply rooted in your Zotero library.
An open-sourced research agent system deeply rooted in your Zotero library.
**llm-for-zotero** brings Large Language Models into the Zotero reader, so you can ask questions, summarize papers, inspect figures, compare sources, and save notes without leaving your library. It works with standard API providers, local OpenAI-compatible models, WebChat, Codex App-Server, and Claude Code. Documentation: - [English](https://yilewang.github.io/llm-for-zotero) - [Chinese](https://yilewang.github.io/llm-for-zotero/zh/)
## Table of Contents - [At a Glance](#at-a-glance) - [Quick Start](#quick-start) - [What's New](#whats-new) - [Configuration](#configuration) - [Demos](#demos) - [File-Based Notes](#file-based-notes) - [Agent Mode](#agent-mode-beta) - [Skills](#skills) - [General Web Search](#general-web-search) - [WebChat Setup](#webchat-setup-chatgpt-web-sync) - [Codex Setup](#codex-setup-chatgpt-plus-subscribers) - [Claude Code Setup](#claude-code-setup-experimental) - [MinerU PDF Parsing](#mineru-pdf-parsing) - [Privacy and Data Flow](#privacy-and-data-flow) - [Roadmap](#roadmap) - [FAQ](#faq) - [Contributing](#contributing) ## At a Glance - Chat with the current PDF, selected text, figures, screenshots, and uploaded documents directly inside Zotero. - Get grounded answers with citations that jump back to the source passage. - Compare multiple open papers or add external files as extra context. - Save answers, full conversations, and research notes to Zotero notes or local Markdown folders such as Obsidian and Logseq. - Enable Agent Mode for library-wide read, search, tagging, metadata, import, note-editing, and organization workflows. - Search the current public web and read relevant pages with Tavily, with source links attached to the answer. - Use your preferred backend: API keys, local models, ChatGPT WebChat, Codex App Server, or Claude Code. ## What's New - **Codex App Server** is the recommended Codex path for ChatGPT Plus users. It runs through the local `codex app-server` runtime and is configured from the **Agent** tab. - **Claude Code Mode** runs Claude Code as a separate conversation system inside Zotero through a companion local bridge. It is experimental and does not yet support native Zotero API operations. - **Skills** let you customize how Agent Mode handles research workflows. The plugin ships with 8 built-in skills and a portal for creating your own. - **General Web Search** lets the in-plugin Agent search the current public web with Tavily, read relevant pages, and attach source links to its answers. - **Standalone Window Mode** opens the assistant in a dedicated window with paper chat, library chat, and conversation history. - **File-Based Notes** save Markdown notes to local folders, including Obsidian, Logseq, or any plain Markdown directory. - **Cache-aware Agent Mode** preserves stable paper context, prior read evidence, and coverage state across longer research turns, then compacts old transcript history automatically when the context window gets crowded. - **Citation navigation** now keeps citation labels conservative until page locations are verified, while quote-based citations can jump back to the matching Zotero passage. - **MinerU PDF parsing** provides higher-fidelity extraction for tables, equations, figures, and local `mineru-api` servers, with a richer file manager for bulk parsing, cache repair, sync packages, tags, and parsing filters. Thanks to [@jianghao-zhang](https://github.com/jianghao-zhang) and [@boltma](https://github.com/boltma) for major contributions to the Codex App Server, Claude Code, and file upload workflows. ## Quick Start 1. Download the latest `.xpi` file from the [Releases page](https://github.com/yilewang/llm-for-zotero/releases). 2. In Zotero, open `Tools` -> `Add-ons` -> gear icon -> **Install Add-on From File**, then select the `.xpi`. 3. Restart Zotero. 4. Open `Preferences` -> `llm-for-zotero`, choose a provider, enter the base URL, key, and model, then click **Test Connection**. 5. Open a PDF in Zotero and click the LLM Assistant icon in the right-hand toolbar. If you do not want to use a provider API key, start with [WebChat](#webchat-setup-chatgpt-web-sync) or [Codex App Server](#codex-setup-chatgpt-plus-subscribers). ## Configuration Open `Preferences` -> `llm-for-zotero`. 1. Select your **Provider**. 2. Paste your **API Base URL**, **secret key**, and **model name**. 3. Click **Test Connection**.
The plugin supports multiple provider protocols, including `responses_api`, `openai_chat_compat`, `anthropic_messages`, and `gemini_native`. You can configure multiple providers and models for different tasks, such as a multimodal model for figures and a text model for summaries. The conversation panel also supports model-specific reasoning levels and hyperparameters such as `temperature` and `max_tokens_output`. ## Demos ### Grounded Paper Chat On the first message, the model loads the current paper as context. Follow-up questions use focused retrieval from the same paper, keeping conversations fast and grounded.
Click any generated citation to jump straight to the source passage in Zotero. ### Summaries and Selected Text Summarize a full paper, focus on methodology or results, or select any paragraph and ask the model to explain it.
The selected-text pop-up can add highlighted text to chat with one click. It can also be disabled in settings. ### Figures and External Files Take screenshots of figures, attach up to 10 screenshots, or upload local files as additional context. Supported uploads include PDF, DOCX, PPTX, TXT, and Markdown.
### Multi-Paper Comparison Open multiple papers in Zotero tabs and type `/` to cite another paper as additional context.
### Notes, History, and Presets Save answers or selected text to Zotero notes, export full conversations in Markdown, and customize quick-action presets for repeated research tasks.
## File-Based Notes Beyond Zotero's built-in notes, the agent can save Markdown research notes to any local directory you choose. Point it at an [Obsidian](https://obsidian.md/) vault, a [Logseq](https://logseq.com/) graph, or a plain folder of `.md` files. Open `Preferences` -> `llm-for-zotero` and scroll to the **Notes Directory** section.
| Setting | Description | Example | | ------------------------ | -------------------------------------------------------------------- | -------------------- | | **Nickname** | How you refer to this directory in chat | `Obsidian`, `Logseq` | | **Notes Directory Path** | Absolute path to the root directory where notes are saved | `/Users/me/MyVault` | | **Default Folder** | Default subfolder for new notes | `Logs` | | **Attachments Folder** | Folder for copied figures and images, relative to the directory root | `Logs/imgs` | Ask the agent to write a note using the configured nickname, for example: _"Summarize this paper and save it to Obsidian."_ The agent gathers paper metadata, writes a Markdown note, adds YAML frontmatter, optionally copies figures from MinerU-parsed PDFs, and saves the note under the configured folder. Or if you want to keep notes inside Zotero, the agent can also write to internal item notes with the `write-note` skill. Just ask it to "save a note for this paper" without mentioning an external directory. ### Zotero Notes vs. File-Based Notes (both generated by the plugin)
Notes use [Pandoc citation syntax](https://pandoc.org/MANUAL.html#citations) such as `[@citekey]`, which works with Obsidian Zotero Integration, Pandoc plugins, and many Markdown readers. > Note templates and figure-embedding rules live in the `write-note` skill. > Open the **Standalone Window** -> **Skills** portal to edit them. ## Agent Mode (beta) Agent Mode is disabled by default. Enable it in `Preferences`, then toggle `Agent (beta)` in the context bar. It can read and search your library, draft notes, update metadata or tags with confirmation, and undo recent write actions in the same session. When enabled, the LLM can act on your Zotero library with read tools, write tools, confirmation cards, and session undo. Long agent runs are cache-aware. The plugin keeps stable Zotero context and previously read evidence separate from the changing chat transcript, tracks which papers and passages have already been inspected, and automatically compacts old turns when the model context fills up. This lets follow-up questions reuse grounded evidence when it is still relevant, while still asking the agent to read again when the needed source or coverage layer is missing. | Tool area | Examples | | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------- | | Library and PDF reading | Search items and collections, read metadata, read papers, search paper passages, render PDF pages, inspect attachments | | Scholarly discovery | Search CrossRef and Semantic Scholar for metadata, recommendations, references, and citations | | General web research | Search the current public web with Tavily, read relevant pages, and show source links with the answer | | Library writes | Apply tags, update metadata, move items, manage collections, manage attachments, merge duplicates, trash items, import identifiers or local files | | Notes | Edit the active Zotero note or create a new note in plain text, Markdown, or HTML | | Filesystem and scripting | Read/write allowed local files, run analysis commands, or execute Zotero JavaScript with write confirmations | | Safety | Undo the most recent write action in the conversation, with the last 10 entries kept per session | The design philosophy is simple: read tools are unrestricted; write tools stay reviewable and undoable. ### Agent Mode Demos #### Multi-step workflow
#### Find related papers Use `/discover_related` while viewing a paper to run the direct OpenAlex action. It opens Recommendations, References, and Citations tabs with up to 20 papers per mode by default. Use `/discover_related 30` to change the initial retrieval limit, **Load more** to retrieve 20 more per mode while preserving your selections, and **Import selected** to save the papers you choose. This shortcut does not require a model. Ask “find relevant papers” in chat to start model-assisted discovery. The agent assesses retrieved candidates and presents a ranked card with relevance reasons. An explicit count, such as “find 15 relevant papers,” sets the batch size; otherwise it starts with five. Use **Find more** to add another batch of the same size while preserving your selections, then **Import selected** to save the papers you choose. Requests for reference
No open issues yet, or sync has not completed.