A powerful RAG (Retrieval-Augmented Generation) plugin for LM Studio that can index and search through gigabytes or even terabytes (not tested) of document data. Hosted here: ari99/lm_studio_big_rag_plugin on GitHub.
.java, .py, .rs) via the Additional plain-text extensions setting| Category | Extensions |
|---|---|
| Documents | .pdf, .epub, .txt, .text |
| Markdown | .md, .mdx, .markdown, .mkd, .mkdn, .mdown |
| Web | .htm, .html, .xhtml |
| Images (OCR) | .bmp, .jpeg, .jpg, .png |
PDF, EPUB, HTML, and images use dedicated parsers. Plain-text and Markdown files use the text parser.
Any other plain-text extension can be indexed by listing it in Additional plain-text extensions in the chat Integrations sidebar (or via BIG_RAG_ADDITIONAL_EXTENSIONS for CLI indexing).
Common examples:
.java
.cs
.py
.rs
.go
.ts
.tsx
.js
.jsx
.c
.cpp
.h
.sql
.yaml
.toml
Format rules:
.java and java both work)# are comments; inline # after an extension is also stripped*, ?) are not allowedRejected automatically: binaries and formats that already have dedicated parsers or are unsafe to read as text — e.g. .exe, .zip, .jar, .docx, .pdf, .png. Rejections are logged as [BigRAG] Rejected additional extension … in developer logs.
After changing extensions: trigger a reindex (empty vector store + chat message, or Manual Reindex Trigger ON) so new file types are picked up. Pair with Exclude filename patterns when indexing source trees:
node_modules/**
target/**
bin/**
dist/**
.git/**
CLI / headless indexing:
BIG_RAG_ADDITIONAL_EXTENSIONS=".java;.cs;.py" \
BIG_RAG_DOCS_DIR=/path/to/repo \
BIG_RAG_DB_DIR=/path/to/vectorstore \
npm run index
cd big-rag-plugin
npm install
npm run build
Then choose one of the following:
| Goal | Command | Plugin id for REST |
|---|---|---|
| Dev (hot reload, chat UI) | npm run dev |
Use installed copy for REST (see below) |
| Local install (REST + chat) | lms dev --install -y |
mindstudio/big-rag |
| Publish to Hub | lms login then lms push -y |
mindstudio/big-rag |
After code changes: npm run build then re-run npm run dev, lms dev --install -y, or lms push -y.
Hub page: lmstudio.ai/mindstudio/big-rag
Default chat workflow — no lms server start; the server runs inside the LM Studio app (http://localhost:1234 when enabled).
cd big-rag-plugin && npm run dev (leave running; good for UI iteration)cd big-rag-plugin && npm run build && lms dev --install -yAutomated tests (no UI):
cd big-rag-plugin && npm test
Headless indexing (optional; LM Studio app must be open for embeddings):
cd big-rag-plugin && npm run index
Paths are set in package.json index script or via BIG_RAG_DOCS_DIR / BIG_RAG_DB_DIR env vars.
All plugin fields appear in the chat Integrations sidebar when Big RAG is enabled (expand the plugin row). There is no separate global settings screen for document paths.
The plugin provides the following configuration options:
mixedbread-ai/mxbai-embed-large-v1 (Hub / lms get) and text-embedding-mxbai-embed-large-v1 (as shown in lms ls). Use one spelling consistently for indexing and retrieval so it matches .big-rag-embedding.json; switching spelling without reindexing can trigger a mismatch warning. Default: nomic-ai/nomic-embed-text-v1.5-GGUF..big-rag-embedding.json: Written under the vector store directory when the index has at least one chunk; records the model id and vector length used to build the index. If the configured model no longer matches this file, retrieval is blocked until you reindex or revert the setting. If the index has zero chunks, this file is removed so metadata cannot drift (including after manual shard deletion).*.png, node_modules/**, target/**. Applied after the extension gate; does not remove chunks already in the vector store..txt.CLI equivalents: BIG_RAG_EXCLUDE_PATTERNS and BIG_RAG_ADDITIONAL_EXTENSIONS (semicolon-separated for env vars).
/Users/user/Documents/MyLibrary)/Users/user/.lmstudio/big-rag-db)Settings → Integrations (gear menu) only controls tool-call confirmation — not document paths.
Progress appears in LM Studio developer logs ([BigRAG] lines)
Query your documents:
Big RAG registers a prompt preprocessor (automatic RAG in chat) and a tools provider (big_rag_search, big_rag_index_status) for /api/v1/chat.
http://localhost:1234)."mindstudio/big-rag" (owner/name from manifest.json). The dev id (dev/mindstudio/big-rag from npm run dev) works in chat UI but not in REST.npm run build && lms dev --install -y (local) or lms push -y (Hub).Authorization: Bearer $LM_API_TOKEN (docs).REST tool calls have no chat session, so they do not read the sidebar directly. Paths come from (in order):
~/.lmstudio/big-rag-tools-config.json when the prompt preprocessor runs (send at least one chat message with Big RAG enabled after configuring paths).BIG_RAG_DOCS_DIR, BIG_RAG_DB_DIR, optional BIG_RAG_EMBEDDING_MODEL, BIG_RAG_RETRIEVAL_LIMIT, BIG_RAG_RETRIEVAL_AFFINITY_THRESHOLD.If you delete the JSON file, send a chat message again or set the env vars before calling tools via curl.
/api/v1/chat)Load your API token (example: repo-root .env):
export $(grep -v '^#' .env | xargs) # sets LM_API_TOKEN
Index status (one tool — reliable):
curl -s http://127.0.0.1:1234/api/v1/chat \
-H "Authorization: Bearer $LM_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"model": "your-model-id",
"input": "Call big_rag_index_status and report totalChunks.",
"integrations": [{
"type": "plugin",
"id": "mindstudio/big-rag",
"allowed_tools": ["big_rag_index_status"]
}],
"temperature": 0
}' | python3 -m json.tool
Search (one tool — use limit 3 in the prompt to avoid context overflow):
curl -s http://127.0.0.1:1234/api/v1/chat \
-H "Authorization: Bearer $LM_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"model": "your-model-id",
"input": "Use big_rag_search to find content about rifle cleaning. Use limit 3.",
"integrations": [{
"type": "plugin",
"id": "mindstudio/big-rag",
"allowed_tools": ["big_rag_search"]
}],
"temperature": 0
}' | python3 -m json.tool
Preprocessor-only RAG (no explicit tools — model answers using injected context; needs sidebar config + chat sync or env vars):
curl -s http://127.0.0.1:1234/api/v1/chat \
-H "Authorization: Bearer $LM_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"model": "your-model-id",
"input": "What does the documentation say about rifling?",
"integrations": [{
"type": "plugin",
"id": "mindstudio/big-rag"
}],
"temperature": 0
}' | python3 -m json.tool
| Tool | Description |
|---|---|
big_rag_search |
Embed a query and return matching passages (JSON with scores and file names) |
big_rag_index_status |
Return chunk count, unique file count, and configured directory paths |
tool_format_generation_error because smaller models (e.g. Llama 3.1 8B) emit multiple tool calls in one generation block. Run separate curl requests instead.big_rag_search with limit=10 returns full passage text and can exceed the model context window (e.g. 14848 tokens). Ask for limit 3 or increase context length in LM Studio.~/.lmstudio/big-rag-tools-config.json, or set BIG_RAG_DOCS_DIR / BIG_RAG_DB_DIR./api/v1/chat over OpenAI-compatible /v1/chat/completions for plugin integrations.Source code / repo RAG
Point Documents Directory at a project
$ claude mcp add lm_studio_big_rag_plugin \
-- python -m otcore.mcp_server <graph>