Plugin System
OpenDocuments uses a modular plugin system with 4 plugin types:
| Type | Purpose | Example |
|---|---|---|
| Parser | Transform documents into chunks | PDF, DOCX, HTML, Code |
| Connector | Sync from external sources | GitHub, Notion, Google Drive |
| Model | LLM generation & embeddings | Ollama, OpenAI, Anthropic |
| Middleware | Hook into processing pipeline | Custom filters, transforms |
Quick Start
bash
# Create a new plugin
opendocuments plugin create my-parser --type parser
# Develop
cd plugins/my-parser
npm run dev
# Test
npm run test
# Publish
opendocuments plugin publishPlugin Commands
| Command | Description |
|---|---|
plugin create <name> --type <type> | Scaffold a new plugin |
plugin list | Show installed plugins with health status |
plugin test | Run plugin tests |
plugin dev | Watch mode for development |
plugin publish | Publish to npm |
Naming Convention
- Official:
@opendocuments/parser-*,@opendocuments/connector-* - Community:
opendocuments-parser-*,opendocuments-connector-*
Learning Path
- Start with the Parser API - simplest plugin type
- Study
parser-html(150 lines) as a reference - Try the Connector API for external integrations
- See Model API for custom AI providers