rag-pipeline
Summary: This server exposes only two MCP tools for searching ingested papers and ingesting PDFs.
search_papers: run a natural-language query over the ingested paper collection and return up to 20 relevant passages (default 5) with page numbers and sources, ranked by a cross-encoder reranker.ingest_paper: ingest a PDF from a local filesystem path by chunking it, embedding it densely and sparsely, and storing it in Qdrant.It does not expose the broader rag-pipeline MCP features described in the README, such as library management, text/image ingestion, context/page reading, or ingest status.
Resolves bibliographic metadata by extracting a DOI from the first page of a PDF and fetching citation data (title, authors, journal, year, volume/issue/pages) from the CrossRef API, falling back to the PDF's own metadata when no DOI is found.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@rag-pipeline find papers on transformer architectures from 2023"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
π΅π± Wersja polska
RAG Pipeline β a local knowledge base
A local, GPU-accelerated retrieval pipeline for research papers, whole books, slide decks, notes and pasted text. Everything runs on your own machine β Qdrant, Redis, the models and a browser panel. Searchable by Claude through an MCP server, or by hand from the GUI.
Features
Two kinds of knowledge libraries
shared, tagged β libraries share one Qdrant collection (
kb_common); search all of them at once or narrow to one library / a set of tags,isolated β its own Qdrant collection (
kb_<id>); search never leaves it, so knowledge is not diluted.Each is public or private: private ones are skipped by default search and are only used when named explicitly.
Agent access control β an MCP agent without a token sees public libraries only (private ones do not exist for it, not even by name). A token profile (
RAG_API_TOKEN) defines which private libraries it may see; granular scope per library, or all, or none. Each profile has arequires_unlockflag β when set, the agent can only see its libraries after they are temporarily unlocked viaPOST /libraries/{lib_id}/unlockin the DostΔp tab. Withoutrequires_unlock, the profile has persistent access to its libraries. This is tool-level protection, not OS-level isolation.Browser panel (
http://localhost:8100) β create libraries, drag-and-drop files, paste text, edit tags and citation metadata, watch ingest progress, browse chunks, run searches with a per-stage trace, inspect service state and logs. Tabs: Biblioteki (libraries), Szukaj (search), Zadania (jobs queue with a notification pill showing pending/failed tasks), DostΔp (agent access profiles and library lock/unlock), Debug (GPU mode, ColPali unload, cache stats). Dark/light theme toggle.Document types β papers, books, textbooks, articles, notes, slide decks, atlases.
Per-document embed-figures β
POST /documents/{lib}/{hash}/embed-figuresruns ColPali embedding for figures without re-parsing the document.Per-document reingest β
POST /documents/{lib}/{hash}/reingest?chunking=paragraph&full_pipeline=trueoverrides chunking or pipeline settings without re-uploading.Formats β PDF, DOCX, PPTX, XLSX, HTML, Markdown, images (Docling) plus EPUB and TXT (small built-in parser).
Photos as documents β an image file uploaded without the full pipeline is one entry searched by its title and description; the description is written by the user in the GUI or by an agent over MCP (it looks at the photo and stores what it sees). No OCR, no vision models.
Chunking β
mergedby default: paragraphs of a section packed to ~1200 characters (papers too; one-element-per-chunk produced 29% of chunks under 60 characters). Reference lists are tagged and excluded from search unlessinclude_referencesis set.Multilingual embeddings β BGE-M3 produces dense and sparse vectors in one pass (Polish + English); figures get a ColPali multivector in the full pipeline.
Hybrid search β dense + sparse with RRF fusion in Qdrant. Modes:
normal(fusion only) andscholar(CrossEncoder reranking, relevance cutoff, authors/DOI required, ColPali for figures with a relevance threshold,COLPALI_MIN_SCORE). When scholar drops relevant passages for lacking authors/DOI, the response says how many and from which documents.Figures β found by their real caption and by the image (ColPali). Icon-sized pictures (under ~1.2% of the page area, full pipeline only) are skipped. Small-VLM descriptions are off by default (
VLM_DESCRIPTIONS=1brings them back as a labelled, non-embedded annotation).Metadata β DOI from the first 3 pages (title-checked), CrossRef, then DataCite (arXiv), then the PDF's own metadata. The year is never taken from the file's creation date.
Durable state in SQLite β libraries, documents, SHA-256 dedup, per-document ingest log. Source files stay on disk, so re-ingesting needs no re-upload.
MCP server β
list_libraries,create_library,search_library,ingest_document,ingest_text,read_context,get_page,ingest_status, plus photo tools:ingest_image,list_images,get_image,describe_image.get_pagereturns an original PDF page as an image; results carry local links to figures and pages.read_contextreads the chunks around a hit;ingest_textwith anote_keyreplaces the note's previous version. AI-written text (ingest_text) always gets categoryai-noteand no authors, soscholarnever returns it. Deleting libraries and changing visibility is GUI-only.
Related MCP server: Personal Research Assistant MCP
Layout
File | Role |
| API + GUI: libraries, ingest, documents, search, debug |
| parsing, chunking, embedding, upsert (RQ job |
| BGE-M3: dense + sparse in one forward pass |
| EPUB/TXT parser, paragraph packing |
| SQLite: libraries, documents, events |
| DOI β CrossRef (PDF metadata) |
| MCP tools for Claude |
| GPU/CPU device selection shared by API and worker |
| RQ worker entry point ( |
| Python dependencies (used by Dockerfile) |
| Development Python 3.14; Docker image uses |
| uv project metadata |
| browser panel (no build step) |
Running
docker compose up -d --build
# GUI + API: http://localhost:8100 (API docs: /docs)The first start downloads models from Hugging Face (cache shared with the host: ~/.cache/huggingface). Afterwards you can cut HF traffic with HF_OFFLINE=1 in .env. Other .env variables: RAG_PORT (default 8100), RAG_BIND (default 127.0.0.1; 0.0.0.0 exposes the panel on the LAN, with no login), RERANKER_MODEL, SCHOLAR_MIN_SCORE, COLPALI_MIN_SCORE, VLM_DESCRIPTIONS, RAG_IDLE_UNLOAD_S, LOG_LEVEL, HF_CACHE_DIR.
The project uses Python 3.11 in the Docker image (requirements.txt) and Python 3.14 for local development (.python-version, pyproject.toml). Both are compatible.
The only outbound request at runtime is the CrossRef metadata lookup for PDFs that carry a DOI.
MCP config: run mcp_server.py with the project's .venv Python; the API address comes from RAG_API_BASE (default http://localhost:8100). Set RAG_API_TOKEN for private library access β without a token the MCP agent sees public libraries only.
Sharing the GPU with a local LLM
The API loads search models on the first query and drops them after 15 idle minutes (
RAG_IDLE_UNLOAD_S) β no VRAM is held at rest.The device follows free VRAM: GPU when there is room, otherwise CPU (query ~0.2 s, reranking ~1.5 s on an i5-9400F).
POST /debug/gpu {"mode":"cpu"}frees the card at once and keeps RAG on CPU for 10 minutes;{"mode":"auto"}lifts it.llm-start/llm-stopcall it themselves.Ingest with a busy card: up to 40 chunks run on CPU, larger documents and the full pipeline wait in the queue. ColPali is skipped in search meanwhile.
Known limitations
The
scholarreranker is the multilingualmmarco-mMiniLMv2-L12-H384-v1withSCHOLAR_MIN_SCORE=-2.0(calibrated on 12 Polish/English queries β a small sample). To go back to the previous English-only one:RERANKER_MODEL=cross-encoder/ms-marco-MiniLM-L-6-v2andSCHOLAR_MIN_SCORE=-5.0in.env.BAAI/bge-reranker-v2-m3separates relevant from irrelevant more cleanly but needs 20β50 s per query on CPU.scholaronly returns passages that have authors or a DOI β books without a DOI need authors filled in (at upload or in the document details).After a chunking or metadata change,
POST /debug/reingest-allrecomputes everything from the stored files; a document's previous version is replaced only once the new one is ready.One worker = one document at a time.
Available Tools
2 toolsingest_paperA
Ingest a PDF file from the local filesystem into the search index. The file is chunked, embedded (dense + sparse), and stored in Qdrant.
Inputs: file_path (required).
search_papersA
Search the ingested paper collection using a natural-language query. Returns the most relevant passages with page numbers and sources, ranked by a cross-encoder reranker.
Inputs: query (required), limit.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 2 tools
The two tools have completely distinct roles: one adds documents to the index, the other queries it. There is no overlap or ambiguity between ingestion and search.
Both tools follow a verb_noun pattern and are recognizable at a glance. The only minor inconsistency is that one uses the plural 'papers' while the other uses singular 'paper'.
Two tools is a thin surface, falling below the typical 3-15 well-scoped range. Each tool is essential for the core RAG workflow, but the set still feels minimal for anything beyond basic ingest-and-query usage.
The core ingest and search operations are present, giving agents the main RAG loop. However, there is no way to list, delete, or update ingested papers, which leaves obvious workflow gaps around managing the collection.
Maintenance
Related MCP Connectors
Search arXiv/Semantic Scholar/OpenAlex + medical evidence (PubMed/Europe PMC) + LaTeX/PDF tools.
Private, multimodal knowledge store for agents: hybrid search with cited, provenance-backed results.
Papers, SEC filings, Wikipedia, HN and web reading for research agents. 15 tools, x402.
Paper search (free), literature review packs, hallucinated-citation checks, arXiv digests, citations
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables Claude to perform hybrid search across local documents by combining semantic vector retrieval and BM25 keyword matching for optimal context recovery. It supports multiple file formats including PDF, CSV, and Markdown, leveraging local Ollama models for private and efficient document querying.5MIT
- FlicenseNot gradedqualityDmaintenanceEnables semantic search and conversational querying across a personal research library of PDFs, DOCX, and other documents using a vector database. It provides tools for document summarization, finding related papers, and high-accuracy retrieval for AI clients like Claude Desktop.-
- AlicenseNot gradedqualityDmaintenanceEnables Claude Code to index and semantically search through PDFs, code, and documents with exact citations and zero hallucinations.MIT
- AlicenseAqualityCmaintenanceEnables searching for scientific papers across OpenAlex, CrossRef, and Unpaywall, and downloading open-access PDFs directly through Claude Desktop.51MIT