मुख्य सामग्री पर जाएँ
Skillpedia
● मुफ़्त और ओपन सोर्स💻 लोकल🔓 API कुंजी नहीं चाहिएडेटा और डेटाबेस

MCP Local RAG

आपके AI एजेंट को आपकी PDF, Word, Markdown और text फ़ाइलों में लोकली खोजने दें, बिना उन्हें किसी embedding API को भेजे।

429 GitHub स्टारद्वारा shinprलाइसेंस MITअपडेट 19 दिन पहले

कैसे इंस्टॉल करें

यह MCP लोकल है: आपके कंप्यूटर पर चलता है।

यह PC पर लगे ऐप्स में काम करता है (Claude Desktop, Claude Code, Cursor, VS Code…)। अपना ऐप चुनें:

टर्मिनल में पेस्ट करें:

claude mcp add local-rag -- npx -y mcp-local-rag

क्या भरना है

नामयह क्या हैज़रूरी
BASE_DIRBase directory for document storage (defaults to current working directory). Ignored when BASE_DIRS is set.नहीं
BASE_DIRSJSON array of base directories (e.g. '["/a","/b"]'). Takes precedence over BASE_DIR.नहीं
IGNORE_PATHSJSON array of glob patterns for files to keep out of the index, each matched against the file's path relative to its root (e.g. '["plugs/**","**/*.draft.md"]').नहीं
DB_PATHPath to LanceDB database directory (defaults to ./lancedb/)नहीं
CACHE_DIRDirectory where Transformers.js models are cached (defaults to ./models/)नहीं
HF_ENDPOINTHugging Face model download endpoint. Set this to a mirror URL when direct downloads are blocked (defaults to https://huggingface.co).नहीं
MODEL_NAMEEmbedding model name (defaults to Xenova/all-MiniLM-L6-v2)नहीं
MAX_FILE_SIZEMaximum file size in bytes (defaults to 104857600 / 100MB)नहीं
RAG_MAX_DISTANCEMaximum distance threshold for filtering search results. Results with distance greater than this value will be excluded. Lower values mean stricter filtering (e.g., 0.5 for high relevance only)नहीं
RAG_GROUPINGGrouping mode for quality filtering. 'similar' returns only the most similar group (stops at first distance jump). 'related' includes related groups (stops at second distance jump). Unset means no grouping filterनहीं
RAG_MAX_FILESMaximum number of files to keep in search results. Results are filtered to include only chunks from the top N best-scoring files. For example, 1 returns only the single best-matching file's chunks. Unset means no file filtering.नहीं
CHUNK_MIN_LENGTHMinimum chunk length in characters (1-10000, defaults to 50). Chunks shorter than this threshold are filtered out during ingestion.नहीं
STORE_IMAGESStore supported PDF and DOCX images during ingestion and return them with matched chunks (defaults to false).नहीं
EMBED_TITLE_PREFIXEmbed each chunk together with its document title, which can help when passages don't restate the topic the title names (defaults to false). After changing it, use a new DB_PATH or delete the index and re-ingest.नहीं
EMBED_HEADING_PREFIXAdd section headings to chunk embeddings when they fit (defaults to false). Independent of EMBED_TITLE_PREFIX. Re-ingest documents after changing it.नहीं
RAG_DEVICEExecution device for the embedder (defaults to cpu). Passed straight to ONNX Runtime; see the Transformers.js device source for the supported backend names. If the requested device fails to initialize, the server throws an error.नहीं
RAG_DTYPEEmbedding quantization dtype for the embedder (defaults to fp32). Opt-in and pass-through; accepts any dtype the chosen model provides (fp32, fp16, q8, int8, ...). If the model has no variant for the requested dtype, the server throws an error. Changing this changes the embedding space — re-ingest existing data.नहीं
RAG_HYBRID_WEIGHTKeyword boost factor for hybrid search (0.0-1.0, defaults to 0.6). 0 means semantic similarity only; higher values increase the keyword-match contribution to the final score.नहीं
RAG_RERANK_CMDExternal reranker command template. Use {query} and {top} for query text and result count; unset disables reranking.नहीं
RAG_RERANK_TIMEOUT_MSTime budget per rerank call in milliseconds (100-600000, defaults to 10000). On timeout the spawned command is killed and the pre-rerank ordering is returned.नहीं

तैयार! अब टेस्ट करें

ऐप दोबारा खोलें और इनमें से कोई एक अनुरोध चैट में पेस्ट करें:

कॉन्फ़िगर किए गए folder के सभी दस्तावेज़ sync करो और बताओ कब पूरा हुआ
API documentation में authentication के बारे में क्या लिखा है?

यह क्या है

यह server आपकी मशीन पर दस्तावेज़ इंडेक्स करता है और उन्हें अर्थ और सटीक keywords दोनों से खोजता है। नतीजों में स्रोत अंश होता है, और जहाँ उपलब्ध हो, headings, line numbers या page numbers भी। पहली model download के बाद इंडेक्सिंग और खोज offline चलती है।

यह क्या कर सकता है

  • sync_start: इंडेक्स को आपके folder के साथ अद्यतन करें
  • sync_status: चल रहे sync की स्थिति देखें
  • ingest_file: एक फ़ाइल जोड़ें या बदलें
  • ingest_data: client के पास मौजूद text, Markdown या HTML जोड़ें
  • query_documents: अर्थ और keyword मिलान से खोजें
  • read_chunk_neighbors: किसी नतीजे के आसपास का टेक्स्ट पढ़ें
  • list_files: फ़ाइलें और उनकी index स्थिति दिखाएँ
  • delete_file: इंडेक्स की गई फ़ाइल हटाएँ

कब इस्तेमाल करें

  • ›जब आप निजी दस्तावेज़ों के folder से सवाल पूछना चाहें
  • ›जब आपको error codes या API names जैसे सटीक मिलान और अर्थ-आधारित खोज दोनों चाहिए
  • ›जब आप चाहते हैं कि जवाबों में page या line का हवाला हो, ताकि आप स्रोत जाँच सकें

आपको क्या चाहिए

Node.js 22.20 या नया, और दस्तावेज़ों का एक folder जो BASE_DIR में सेट हो। पैकेज और लगभग 90 MB का embedding model पहली बार डाउनलोड करने के लिए इंटरनेट चाहिए। API key, Docker या Python नहीं चाहिए।

साथ में जमने वाली skills

⭐ Skillpedia MCP · मुफ़्तआपका एजेंट सही skill अपने आप ढूँढ लेता हैहमारा MCP इंस्टॉल करें और ज़रूरत पड़ने पर आपका एजेंट 15,000+ skills में खोजेगा।मुफ़्त इंस्टॉल करें →

अक्सर पूछे जाने वाले सवाल

क्या मेरा डेटा cloud पर जाता है?

नहीं। यह embedding API इस्तेमाल नहीं करता, और model डाउनलोड होने के बाद offline काम करता है।

कौन सी फ़ाइलें समर्थित हैं?

PDF, DOCX, TXT और Markdown, साथ ही client द्वारा दिए गए HTML या text। Excel, PowerPoint, images और source code फ़ाइलें समर्थित नहीं हैं।

क्या मुझे API key चाहिए?

नहीं। न API key, न Docker, न Python, न कोई बाहरी database।

क्या कोई command line है?

हाँ। npx mcp-local-rag ingest, query, sync, list, status और delete इस्तेमाल कर सकते हैं।

यह फ़ाइल पहुँच को कैसे सीमित करता है?

BASE_DIR फ़ाइल कार्यों की सुरक्षा सीमा है, और MCP की फ़ाइल paths पूरी और configured root के अंदर होने चाहिए।

क्या मैं model बदल सकता हूँ?

हाँ, MODEL_NAME से। model बदलने पर नया DB_PATH रखकर नया index बनाएँ।

अगर काम न करे

  • ›BASE_DIR, DB_PATH और CACHE_DIR को पूरे paths पर सेट करें, ताकि हर प्रोजेक्ट अलग index न बनाए
  • ›पहली sync में model डाउनलोड होने के कारण 1 से 2 मिनट लग सकते हैं
  • ›अगर Hugging Face downloads ब्लॉक हों, तो HF_ENDPOINT को mirror URL पर सेट करें

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।