Local RAG
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| DB_PATH | No | Vector database storage location. Can grow large with many documents. | ./lancedb/ |
| BASE_DIR | No | Document root directory. Server only accesses files within this path (prevents accidental system file access). | . |
| CACHE_DIR | No | Model cache directory. After first download, model stays here for offline use. | ./models/ |
| CHUNK_SIZE | No | Characters per chunk. Larger = more context but slower processing. Valid range: 128 - 2048. | 512 |
| MODEL_NAME | No | HuggingFace model identifier. Must be Transformers.js compatible. | Xenova/all-MiniLM-L6-v2 |
| CHUNK_OVERLAP | No | Overlap between chunks. Preserves context across boundaries. Valid range: 0 - (CHUNK_SIZE/2). | 100 |
| MAX_FILE_SIZE | No | Maximum file size in bytes. Larger files rejected to prevent memory issues. Valid range: 1MB - 500MB. | 104857600 |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| query_documentsA | Search ingested documents with hybrid keyword + semantic matching. Use the returned order as the ranking; score may disagree with it. Each has filePath, chunkIndex, text, fileTitle, score (lower is closer), and source (for ingest_data items). |
| ingest_fileA | Ingest a document file (PDF, DOCX, TXT, MD) into the vector database. Path must be absolute; re-ingesting the same path replaces its existing data. Returns { filePath, chunkCount, timestamp, fileTitle }. |
| ingest_dataA | Ingest in-memory content as a string (use ingest_file for files on disk). The source identifier enables re-ingestion to update existing content. Returns { filePath, chunkCount, timestamp, fileTitle }. |
| delete_fileA | Delete a previously ingested file or data from the vector database. Use filePath for files ingested via ingest_file, or source for data ingested via ingest_data. Either filePath or source must be provided. Returns deleted (operation succeeded), removedChunks, and existed (whether anything was actually present). |
| list_filesA | List supported files (PDF, DOCX, TXT, MD) under the configured base directories and whether each is ingested. Returns { baseDirs, files, sources }; sources lists ingested items reported apart from the file scan, chiefly ingest_data content (web pages, clipboard, etc.). |
| statusA | Get index status: { documentCount, chunkCount, memoryUsage (MB), uptime (s), ftsIndexEnabled, searchMode }. |
| read_chunk_neighborsA | Read the chunks immediately before and after a query_documents result, in the same document, for more surrounding context. Pass chunkIndex from the result plus exactly one of filePath (ingest_file) or source (ingest_data). Returns the target chunk (isTarget: true) and its neighbors, ascending by chunkIndex; an out-of-range chunkIndex returns []. Defaults: before=2, after=2 (max 50 each). |
| sync_startA | Reconcile the index with the files on disk: ingest new and changed files, leave unchanged files alone, and remove index entries for files that are gone. Each changed PDF is re-ingested with the visual profile ("fast" or "quality") already recorded for it, so a PDF indexed with VLM captions keeps them; a PDF with no recorded profile stays text-only. There is no option to change a profile here — use the CLI (mcp-local-rag sync --visual) to set one, or ingest_file to replace the file, where a normal ingest clears the recorded profile. Stored images are unrelated: STORE_IMAGES applies to whatever this run re-ingests and never makes a file changed. Returns { jobId } without waiting for the run to finish; poll sync_status with that jobId for progress and the final outcome. Only one job is kept, and it is lost when the server process exits. |
| sync_statusA | Get the current or latest sync job record: { jobId, state ("running" | "succeeded" | "failed"), total (null until scanning has counted the files on disk), completed (upserted + skipped + empty; pruned is counted separately), summary { upserted, skipped, empty, pruned }, warnings, error (null unless the job failed) }. An unknown jobId means the job was replaced by a newer one or lost with a previous server process. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 9 tools
Each tool targets a distinct operation: ingestion, querying, neighbor context, deletion, listing, status, and sync lifecycle. The only similar pair, ingest_data and ingest_file, is clearly differentiated by input type (string vs. file path), and sync_start versus sync_status cleanly separates starting from monitoring.
Most names follow a consistent verb_noun pattern in snake_case: query_documents, delete_file, ingest_data, ingest_file, list_files, read_chunk_neighbors, sync_start, sync_status. The single 'status' tool breaks the pattern by being a bare noun rather than get_status or similar, which is a minor inconsistency.
Nine tools is well within the ideal range for a focused local RAG server. Each tool covers a meaningful, non-redundant capability—ingest, query, delete, list, context expansion, status, and sync—without bloat or excessive granularity.
The server covers the core RAG lifecycle: ingestion (file and data), retrieval, context expansion, deletion, listing, status, and filesystem reconciliation. A minor gap is that there is no direct way to fetch a document's chunks by filePath without first obtaining a chunkIndex from query_documents, but this is workable through existing tools.