Project Files
src / config.ts
import { createConfigSchematics } from "@lmstudio/sdk";
import { homedir } from "os";
import { join } from "path";
export const pluginConfigSchematics = createConfigSchematics()
.field("embeddingModelIdentifier", "string", {
displayName: "Embedding Model Identifier",
subtitle: "Identifier of the loaded LM Studio embedding model to use (e.g. 'nomic-embed-text'). Leave blank to use any loaded embedding model.",
}, "")
.field("chunkSize", "numeric", {
int: true, min: 100, max: 8000,
displayName: "Chunk Size (characters)",
subtitle: "Maximum characters per text chunk. Smaller = more precise retrieval. Larger = more context per chunk.",
slider: { min: 100, max: 8000, step: 100 },
}, 800)
.field("chunkOverlap", "numeric", {
int: true, min: 0, max: 500,
displayName: "Chunk Overlap (characters)",
subtitle: "How many characters to overlap between adjacent chunks. Helps preserve context at boundaries.",
slider: { min: 0, max: 500, step: 25 },
}, 150)
.field("topK", "numeric", {
int: true, min: 1, max: 20,
displayName: "Top K Results",
subtitle: "Number of chunks to retrieve per query.",
slider: { min: 1, max: 20, step: 1 },
}, 5)
.field("dataPath", "string", {
displayName: "Data Path",
subtitle: "Directory where the vector index is stored.",
}, join(homedir(), "rag-data"))
.field("autoInject", "boolean", {
displayName: "Auto-Inject Context",
subtitle: "Automatically retrieve and inject relevant chunks into the first message of each session.",
}, true)
.field("workspacePath", "string", {
displayName: "Workspace Path",
subtitle: "Root directory for relative file path lookups. Leave blank to use absolute paths only.",
}, "")
.field("maxFileSizeMb", "numeric", {
int: true, min: 1, max: 500,
displayName: "Max File Size (MB)",
subtitle: "Files larger than this are rejected before parsing.",
slider: { min: 1, max: 500, step: 5 },
}, 50)
.build();