alexiel-rag

Public

14 Downloads

README

alexiel-rag

Grounded, folder-scoped retrieval for Alexiel. You tell it exactly which folders it's allowed to read; it indexes only those (recursively), and every search result comes back tagged with its exact source file and chunk number — so anything Alexiel states based on it is traceable back to a real file you can go open yourself.

No filesystem MCP required. This plugin never writes, deletes, or executes anything outside its own local index database. Reading is scoped strictly to the folders you list in config — verified by path containment (blocks ../ escapes) and it never follows symlinks, so a symlink planted inside an allowed folder can't be used to read outside it. Tested against both.

Why tool-based, not auto-injecting like memory

alexiel-memory's promptPreprocessor auto-injects relevant memories on every message — appropriate for small personal facts you want recalled silently. RAG grounding is different: you generally want to see when it's being invoked and what it found, especially early on while you're still trusting it. So this plugin exposes three explicit tools instead:

ToolPurpose
alexiel_rag_reindexRe-scan the configured folders and rebuild the index
alexiel_rag_searchSearch the index; results include file path + chunk number
alexiel_rag_list_sourcesList every indexed file and how many chunks it contributed

Reindexing is always explicit — nothing gets scanned until you (or the model, on your instruction) calls alexiel_rag_reindex. Each reindex fully rebuilds the index from the folders' current contents, so deleted/renamed files never linger as stale entries.

Config

Set in LM Studio's plugin settings panel:

  • Allowed Folders — one absolute path per line. This is the entire security boundary.
  • File Extensions — comma-separated, default covers common text/code/doc formats.
  • Chunk Size / Chunk Overlap — how content gets split for retrieval.
  • Max File Size — files larger than this are skipped (avoids indexing huge binaries/logs).

node_modules and any dot-folder (.git, etc.) are always excluded automatically.

Setup

npm install
npm run dev   # lms dev

Set at least one folder in Allowed Folders, then call alexiel_rag_reindex once (ask Alexiel to run it, or trigger it from LM Studio's tool panel) before searching.

What this deliberately does NOT do

  • No write, delete, or execute tools — read-only indexing only.
  • No automatic background scanning — you decide when a reindex happens.
  • No promptPreprocessor auto-injection — retrieval is always an explicit, visible tool call.

Roadmap: a judge/groundedness-checker (not built yet)

Natural next stage once this is trusted: after Alexiel generates a response using RAG citations, a judge pass checks each claim against the retrieved chunks and flags anything stated without a matching citation — the same kind of check used to catch a model inventing plausible-sounding-but-fake technical details (e.g. UE5 PCG node names) instead of citing real source content. Worth building as its own step once the RAG index itself is solid.