Universal UI-agnostic AI Assistant engine for documentation tools, web applications, and developer platforms. Powered by the aiplug multi-provider runtime, docmd-assistant manages message history, tool execution, and provider connections without forcing a specific user interface or cloud backend.
docmd-assistant contains no rendering code or UI components. It runs conversation logic, tool calls, and event emissions, leaving UI rendering to your web framework or component library.
Key Features
Connect directly to AI providers including OpenAI, Anthropic, Gemini, DeepSeek, Groq, MiniMax, and Ollama, or route requests through custom HTTP gateways.
Define client-side and server-side tools using JSON Schema parameter definitions. The engine executes tool handlers automatically when requested by the model.
Runs anywhere JavaScript or TypeScript executes: React, Vue, Svelte, Angular, Vanilla JS, Node.js services, and desktop apps.
Operate in Direct Mode using local provider API keys, or Relay Mode by routing requests through a secure Cloud Relay API.
Overview
Application Layer (React, Vue, Svelte, CLI, Custom UI)
│
│ sendMessage("How do I setup search?")
▼
┌─────────────────────────────────────────────────────────┐
│ DocmdAssistantEngine │
│ │
│ History Manager • System Prompt • Tool Registry│
│ │
│ Turn Execution & Event Emitter │
└──────────────────────────┬──────────────────────────────┘
│
┌─────────────┴─────────────┐
▼ ▼
Direct Mode (aiplug) Relay Mode (HTTP)
┌──────────────────────┐ ┌───────────────────┐
│ OpenAI, Anthropic, │ │ Cloud Relay API │
│ Gemini, Ollama, etc. │ │ /v1/ai/chat │
└──────────────────────┘ └───────────────────┘
Quick Start
import { DocmdAssistantEngine } from 'docmd-assistant';
// Initialise assistant engine with direct provider API key
const assistant = new DocmdAssistantEngine({
provider: 'openai',
model: 'gpt-4o-mini',
apiKey: process.env.OPENAI_API_KEY,
systemPrompt: 'You are an expert technical guide for this documentation site.'
});
const res = await assistant.sendMessage('How do I install dependencies?');
console.log(res.message);
import { DocmdAssistantEngine } from 'docmd-assistant';
// Initialise assistant engine using Cloud Relay endpoint
const assistant = new DocmdAssistantEngine({
relayUrl: 'https://api.docmd.io/v1/ai/chat',
projectId: 'prj_my_docs_site'
});
const res = await assistant.sendMessage('What is the default port?');
console.log(res.message);
Ecosystem Integration
docmd-assistant functions as a standalone library and powers conversational AI across the docmd ecosystem:
| Package | Role in Ecosystem |
|---|---|
docmd-assistant |
Universal headless AI engine and tool execution runtime |
@docmd/plugin-ai |
Official docmd plugin providing embedded chat UI drawers and documentation search integration |
docmd-search |
Offline semantic search engine providing local indexing for documentation sites |
Documentation Index
| Page | Description |
|---|---|
| Getting Started | Installation, setup, and first conversation turn |
| Engine Architecture | Turn execution pipeline, context assembly, and event bus |
| Configuration | Initialisation parameters, runtime updates, and system prompts |
| Tool System | Creating custom tools, standard tools, and page readers |
| Programmatic API | DocmdAssistantEngine class reference and type definitions |