LCSH Chrome Extension
Get Library of Congress Subject Heading recommendations directly in your browser. Powered by Google Gemini with real-time LOC validation and MARC record generation.
Key Features
Gemini-Powered AI
Uses Google Gemini 2.5 Flash with multimodal capabilities to analyze both text and images for comprehensive subject analysis.
LOC Validation
Automatically scrapes id.loc.gov in background tabs to validate every AI suggestion against the official LCSH database.
Similarity Scoring
Levenshtein distance algorithm calculates match quality from 0–100%. Color-coded indicators (green/amber/red) show quality at a glance.
MARC Record Generation
Second-pass Gemini inference generates accurate MARC field 650 records with proper indicators and subfields for high-scoring terms.
Image Upload
Upload PNG and JPEG images of book covers, title pages, or other materials. Images are processed by Gemini and never stored on any server.
History & Export
Save complete cataloging sessions to local storage. Export as CSV with all metadata including MARC records and similarity scores.
How It Works
The extension follows a 5-step wizard workflow.
Enter Bibliographic Information
Input the title, author, abstract, table of contents, and notes. Optionally upload images of book covers or title pages (PNG/JPEG).
Generate Initial Suggestions
The Gemini API analyzes your content (text + images) and proposes LCSH terms with a subject analysis narrative and special considerations.
Review Scraped Results
The extension validates each suggestion against id.loc.gov by opening background tabs. Best LOC matches are identified with similarity scores.
Final Recommendations
Terms are sorted by similarity score (highest first). Each includes a MARC record, direct LOC link, and AI justification. Only terms above 30% similarity are shown.
Save & Export
Browse and manage past sessions. Export recommendations as CSV with all metadata. Copy individual or all MARC records to clipboard.
Installation
Development Mode
For developers who want to build from source:
- Clone the repository and
cdinto it - Install dependencies:
npm install - Build the extension:
npm run build - Open Chrome and navigate to
chrome://extensions/ - Enable "Developer mode" in the top right corner
- Click "Load unpacked" and select the
distdirectory
Usage
- Click on the extension icon in your Chrome toolbar
- Enter your Gemini API key (get one from Google AI Studio)
- Click "Launch LCSH Tool" to open the main application
- Enter bibliographic information about the work you want to catalog
- Optionally upload images (PNG and JPEG)
- Follow the step-by-step process to generate and validate LCSH recommendations
- Review similarity scores to evaluate recommendation quality
- View MARC records for high-scoring terms (above 30% similarity)
- Export or copy the final recommendations for your cataloging system
Image Upload
- Supported formats: PNG and JPEG
- Multiple images can be uploaded per session
- Images are processed by Gemini 2.5 Flash to extract additional bibliographic information
- Images are not stored on any server — processed locally and sent directly to the Gemini API
- Image data is not saved in conversation history (only metadata is saved)
Similarity Scoring
- Each suggested term is compared to LOC results using Levenshtein distance
- Scores range from 0% (no match) to 100% (exact match)
- Visual indicators: green for excellent, amber for moderate, red for poor
- An overall validation score is calculated for the entire set of recommendations
- Only terms above 30% similarity appear in final recommendations
- Results are sorted by similarity score in descending order
Best LOC Match
The extension uses the best matches from the Library of Congress database as final recommendations:
- Initial AI suggestions are validated against the LOC database
- The best match for each term is identified based on similarity score
- Final recommendations use the actual LOC headings rather than the suggested terms
- LCSH IDs come from the LOC database for accurate identification
- Direct links to the LOC website are provided for each term
- Original suggested terms are preserved for reference