Index Documents for RAG
rag_indexIndex local files or directories into a semantic search store for later retrieval by embedding them. Re-indexing replaces old chunks.
Instructions
Embed and index a local file or directory into the semantic search store so you can retrieve relevant passages later with rag_search. Re-indexing the same source replaces its old chunks.
Requires an embedding server (LM Studio or llama.cpp) running with an embedding model loaded.
Args:
path (string): File or directory to index. Directories are walked for text/code files.
max_files (number): Cap on files when indexing a directory, 1-2000 (default 200).
Returns the number of files and chunks indexed.
Example: { "path": "~/project/docs" }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | File or directory to index | |
| max_files | No | Max files for a directory |