RAG · pgvector · Claude

    Ask anything about your documents.

    DocMind extracts text, tables, images, and hyperlinks from PDFs, DOCX, and TXT files. Upload once. Query with natural language. Get cited answers.

    No account required. Self-hosted. Open source.

    DocMind upload and chat UI

    How It Works

    Two pipelines — one for indexing your documents, one for answering your queries.

    Indexing Pipeline

    01

    Upload

    User uploads PDF, DOCX, or TXT

    →

    02

    Parse

    Extracts text, tables→Markdown, images→Vision LLM, hyperlinks

    →

    03

    Chunk

    RecursiveCharacterChunker, 512-char overlapping chunks

    →

    04

    Embed

    all-MiniLM-L6-v2 → 384-dim vectors

    →

    05

    Store

    PostgreSQL + pgvector IVFFlat + GIN FTS index

    Query Pipeline

    01

    Query

    User types a natural-language question

    →

    02

    Guard

    Meta-query detector intercepts identity/chitchat instantly

    →

    03

    Embed

    Same model encodes query → 384-dim vector

    →

    04

    Hybrid Search

    Vector ANN (cosine) + Full-text (ts_rank_cd) in parallel

    →

    05

    RRF Fusion

    Reciprocal Rank Fusion: score = Σ 1/(60 + rank + 1)

    →

    06

    Rerank

    Cross-encoder ms-marco-MiniLM-L-6-v2 rescores top-12

    →

    07

    Truncate

    Top-5 chunks selected for LLM context

    →

    08

    Answer

    Claude via OpenRouter generates a cited answer

    DocMind query results with source citations

    Everything you need

    Built for real document workflows

    Upload & Index

    PDF, DOCX, TXT supported. Auto-chunked and embedded instantly.

    Hybrid Search

    BM25 + vector similarity via RRF for best-of-both precision.

    Source Citations

    Every answer shows which document it came from, ranked by file.

    Table Understanding

    Tables extracted to Markdown so the LLM reasons over structured data.

    Image & Chart Reading

    Images described by a vision LLM and made searchable.

    Hyperlink Extraction

    URLs and anchor text from PDFs/DOCX captured in search context.

    Cross-encoder Reranking

    Second-pass reranker rescores 12 candidates to surface top-5.

    Scope Enforcement

    Hard system-prompt constraints keep answers within document content.

    Meta-query Guard

    Identity/chitchat intercepted before retrieval for instant responses.

    Built With

    Production-grade stack, both ends.

    BACKEND

    PythonFastAPIPostgreSQLpgvectorSQLAlchemy (async)asyncpgsentence-transformerscross-encoderOpenRouterClaude 3.5 Sonnetpypdfpdfplumberpymupdfpython-docxDockerpydantic-settings

    FRONTEND

    ReactTypeScriptViteTailwind CSSLucide Icons
    PythonFastAPIPostgreSQLpgvectorSQLAlchemy (async)asyncpgsentence-transformerscross-encoderOpenRouterClaude 3.5 Sonnetpypdfpdfplumberpymupdfpython-docxDockerpydantic-settingsReactTypeScriptViteTailwind CSSLucide Icons
    PythonFastAPIPostgreSQLpgvectorSQLAlchemy (async)asyncpgsentence-transformerscross-encoderOpenRouterClaude 3.5 Sonnetpypdfpdfplumberpymupdfpython-docxDockerpydantic-settingsReactTypeScriptViteTailwind CSSLucide Icons
    PythonFastAPIPostgreSQLpgvectorSQLAlchemy (async)asyncpgsentence-transformerscross-encoderOpenRouterClaude 3.5 Sonnetpypdfpdfplumberpymupdfpython-docxDockerpydantic-settingsReactTypeScriptViteTailwind CSSLucide Icons

    Ready to explore the code?

    DocMind is fully open-source. Clone it, run it locally, and see how every part of the RAG pipeline works.