Skip to content

joshjm/zotero-AI-auto-tagger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

AI Tag Suggester for Zotero

AI-powered tag suggestions for Zotero items using Azure OpenAI. Analyzes document metadata and full-text (PDFs, snapshots) to suggest relevant tags from your existing library tags. Very similar to https://github.com/dnnunn/zotero-auto-tagger, but I needed azure open-ai and didn't want a whole plugin just for this. So its just a script in windingwing/zotero-action-tags

Prerequisites

  1. Zotero Actions and Tags plugin
  2. Azure OpenAI or Azure AI Foundry deployment (GPT-4 recommended)
    • API key and endpoint
    • API version 2024-12-01-preview or later

Really any model that supports structured responses should work, though you could cut out the structured bit and just prompt for the a list of tags. Pull requests to support other LLMs, or free ones are very much welcomed. Also any PRs for things like improving UI, chunking file reading, protections etc. Another good PR would be to have a list of tags to ignore, or even to port this to a standalone plugin.

Setup

  1. Edit the configuration at the top of zotero-ai-tag-suggester.js:
let azureEndpoint = "https://YOUR-RESOURCE-NAME.openai.azure.com"; // make sure you trim your copied endpoint from foundry. It will have extra details.
let apiKey = "YOUR-AZURE-OPENAI-API-KEY-HERE";
let deploymentName = "gpt-4.1-mini";
  1. Import the script into Zotero via the Actions and Tags plugin

Usage

Select an item in Zotero and run the script. It will:

  • Extract text from PDFs/snapshots
  • Analyze with Azure OpenAI
  • Apply relevant tags (up to 8) from your existing library tags
  • Tags starting with _ are excluded (in case you do things like automatic read/unread tags, or only want human labelled 'important' tags.)

Configuration

  • includeFullText: true - Analyze full text (set to false for metadata-only)
  • maxFullTextLength: 12000 - Character limit (~3000 tokens)
  • aiTemperature: 0.1 - Low for consistent results
  • aiMaxTokens: 1000 - Response token limit

If you want more than 8 tags, you may want to increase aiMaxTokens to allow for a longer response.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors