ceveyne's profile picture
ceveyne

user-docs

Public

Personal Knowledge Management supported by vision-capable Agents. Search your personal conversations, Markdown and PDF documentation from within an LM Studio chat. The plugin retrieves the most relevant text sections and, where available, delivers the images embedded in those sections directly into the conversation.

139 Downloads

1 star

1 fork

README

user-docs

Text-only Documentation

Looking for the illustrated user documentation? https://github.com/ceveyne/user-docs-docs

LM Studio Plugin — Personal Knowledge Management supported by vision-capable Agents

Search your personal conversations, Markdown and PDF documentation from within an LM Studio chat. The plugin retrieves the most relevant text sections and, where available, delivers the images embedded in those sections directly into the conversation.

Table of Contents

Key benefits

Probably, you have documents. Lots of them? Plugin guides, device manuals, personal notes, old conversations with useful information buried in them? And when you actually need something specific, good luck finding it again — especially if the answer sits on page 327 of a PDF or in a chat from three weeks ago.

LM Studio Plugin: user-docs — Personal Knowledge Management supported by vision-capable Agents.

  • Hybrid semantic search (BM25 + embeddings) across your local documents
  • Image co-retrieval: screenshots and diagrams embedded in documentation are delivered alongside text
  • Full PDF support with on-demand page rendering
  • LM Studio conversation history as a searchable knowledge base
  • Brave image search integration for visual research — results registered directly as pN candidates
  • All processing is local — no data leaves your machine
  • Agent can write, update, and manage notes autonomously

TL;DR: You ask a question. The agent searches through all your docs, finds the answer, shows you the relevant screenshot if one exists, and gives you a short precise response. No more Ctrl+F across 47 files.

What it does

When you ask a question, user-docs searches your local documentation directories using hybrid retrieval (BM25 + embeddings). For each retrieved text chunk the plugin extracts image references — including embedded base64 images and Obsidian wikilinks — generates previews, and registers them as pN entries in chat_media_state.json. This means review_image, analyse_image, annotate_image can operate on retrieved screenshots without any extra configuration.

Known source files or conversations can be image-fetched directly via fetch_image. PDF pages can be rendered on demand via extract_image.

Workflow examples

See USER_GUIDE.md for in-depth documentation and use cases.


Technical requirements

Hardware

In addition to the resources your main agent model requires, keep in mind:

  • VRAM overhead: The embedding model and vision model add approximately 6.5 GB VRAM on top of your agent model's requirements.
  • Context window: As with many "agentic" tasks, a large context window is needed — especially when working with agent instructions. A minimum of 32 768 tokens is recommended; smaller windows will struggle to hold retrieved chunks and conversation history simultaneously.
  • KV Cache stability: The larger the context window, the more important a stable cache becomes. Keep LM Studio runtimes up to date for the most stable local inference behavior.
  • Model selection criteria are comparable to those for coding tasks: favor models with strong instruction-following, reasoning, and long-context performance over raw parameter count alone.

Software

  • Python 3.9+ — Required for RAG/PDF processing and extract_image. The plugin creates isolated virtual environments internally; nothing pollutes your system Python.
  • LM Studio — Latest runtime engines highly recommended: lms runtime update --all.
  • LM Studio Server

⚖️ Distributed setup: You can run the LM Studio Server on a powerful machine in your network while using the plugin from a lightweight client. Documents are always local to where the plugin runs; only model inference is offloaded via API calls. See Deployment scenarios below.


Setup

Overview — Deployment scenarios

Customize your setup based on where LM Studio Server runs:

Everything Local (Simplest)

All components run on one machine. LM Studio acts as both client and server.

┌──────────────────────────────────────────────────────────────────┐
│  MacBook Pro M5                                                  │
│                                                                  │
│  ┌────────────────────────────────────────────────────────────┐  │
│  │  LM Studio App                                             │  │
│  │                                                            │  │
│  │  ┌──────────────────────────────────────────────────────┐  │  │
│  │  │  Plugin: user-docs                                   │  │  │
│  │  │                                                      │  │  │
│  │  │  vision-capability-primer: qwen/qwen3-vl-4b          │  │  │
│  │  └──────────────────────────────────────────────────────┘  │  │
│  │                           │                                │  │
│  │                           │ OpenAI-compat. API             │  │
│  │                           ▼                                │  │
│  │  ┌──────────────────────────────────────────────────────┐  │  │
│  │  │  LM Studio Server (local)                            │  │  │
│  │  │  baseUrl: http://127.0.0.1:1234/v1                   │  │  │
│  │  │  Agent Model: qwen/qwen3.6-35b-a3b                   │  │  │
│  │  │  Embedding Model: ggml-org/bge-m3-Q8_0-GGUF          │  │  │
│  │  │  Vision Model: qwen/qwen3-vl-8b                      │  │  │
│  │  └──────────────────────────────────────────────────────┘  │  │
│  └────────────────────────────────────────────────────────────┘  │
│                                                                  │
└──────────────────────────────────────────────────────────────────┘

Distributed (e.g., MacBook → Mac Studio)

LM Studio Client and LM Studio backend share one machine. The LM Studio Server (agent inference) runs on a dedicated, more powerful machine.

┌──────────────────────────────────────────────────────────────────┐
│  MacBook Neo                                                     │
│                                                                  │
│  ┌────────────────────────────────────────────────────────────┐  │   ┌─────────────────────────────┐
│  │  LM Studio App                                             │  │   │  Mac Studio M3 Ultra        │
│  │                                                            │  │   │                             │
│  │  ┌──────────────────────────────────────────────────────┐  │  │   │                             │
│  │  │  Plugin: user-docs                                   │  │  │   │  LM Studio Server           │
│  │  │                                                      │  │  │   │                             │
│  │  │  vision-capability-primer: qwen/qwen3-vl-4b          │  │  │   │                             │
│  │  └──────────────────────────────────────────────────────┘  │  │   │  Agent Model:               │
│  │                           │                                │  │   │  qwen/qwen3.6-27b           │
│  │                           │ OpenAI-compat. API ───────────────│──▶︎│  http://<studio-ip>:1234/v1 │
│  │                           ▼                                │  │   │                             │
│  │  ┌──────────────────────────────────────────────────────┐  │  │   │                             │
│  │  │  LM Studio Server (local)                            │  │  │   │                             │
│  │  │  baseUrl: http://127.0.0.1:1234/v1                   │  │  │   │                             │
│  │  │  Embedding Model: ggml-org/bge-m3-Q8_0-GGUF          │  │  │   │                             │
│  │  │  Vision Model: qwen/qwen3-vl-8b                      │  │  │   │                             │
│  │  └──────────────────────────────────────────────────────┘  │  │   └─────────────────────────────┘
│  └────────────────────────────────────────────────────────────┘  │
│                                                                  │
└──────────────────────────────────────────────────────────────────┘

baseUrl must point to the reachable server. Configure via Plugin Settings → API server base-URL.


Step 0 — Install the Plugin

Install and activate ceveyne/user-docs in LM Studio.

💡 In case it's not activated right away after download, activate the user-docs plugin by choosing it from the model-loader Your Generators.


Step 1 — Activate LM Studio Server

The plugin requires a running local server to communicate with models and tools.

  • Open Developer → Local Server on the left panel
  • Enable the green toggle under Local Server
  • Load at least one model from the right side (this becomes your agent model)

Step 2 — Choose Your Agent Model

The agent model orchestrates all plugin commands and accompanies you through chats. Two recommended options:

OptionSettingCharacteristics
Default (fast, compact)qwen/qwen3.6-35b-a3bGood for clearly instructed tasks
OptionSettingCharacteristics
More powerful (slower, flexible)qwen/qwen3.6-27bHandles complex and open-ended tasks better

💡 Other OpenAI-compatible APIs work as well: other local backends (oLMX, Unsloth Studio), cloud providers (OpenAI, Claude). Configure via Plugin Settings → Agent Model, API server base-URL, (Optional) API Key.


Step 3 — Decide Your Use Case

Determine what you want from user-docs. This determines which directories to configure and whether the auto-read guide should be on or off:

What content do you want indexed?

  • Local Markdown / TXT notes?
  • PDF manuals?
  • LM Studio conversation history?
  • External docs from GitHub / URLs?

Primary purpose:

  • Document management (PKM) → Keep Auto-read user-docs Guide ON (default) — agent starts fully operational every session. Sessions start slightly slower.
  • Multi-backend access only → Set it OFF — faster startup, guide available on demand via the agent anytime.

Step 4 — Configure Content Directories

Three directory types are supported:

TypeAccessPurpose
Notes DirectoryRead-writeAgent stores notes here (memorize_doc, export_doc). Contains USER-DOCS.md as the plugin's core guide. Recommended path: ~/Documents/User-docs
Content DirectoriesRead-onlyYour documents — PDF, TXT, MD files fully searchable and indexable
LM Studio ConversationsRead-onlyAdd ~/.lmstudio/conversations to include chat history in the index

With conversations added:

Configure via Plugin Settings → Notes Directory / Content Directories. Set Auto-read user-docs Guide toggle based on your Step 3 decision.

Skills: memorize_doc can also write Agent Skills–compatible SKILL.md bundles (a folder <name>/SKILL.md plus optional companion files) into the Notes Directory — see USER_GUIDE.md for details.


Step 5 — Embedding Model + Vision Model

Two small models for search and image analysis:

SettingRecommended ValuePurpose
Embedding Modelggml-org/bge-m3-Q8_0-GGUFSemantic text search across documents (find_doc)
Vision Model (Qwen3-VL)qwen/qwen3-vl-8bImage analysis and object detection (analyse_image, annotate_image)

Both models should be loaded via the LM Studio Server. Other models are not recommended unless they're variants (finetunes, quantizations) of these standards. Configure via Plugin Settings → Embedding Model / Qwen3-VL.


Step 6 — Vision Prompts (Optional Fine-Tuning)

Two prompt fields for image analysis behavior:

SettingDefaultPurpose
Vision Prompt (analyse_image)EmptySent to the vision model when no explicit description is requested. Leave empty → visual descriptions only on agent request (recommended default). analyse_image always returns generation metadata automatically.
SettingDefaultPurpose
Object Detection Prompt (annotate_image)Built-in hierarchical detection rulesTells Qwen3-VL what to detect and mark with bounding boxes. The built-in default works well, but specifying a custom prompt per request gives precise control (e.g., "mark only the login button").

Configure via Plugin Settings → Vision Prompt / Object Detection Prompt.


First Search — Verify Everything Works

After completing all steps, test with a live search:

  • Open LM Studio chat
  • Ask anything about your indexed documents (e.g., "What documentation do I have?")
  • The agent should respond using find_doc results and screenshots if available

Setup complete. 🎉


IssueSee also
Server not reachableStep 1 — check green toggle in Developer panel
Wrong model loadedStep 2 / Step 5 — verify settings match recommendations
Empty search resultsStep 4 — ensure Content Directories are populated and indexed
Vision tools failingStep 6 — confirm Qwen3-VL is vision-capable (supportsVision: true)
Python not foundSee chapter: "Install Python, if needed" below

Install Python, if needed

find_doc, PDF parsing, and extract_image require Python 3.9+.

The plugin searches for Python automatically. It probes well-known install locations in this order:

  • macOS — python.org (/usr/local/bin/python3.X), Homebrew (/opt/homebrew/bin/python3.X), Xcode CLT, system /usr/bin/python3, then LM Studio's bundled Python as a last resort.
  • Windows — python.org user installer (%LOCALAPPDATA%\Programs\Python\Python3XX\python.exe), system installer (%ProgramFiles%\Python3XX\python.exe), %LOCALAPPDATA%\Python\bin\python.exe, pyenv-win, then LM Studio's bundled Python as a last resort.

If Python is not found:

  • Download and run the standard installer from python.org/downloads.
  • When the installer asks whether to add Python to PATH, answer Yes (this will not help LM Studio find Python directly, but causes no harm).
  • Restart LM Studio.

All packages are installed into isolated venvs inside the plugin directory; nothing is written to your system Python.


Python environments

The plugin creates and repairs isolated Python environments automatically:

EnvironmentUsed forMinimum PythonValidation before reuse
.rag-venvRAG parsing, PDF handling3.9+python3, pip, docling, fitz

Ready markers are only trusted when these checks pass. If an environment was deleted or is incomplete, the plugin rebuilds it instead of waiting until a later timeout.

Configuration reference

SettingDefaultDescription
modelqwen/qwen3.6-35b-a3bAgent/orchestrator model
baseUrlhttp://127.0.0.1:1234/v1LM Studio API base URL
apiKey(empty)API key (only if the server requires authentication)
autoReadUserDocsGuidetrueProvide user-docs.md as non-persistent user-message context and seed it into notesDirectory if missing
notesDirectory~/Documents/User-docsNotes write target; always indexed
contentDirectories~/DocumentsDirectories to index (TXT, MD, PDF)
embeddingModelggml-org/bge-m3-Q8_0-GGUFEmbedding model for semantic retrieval (must be loaded in LM Studio)
embeddingBaseUrlhttp://127.0.0.1:1234/v1Embedding/Vision API Base URL
embeddingApiKey(empty)API key (only if the server requires authentication)
qwen3VlModelPathqwen/qwen3-vl-8bLM Studio model key for the Qwen3-VL Vision API model
visionPrompt(empty)Default prompt for analyse_image. Leave empty to disable automatic description
qwen3VlOdPrompt_(built-in)_Instruction sent to Qwen3-VL for object detection (annotate_image)

Tools

ToolDescription
find_docHybrid RAG search. Returns text context + registers embedded images as pN candidates.
read_docRead a note file in full or partial form. Registers document images by default; base64 payloads are stripped.
fetch_imageRegister all images from one exact filename, Markdown document, image file, or LM Studio conversation as pN.
extract_imageRender a PDF page to PNG via PyMuPDF and register it as iN.
review_imagePresent image candidates to the user for selection.
review_sequenceStep through a sequence of images interactively.
analyse_imageDescribe the pixel content of a pN/iN/aN image via the configured LM Studio Vision API backend.
annotate_imageDetect objects and draw bounding boxes via Qwen3-VL.
show_imagePromote a pN/iN candidate to a visible chat image.
skip_docRemove a read_doc result from the API context (token saving).
memorize_docWrite a new note to notesDirectory with YAML frontmatter, or author a SKILL.md skill bundle (Agent Skills–compatible).
rewrite_docOverwrite an existing note, SKILL.md, or skill companion file in place.
forget_docDelete a note from notesDirectory.
export_docExport the current chat as a Markdown note into notesDirectory.
read_configReturn the current plugin settings as JSON so an agent can inspect live configuration values and assist with setup.

Setup guide images

The interactive setup guide (SETUP.md) references screenshots stored in docs/initial-docs/images/. These images are not bundled inside the plugin — they are excluded from both the build output and the LM Studio Hub upload to stay within the Hub file-count limit.

Instead, the plugin fetches the images lazily from this GitHub repository the first time the setup guide is triggered after a fresh install or update. The fetch is intentional and targets a fixed path in this repository (docs/initial-docs/images/). LM Studio has no built-in update mechanism — to install a new version, users must manually delete the existing plugin directory first. That typically removes the entire directory, so the fetch runs again after each reinstall; within a single install it uses the locally cached copies in docs/initial-docs/images/ inside the plugin's install directory.

Only SETUP.md and docs/initial-docs/images/ are tracked in this repository; all other files under docs/initial-docs/ are git-ignored.


More detailed user docs

See USER_GUIDE.md for in-depth documentation, use cases, technical requirements, known issues, and more.

Changelog

See CHANGELOG.md for version history and release notes.

License

MIT