# docmd - Full Context
> Generated by docmd
---
## [docmd assistant - Offline AI Assistant for Documentation](https://docmd.io/assistant/)
---
title: "docmd assistant - Offline AI Assistant for Documentation"
description: "AI assistant that reads your documentation and answers questions in context. Works with 100+ models, any website, and keeps your API keys secure."
titleAppend: false
noStyle: true
keywords:
- "documentation ai assistant"
- "docs chatbot"
- "ai for documentation"
- "docmd-assistant"
- "byok ai"
- "rag documentation"
- "self-hosted ai assistant"
components:
meta: true
favicon: true
scripts: false
css: false
theme: false
customHead: |
---
To configure multi-workspace routing, define a top-level workspaces array inside your docmd.config.json with prefix and src properties for each project site.
Architecture
How it works
A headless engine and a framework plugin, designed to work independently or together.
Headless, Use Anywhere
docmd-assistant is a standalone library with no UI opinions. Integrate it into React, Vue, Svelte, Node.js, or any JavaScript application.
DocmdAssistantEngine (ESM/CJS)
API Keys Stay on Your Server
Your AI provider credentials remain securely on the server. The browser client never holds, transmits, or exposes raw API keys.
KMS Envelope Encryption
Answers Grounded in Your Content
Before answering, the engine retrieves relevant passages from your documentation using docmd-search indices, so responses are accurate and context-aware.
RAG Search Index Binding
LLM Providers
Works with any AI provider
Connect to cloud providers directly or route securely through a relay. Run entirely offline with local models.
Provider
Supported Models
Connection Mode
Security Architecture
OpenAI
gpt-4o, gpt-4o-mini
Direct / Relay
Server-side KMS Envelope Encryption
Anthropic
claude-3-5-sonnet, haiku
Direct / Relay
Server-side KMS Envelope Encryption
Google Gemini
gemini-1.5-flash, pro
Direct / Relay
Server-side KMS Envelope Encryption
DeepSeek & Groq
deepseek-chat, llama-3.3
Direct / Relay
Server-side KMS Envelope Encryption
Ollama (Local)
llama3, mistral, qwen
Direct Offline
100% Local / Zero Cloud
Developer Integration
Integrate in a few lines of code
Create an engine instance, connect your search index, and start answering questions. Supports streaming, custom tools, and full conversation history.
import { DocmdAssistantEngine } from'docmd-assistant';
import * as Search from'@docmd/plugin-search/client';
// 1. Initialise engine instance with provider configurationconst engine = newDocmdAssistantEngine({
provider: 'openai',
model: 'gpt-4o-mini',
systemPrompt: 'You are a helpful software documentation assistant.',
ragCallback: async (query) => {
const matches = await Search.search(query, 5);
return matches.map(m => m.chunk.text).join('\\n\\n');
}
});
// 2. Register custom client-side execution tool
engine.registerTool({
name: 'fetch_user_workspace',
description: 'Retrieve active workspace configuration',
parameters: { type: 'object', properties: { workspaceId: { type: 'string' } } },
handler: async ({ workspaceId }) => ({ activeTheme: 'summer', mode: 'spa' })
});
// 3. Listen to real-time stream events and execute query turn
engine.on('token', (chunk) => process.stdout.write(chunk));
await engine.sendMessage('How do I set up custom navigation in docmd?');
Frequently asked questions
Common questions about docmd-assistant and the AI plugin.
How does it know the right answer?
Before querying the language model, the engine retrieves relevant passages from your documentation's search index and includes them in the prompt. This grounds every answer in your actual content.
Are my API keys safe?
Yes. API keys are decrypted and used only on the server side. The browser client never receives, stores, or transmits raw credentials.
Can it run completely offline?
Yes. By connecting to a local model provider like Ollama, the entire pipeline — search retrieval and AI response — runs on your own hardware with no external network requests.
Add an AI assistant to your docs
Open source, works with any documentation site. Set up in minutes.
Open source documentation compiler. One Markdown source, one command — generates website, search, AI context, agent protocols, and knowledge formats. All together.
$ npx @docmd/core dev
# Compiling markdown documentation...✓ Loaded 12 markdown files in /docs
✓ Generated static HTML + local vector index
✓ Built site in 340ms — Lighthouse score 100
→ Server running at http://localhost:3000
```markdown
---
title: Quick Start
description: Get your documentation live in 2 minutes.
---
# Getting Started
::: callout info
Zero config required. Just run `npx @docmd/core dev`!
:::
```
Why docmd
Everything works out of the box.
Search, SEO, themes, and AI tooling built in. Add only what you need.
Write Markdown, Get a Website
Point docmd at any folder of Markdown files. It builds a complete documentation site instantly — with navigation, hot-reloading, and zero configuration needed.
Expose your docs to AI coding assistants like Claude, Cursor, and Windsurf through a built-in MCP server and auto-generated context files.
docmd mcp — Ready for Claude & Cursor
Built-in Search, Zero Cloud Costs
Semantic and keyword search compiled at build time into local index files. Runs entirely in the browser — no cloud APIs, no hosting costs.
Press ⌘K to search docs
Rich Content from Plain Markdown
Write callouts, tabbed code blocks, warning boxes, cards, and diagrams using simple Markdown syntax. No HTML or JSX needed.
::: callout info Native Markdown callouts & tabs! :::
AI & Open Ecosystem
First-class AI tooling. No lock-in.
Expose your docs to AI agents, embed an AI assistant, and auto-generate context files — all using your own keys.
BYOK Security
Embedded AI Assistant
Add a documentation-aware AI assistant to your site. It reads your content, answers user questions in context, and supports 100+ language models with secure server-side key management.
plugin-ai: { provider: "byok" }
Model Context Protocol
MCP Server for AI Agents
Let AI coding tools like Claude, Cursor, and Windsurf search and read your documentation directly through the Model Context Protocol.
$ npx @docmd/plugin-mcp
Machine-Readable Context
Auto-Generated AI Context
Automatically generate llms.txt, llms-full.txt, and SKILL.md files so any large language model can read and understand your documentation.
✓ Exported /site/llms.txt
Modular Ecosystem
Modular plugin ecosystem
Each plugin works out of the box with zero configuration. Enable only what you need.
@docmd/plugin-search
Offline Vector Search
Semantic and keyword search that runs entirely in the browser.
@docmd/plugin-mcp
MCP Server
Let AI coding assistants search and read your docs directly.
@docmd/plugin-ai
AI Assistant
AI assistant that answers questions using your documentation as context.
@docmd/plugin-llms
AI Context Generator
Auto-generate llms.txt, llms-full.txt, and SKILL.md for AI tools.
@docmd/plugin-openapi
OpenAPI & Swagger Docs
Generate interactive API reference pages from OpenAPI spec files.
@docmd/plugin-seo
SEO & Schema JSON-LD
Sitemaps, meta tags, and structured data for search engine visibility.
@docmd/plugin-math
KaTeX Maths
Render LaTeX mathematical expressions with lightweight KaTeX.
@docmd/plugin-mermaid
Mermaid Diagrams
Flowcharts, sequence diagrams, and architecture maps from Markdown.
Performance Benchmark
Lightweight by design
No framework overhead. Pure static HTML output.
340 ms
Build Time
Full site compilation from Markdown to static HTML.
< 25 KB
Client Footprint
Total JavaScript shipped to the browser. No framework runtime.
0 MB
Framework Overhead
No React, Vue, or any framework dependency in your output.
Deployment
Deploy anywhere in seconds
Static HTML files that run on any hosting platform. No server runtime needed.
GitHub Pages Template
Create a pre-configured documentation repository with automated GitHub Actions in one click.
docmd is an open-source documentation compiler. You give it a folder of Markdown files, run one command, and it produces a website, search index, AI context, and knowledge formats — all together, no configuration needed.
How is docmd different from Docusaurus, MkDocs, or VitePress?
docmd requires no configuration, no React, no Vue, and no framework knowledge. One command produces 8 outputs — website, search index, llms.txt, OKF bundles, sitemap, SEO meta, MCP server, and Cloud Relay. No other tool does this.
Do I need React or any front-end framework?
No. docmd is entirely framework-free. You write Markdown, run one command, and get a production-ready website. The output is plain HTML with minimal vanilla JavaScript.
How does AI agent integration work?
docmd includes a built-in MCP server that lets AI coding tools like Claude, Cursor, and Windsurf search and read your documentation directly. It also auto-generates llms.txt and SKILL.md files so any language model can understand your docs.
What are Agent Skills (SKILL.md) and how do I install them?
Agent Skills are instruction files that AI coding assistants (Claude, Cursor, Windsurf) can read to understand how to work with your project. Install official docmd skills into your workspace with:
npx docmd-skills [target-directory]
Start building in minutes
Open source, MIT licensed. One command to your first documentation site.
---
## [Privacy Policy](https://docmd.io/privacy/)
---
title: "Privacy Policy"
description: "Privacy Policy outlining data handling, zero-telemetry defaults, KMS key encryption, and user rights for docmd and docmd cloud."
titleAppend: true
noStyle: true
keywords:
- "privacy policy"
- "data privacy"
- "docmd cloud privacy"
- "kms encryption"
components:
meta: true
favicon: true
scripts: false
css: false
theme: false
customHead: |
---
Privacy Policy
Last updated: July 28, 2026
1. Zero Telemetry in Core Tools
The open-source docmd CLI engine (`@docmd/core`) operates with strict zero telemetry by default. We do not track, collect, or transmit your local file structures, command usage, build metrics, or documentation content.
2. docmd cloud & Account Authentication
When you register for a docmd cloud dashboard account via OAuth, we collect minimal profile metadata necessary to maintain your session:
Account ID, Name, and Email address provided by your chosen identity provider.
Session tokens stored securely in HTTP-only browser cookies.
3. BYOK Key Encryption & Relay Security
When you configure Bring Your Own Key (BYOK) AI provider keys in your docmd cloud dashboard:
Keys are encrypted client-side and stored in cloud data stores encrypted at rest with envelope encryption and hardware security module (HSM) key management systems.
Relay requests decrypt keys temporarily in serverless memory solely for forwarding authorized API calls to your configured model endpoints.
We never log, store, or sell your API keys or completion prompts.
4. Analytics & Web Privacy
On docmd.io static marketing pages, we utilize standard website analytics with IP anonymization enabled to aggregate page view metrics and optimize site navigation. No personal data or search queries are stored or shared.
5. Your Rights & Data Deletion
You have the right to request full deletion of your registered docmd cloud account, registered site origins, and encrypted API key records at any time by deleting your site configurations directly in the dashboard or by contacting support.
---
## [docmd search - Offline Semantic Search for Documentation](https://docmd.io/search/)
---
title: "docmd search - Offline Semantic Search for Documentation"
description: "Offline semantic search for any documentation site. Understands meaning, runs entirely in the browser, and never sends data to the cloud."
titleAppend: false
noStyle: true
keywords:
- "offline search"
- "semantic search"
- "documentation search"
- "browser search engine"
- "docmd-search"
- "private search"
- "vector search docs"
components:
meta: true
favicon: true
scripts: false
css: false
theme: false
customHead: |
---
Local Vector Engine100% PrivateQuantized IndexZero Cloud Costs
docmd-search sandbox
authentication
User Authentication & Sessions
/getting-started/security
98% match
Configure how your application handles user login, secure cookies, token generation, and stateless session verification.
Configuring Custom Secure Routes
/configuration/routing
89% match
Define private directories and redirect configurations for unauthenticated guest sessions trying to access signin paths.
Architecture
How it works
Smart search for static documentation, with no servers or third-party services required.
Runs Locally in the Browser
Uses lightweight AI models that execute directly in the browser. No data ever leaves your users' devices.
ONNX Wasm Runtime — 100% Offline
Understands What You Mean
Goes beyond exact keyword matching. Searching for 'authentication' also finds results about 'sign-in', 'login', and 'sessions'.
Cosine Similarity Matching
Hybrid Keyword + Semantic
Combines fast keyword matching with meaning-aware similarity scoring for the most relevant results, instantly.
BM25 + Cosine Re-ranker
Embeddings
Choose your search model
Pick the model that fits your documentation size and language requirements.
Model
Dimensions
Size
Languages
Best For
MiniLM L6 v2 ★
384
~23 MB
English only
Fast, general English docs
Multilingual MiniLM L12
384
~118 MB
50+ languages
i18n documentation
Multilingual E5 Small
384
~118 MB
100+ languages
Wide language coverage
Multilingual MPNet Base
768
~270 MB
50+ languages
Best multilingual quality
💡 Multilingual documentation: If your documentation website contains multiple languages (such as English, Chinese, German, Spanish, etc.), select a multilingual model using docmd-search --settings. The default model is English-only and will produce poor search relevance for other languages.
Developer API
Use it anywhere: the client API
A lightweight client runtime (under 5 KB) that runs entirely in the browser. Build custom search UIs for any website or application.
import * as Search from'@docmd/plugin-search/client';
// 1. Initialise and load index folder.
// Batch 0 is loaded instantly for sub-millisecond search startup,
// while remaining chunk batches load progressively in background.await Search.load('/.docmd-search', (loaded, total) => {
console.log(`Loaded batch ${loaded}/${total}`);
});
// 2. Query search using hybrid vector + keyword matching.const results = Search.search('authentication secure routes', 10);
results.forEach(({ score, chunk }) => {
console.log(`[${(score * 100).toFixed(0)}%] ${chunk.file}#${chunk.heading || ''}`);
console.log(chunk.text);
});
Frequently asked questions
Common questions about docmd-search and offline semantic search.
Does it run entirely in the browser?
Yes. All search happens directly in your users' browsers. No cloud infrastructure, no search API, and no data ever leaves the device.
No. The AI models are only used at build time on your machine to generate pre-computed search indices. Users' browsers only download the resulting index files — small, compressed JSON chunks.
Yes. For multilingual documentation, choose a multilingual model such as paraphrase-multilingual-MiniLM-L12-v2, which supports over 50 languages. The default model is English-only.
When enabled, the showConfidence setting displays a percentage badge next to each search result showing how closely it matches the query. This helps users quickly judge which results are most relevant.
---
## [Terms of Service](https://docmd.io/terms/)
---
title: "Terms of Service"
description: "Terms and conditions governing the use of docmd open-source tools, docmd cloud relay, and associated documentation services."
titleAppend: true
noStyle: true
keywords:
- "terms of service"
- "legal"
- "docmd cloud terms"
- "license"
components:
meta: true
favicon: true
scripts: false
css: false
theme: false
customHead: |
---
Terms of Service
Last updated: July 28, 2026
1. Acceptance of Terms
By accessing or using docmd open-source software, docmd cloud relay infrastructure, or associated websites (collectively, "Services"), you agree to be bound by these Terms of Service. If you do not agree to these terms, please do not use our Services.
2. Open Source Software & License
The core docmd static site generator (`@docmd/core`) and official plugins are distributed under the open-source MIT License. You are free to use, modify, and distribute the software in accordance with the terms of the MIT License.
3. docmd cloud Relay & BYOK Security
docmd cloud operates a Bring Your Own Key (BYOK) relay for documentation AI assistants:
API Key Confidentiality: All user-provided AI provider API keys are encrypted at rest using dedicated hardware security modules (HSM) and envelope key encryption.
Stateless Proxying: Request payloads proxied through docmd cloud are processed strictly in-memory within isolated serverless runtime environments and are never written to persistent disk storage.
User Responsibility: You are responsible for maintaining and configuring appropriate spending limits and access controls with your chosen AI key provider.
4. Acceptable Use Policy
You agree not to use docmd cloud or docmd tools to:
Engage in unlawful activities or unauthorized access to external network services.
Proxy abusive, malicious, or illegal content through docmd cloud AI relay endpoints.
5. Limitation of Liability
THE SERVICES ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. IN NO EVENT SHALL THE AUTHORS, MAINTAINERS, OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OF THE SERVICES.
6. Modifications to Terms
We reserve the right to modify or replace these Terms at any time. Changes will be posted to this page with an updated revision date.
7. Contact Information
If you have any questions regarding these Terms, please reach out via GitHub Discussions.