![]()
PinRAG
Overview
PinRAG is for when you want to learn about something and your materials are scattered—PDFs and ebooks, GitHub repos, YouTube videos, Discord discussions, and plain notes. You index those materials into one shared RAG index, then ask questions from Cursor, VS Code (GitHub Copilot), or any MCP-capable assistant and get answers with citations pointing back to pages, timestamps, files, or threads.
Under the hood it is Retrieval-Augmented Generation built with LangChain and exposed as an MCP (Model Context Protocol) server: add documents from the editor, query with natural language, list or remove what you indexed. Supported inputs include PDFs, local text files and directories, Discord exports, YouTube (transcript from URL, playlist, or ID), and GitHub repo URLs. For YouTube you can optionally add vision so on-screen code, diagrams, and UI text are merged with the transcript in the same chunks—see YouTube vision enrichment.
Features
- Multi-format indexing — PDF (.pdf), local files or directories, plain text (.txt), Discord export (.txt), YouTube (video or playlist URL, or video ID), GitHub repo (URL), web documentation sites (URL)
- Optional YouTube vision — Off by default. When enabled, runs a vision model (OpenAI, Anthropic, or OpenRouter native video) and merges structured on-screen context with the transcript so RAG chunks carry searchable code names, labels, and diagrams—not speech alone. OpenRouter mode avoids local ffmpeg/video download; openai/anthropic use scene keyframes and require
pinrag[vision]+ ffmpeg (see YouTube vision enrichment) - RAG with citations — Answers cite source context: PDF page, YouTube timestamp, document name for plain text and Discord, chunk index for GitHub repos, source URL for web documentation
- Document tags — Tag documents at index time (e.g.
AMIGA,PI_PICO) for filtered search - Metadata filtering —
query_toolsupportsdocument_id,tag,document_type, PDFpage_min/page_max, andresponse_style(thorough or concise) - MCP tools —
add_document_tool,query_tool,list_documents_tool,remove_document_tool,set_document_tag_tool,list_collections_tool; optionalcollectionon tools overridesPINRAG_COLLECTION_NAMEfor that call - MCP resources —
pinrag://documents(indexed documents) andpinrag://server-config(env vars and config); click in Cursor’s MCP panel to view - MCP prompt —
use_pinrag(parameter: request) for querying, indexing, listing, or removing documents - Configurable LLM — OpenRouter (default, free
openrouter/freerouter), OpenAI, Anthropic, or Cerebras Inference (OpenAI-compatible API); set viaPINRAG_LLM_PROVIDERandPINRAG_LLM_MODELin MCPenvor your shell - Local embeddings — Nomic (
PINRAG_EMBEDDING_MODEL, defaultnomic-embed-text-v1.5); no API key; first run downloads model weights (~270 MB, cached) - Retrieval & chunking options — Structure-aware chunking (on by default); optional FlashRank re-ranking, multi-query expansion, and parent-child chunks for PDFs (see Configuration)
- Observability — MCP tool notifications (
ctx.log) plus optional LangSmith tracing - Built with — LangChain, Chroma; optional OpenRouter, OpenAI, Anthropic, FlashRank






