ceveyne's profile picture
ceveyne

playbook

Public

Persistent, on-demand knowledge base for LM Studio agents. Write instructions, Agent Skills-compatible `SKILL.md` skill bundles, and notes in Markdown or plain text, let the agent find, read, write, and edit them — without polluting the context window on every turn.

128 Downloads

4 stars

1 fork

README

Playbook

An on-demand knowledge base for LM Studio agents. Write instructions, skills, and notes in Markdown or plain text, let the agent find, read, write, and edit them — without polluting the context window on every turn.

Reason-why

After experimenting with several system prompts for a while, I eventually moved toward collecting the various guidelines in a RAG system. Both solutions have specific advantages and disadvantages:

  • System prompts are passed at the start of a conversation. As the conversation progresses, they are sometimes forgotten — especially when the instructions describe very specific use cases.
  • Embeddings are delivered context-sensitively in the respective turn. Although the content is tailor-made — provided all parameters of the RAG pipeline are well calibrated — the mode of delivery has two critical disadvantages: 1. The push principle does not create the best reception conditions, only the second-best. (Even if "spoon-feeding" seems convenient, it is not always accepted by the recipient.) 2. The communication is one-sided: the agent itself has no opportunity to document and record what it has learned.

The best experience I've had so far has been with my tool: Playbook. It combines all the advantages and avoids all the disadvantages mentioned:

  • The pull principle ensures optimal reception conditions: the agent receives the information it needs exactly when it actively asks for it.
  • Beyond the ability to maintain the knowledge base editorially and curate its contents professionally, agents can add their own notes and update outdated information.
  • The sometimes very specific information contained in the system does not bleed into "other" topics and content of conversations. The tool can remain "always on" without increasing the token load (aside from the tool descriptions).
  • Even better might be fine-tuning the agent models — which is, however, comparatively complex and harder to keep up to date.

How It Works

Playbook is like the opposite of a classical RAG pipeline: nothing gets injected automatically. Instead, the agent uses tools when it decides the knowledge base is relevant.

Two-phase retrieval keeps context usage lean:

  • recall — keyword + semantic search, returns metadata only (title, filename, tags, description, score). The context cost is negligible.
  • read — fetches the full text of one specific document, on demand.

Playbook stores two kinds of documents:

  • Notes — flat .md/.txt files at the playbook root, written with title/tags frontmatter.
  • Skills — a folder <name>/ containing a SKILL.md entry point (name/description frontmatter, Agent Skills–compatible) plus optional companion files (e.g. tools/*.md, workflows/*.md) that SKILL.md links to. Only SKILL.md itself is indexed and shows up in recall; companion files are fetched on demand with read once their path is known.

Write access is equally explicit:

ToolWhat it does
memorizeWrite or overwrite a note (title + tags), a SKILL.md (name + description), or a companion file (name + file)
rewriteSurgical text replacement — oldText must match exactly once
forgetDelete a document permanently

Setup

  • Install the plugin.
  • Load an embedding model in LM Studio. The default is text-embedding-nomic-embed-text-v1.5 — swapping in any English or multilingual model works.
  • In the plugin settings, set Playbook Directories to one or more absolute paths of folders where your Markdown/skill files should live. This is the only required setting. The first directory is where memorize writes new notes and skills; any additional directories are read-only search/read sources (useful for sharing a team playbook or a separate skills folder alongside your personal one).

That's it.

If no embedding model is configured (or LM Studio can't reach one), search falls back to BM25 keyword matching automatically.

File Format

Documents are Markdown (.md) or plain text (.txt) files with optional YAML frontmatter:

---
title: "My Note"
tags: ["example", "setup"]
created: "2026-04-07T10:00:00.000Z"
updated: "2026-04-07T10:00:00.000Z"
---

Your content here.

Frontmatter is written and maintained automatically by the memorize tool. Plain text files without frontmatter are indexed too — the filename is used as the title. You can also create and edit files manually in any editor — the plugin detects changes via file watcher and re-indexes within seconds.

Skills

A skill is a folder with a SKILL.md entry point, using name/description frontmatter instead of title/tags:

---
name: "pdf-report"
description: "Generate paginated PDF reports from tabular data."
created: "2026-04-07T10:00:00.000Z"
updated: "2026-04-07T10:00:00.000Z"
---

Instructions here. Link to companion files with a relative path, e.g. [render_table](tools/render_table.md).

This is compatible with the Agent Skills format used by other MCP clients. recall shows the skill's description instead of a title-only summary; read fetches SKILL.md or any companion file by its relative path (e.g. pdf-report/tools/render_table.md). Companion files are not indexed on their own — they only become reachable once their path is known from a SKILL.md you've read.

Configuration

SettingDefaultDescription
Playbook Directories~/Documents/PlaybookOne or more absolute folder paths. First = write target; all are searched/readable
Embedding Modeltext-embedding-nomic-embed-text-v1.5Leave empty for BM25-only search
LM Studio Base URLhttp://127.0.0.1:1234LM Studio local API URL
Max Recall Documents5Maximum results per recall call
Min Recall Score60Minimum relevance score (0–100) to appear in results

Technical Requirements

  • LM Studio with plugin runner support
  • An embedding model loaded in LM Studio (optional, for semantic search)

Companion plugins

  • draw-things-chat — text2image / image2image / video generation, with Vision Promotion so the agent can see and evaluate its own output
  • analyse-image — reads generation metadata from generated images for easy re-generation. Provides masks for agentic inpainting or zoom-in tasks with process-image based on object detection.
  • process-image — crop, zoom-in, inpaint; uses detect_object bounding boxes from plugin analyse-image directly
  • draw-things-index — metadata query across previously generated images
  • user-docs — Personal Knowledge Management supported by vision-capable agents. Fully integrates all playbook capabilities and lets you re-use all your instructions, skills, and notes created with playbook

Disclaimer

‼️ This plugin is a research prototype. ‼️

License

MIT