library-rag

Index EPUB and PDF documents into a semantic search library using bge-m3 embeddings and sqlite-vec.

15|3|Updated Jul 8, 2026
One-click install
npx skills add https://github.com/moonlight-lupin/agent-skills --skill library-rag
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: library-rag
Source: https://github.com/moonlight-lupin/agent-skills/tree/main/research/library-rag
Command: npx skills add https://github.com/moonlight-lupin/agent-skills --skill library-rag

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires requests, sqlite-vec, pdfplumber, ebooklib, beautifulsoup4, lxml, mcp, and includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill enables the creation and querying of a personalized semantic search library, allowing users to efficiently search and retrieve information from their own collection of texts.

Core Features & Use Cases

  • Personal Library Creation: Index and store texts such as books, documents, and reference works in any language.
  • Meaning-based Retrieval: Search the library using concepts rather than keywords, resulting in more accurate search results.
  • Use Case: Suppose you have a collection of legal documents. Use this Skill to index them and then search for specific legal terms or concepts to quickly find relevant information.

Quick Start

Use the library-rag skill to index the books in your library and then query it with "Search for the term 'intellectual property'".

Frequently Asked Questions about library-rag

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a semantic search library for my personal PDF and EPUB documents?▼

Build a semantic search library by indexing PDF and EPUB documents, converting them to structured markdown, and storing bge-m3 embeddings in sqlite-vec for meaning-based retrieval. This allows you to search personal texts by concept rather than exact keyword matches.

What is meaning-based retrieval and how does it work for personal texts?▼

Meaning-based retrieval uses bge-m3 embeddings to match conceptual similarity rather than exact keywords. By indexing your personal library into a sqlite-vec database, searches return results based on the underlying context and semantic meaning of the query.

Do I need an OpenRouter API key to index documents for semantic search?▼

Yes, an OpenRouter API key is required to generate bge-m3 embeddings for semantic search indexing. You also need the sqlite-vec extension enabled to store and query these vector embeddings within your personal library database.

Can I use sqlite-vec to query a personal library across multiple languages?▼

Yes, you can index and query personal texts in any language. The semantic search mechanism uses bge-m3 embeddings to capture meaning across languages, enabling accurate retrieval from your library regardless of the document's original language.

How do I convert PDF and EPUB files into structured markdown for indexing?▼

PDF and EPUB files are automatically converted to structured markdown using pdfplumber and ebooklib during the indexing process. This extracts the text content into a clean format suitable for generating bge-m3 embeddings and storing them in sqlite-vec.

What are the limitations of using sqlite-vec for personal library semantic search?▼

Limitations include the strict requirement of an OpenRouter API key for embedding generation and the need for the sqlite-vec extension. Additionally, indexing is currently limited to PDF and EPUB formats, excluding other document types from the personal library.