# 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: | ---
docmd-assistant v0.1.0 is now available →

AI assistant grounded in your docs.
Any LLM provider. Your keys never leave your server.

Reads your documentation, answers questions in context. Works with 100+ models, any website, and keeps your API keys secure.

Get Started
Headless Core Engine Server-Side BYOK Search-Aware RAG 100+ AI Models
docmd-assistant runtime demo
docmd assistant response
RAG Context: /configuration/workspaces & docmd.config.json
OpenAI gpt-4o-mini
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.

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

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

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 configuration
const engine = new DocmdAssistantEngine({
  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.

--- ## [docmd - Documentation for Humans and Machines](https://docmd.io/) --- title: "docmd - Documentation for Humans and Machines" description: "Open-source documentation compiler. One Markdown source, one command - generates website, search, AI context, agent protocols, and knowledge formats together." titleAppend: false noStyle: true keywords: - "documentation compiler" - "markdown to html" - "static site generator" - "open source docs" - "docmd" - "documentation engine" - "markdown documentation tool" - "zero config docs" components: meta: true favicon: true scripts: false css: false theme: false seo: ldJson: "@context": "https://schema.org" "@type": "SoftwareApplication" name: "docmd" operatingSystem: "Any" applicationCategory: "DeveloperApplication" url: "https://docmd.io" description: "docmd is an open-source documentation compiler. One Markdown source, one command — generates website, search index, AI context, MCP agent endpoints, and knowledge formats together." creator: "@type": "Person" name: "Ghazi" sameAs: - "https://github.com/mgks" - "https://mgks.dev" codeRepository: "https://github.com/docmd-io/docmd" releaseNotes: "https://github.com/docmd-io/docmd/releases" programmingLanguage: "Node.js" installUrl: "https://www.npmjs.com/package/@docmd/core" customHead: | ---

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.

$ docmd build --offline
✓ Generated 12 pages in 340ms (Lighthouse 100)

Native AI Agent Support

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!
:::

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 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.

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.

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.

Use GitHub Template →

Docker & Nginx Config

Generate a Dockerfile and Nginx configuration for your documentation site in one command.

$ docmd deploy --docker

Write documentation with your favourite AI

Provide docmd context directly to Claude, ChatGPT, Gemini, or DeepSeek.

Frequently asked questions

Everything you need to know about docmd.

What is docmd?
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.

Community Sponsors

--- ## [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: | --- --- ## [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: | ---
docmd-search v0.1.1 is now available →

Search that understands meaning.
Runs in the browser. Completely private.

Offline semantic search for any documentation site. Understands meaning, runs entirely in the browser, and never sends data to the cloud.

Get Started
Local Vector Engine 100% Private Quantized Index Zero Cloud Costs
docmd-search sandbox
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.

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

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.

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.

Read the full documentation →
Do users need to download AI models?
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.

Learn how offline search works →
Does it work with multiple languages?
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.

Configure multilingual search →
What is the confidence score badge?
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.

Read about browser client settings →

Add smart search to your docs

Open source, works with any documentation site. One install, zero cloud bills.

--- ## [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: | --- ---