Forked from mindstudio/big-rag
README
Big RAG is an LM Studio plugin for local retrieval-augmented generation over large document collections. It scans a configured directory, parses supported files, chunks text, embeds the chunks with an LM Studio embedding model, stores vectors in a sharded Vectra index, and injects relevant passages into chat prompts.
chunkSize and chunkOverlap are now correctly interpreted as tokens, not words. Chunks match the configured size.getStats() and hasFile() now use cached or in-memory lookups after load, reducing redundant disk reads per chat turn..docx, .odt, .csv, .tsv, .json, .jsonl, .yaml, .yml, .rst, and .log are now indexed.documentsDirectory, vectorStoreDirectory, or embeddingModel in settings resets the in-memory store and sanity-check cache.cd big-rag-plugin npm install npm run build npm run dev
npm run build expects LM Studio's generated .lmstudio/entry.ts to exist. If you are working from a raw source checkout without that file, npx tsc still validates TypeScript compilation.
character uses fixed character windows and is fastest. sentence groups complete sentences for better semantic coherence. Default: character.After compiling with npx tsc, run:
node dist/cliIndex.js /path/to/documents /path/to/vector-store
Useful environment variables:
BIG_RAG_EMBEDDING_MODELBIG_RAG_CHUNK_SIZEBIG_RAG_CHUNK_OVERLAPBIG_RAG_CHUNKING_STRATEGY (character or sentence)BIG_RAG_MIN_CHUNK_LENGTHBIG_RAG_MAX_CONCURRENTBIG_RAG_ENABLE_OCRBIG_RAG_PARSE_DELAY_MSBIG_RAG_EXCLUDE_PATTERNS (semicolon-separated)BIG_RAG_FAILURE_REPORT_PATHBIG_RAG_FORCE_REINDEXsrc/promptPreprocessor.ts: reads config, initializes the vector store, runs retrieval, and injects RAG context.src/ingestion/indexManager.ts: scans, parses, chunks, embeds, and writes document chunks.src/parsers/: file-type parsers for HTML, PDF, EPUB, text, images, and Office documents.src/utils/textChunker.ts: character and sentence chunking plus token estimation.src/vectorstore/vectorStore.ts: sharded Vectra storage, search, stats cache, and file hash index.npx tsc node --test dist/tests/parseDocument.test.js dist/tests/fileExcludePatterns.test.js
Use npm run test when the LM Studio-generated .lmstudio/entry.ts file is present because that script runs the full build first.
.big-rag-embedding.json or run a full reindex.maxConcurrentFiles.retrievalAffinityThreshold, use sentence chunking, or increase minChunkLength.ISC