High-Performance Markdown Database
Version-controlled, embedded database with vector search, full-text search, GraphQL, webhooks, TTL, and triple protocol support
docker run -p 11023:11023 tradik/mddb:latest
Why MDDB? #
High Performance
Optimized for speed with embedded BoltDB, binary protocol support, and advanced caching strategies
Version Control
Full revision history for every document with complete content snapshots
Triple Protocol
HTTP/JSON REST for easy debugging, gRPC/Protobuf for high performance, GraphQL for flexible queries
MCP Integration
Model Context Protocol server for seamless LLM integration (Windsurf, Claude Desktop)
Multi-Language
Store documents in multiple languages with the same key
Vector Search
Semantic similarity with multiple algorithms: Flat, HNSW, IVF, PQ (OpenAI, Ollama, Voyage AI)
Full-Text Search
Built-in inverted index with TF-IDF and BM25 scoring, typo tolerance
Webhooks
HTTP callbacks on document events with exponential backoff retry
Document TTL
Auto-expiring documents with background cleanup, like Redis
Import from URL
Fetch markdown from any URL with frontmatter parsing
Zero Config
Single binary, embedded database, no external dependencies
Docker Ready
~15MB Alpine-based image with health checks
ACID Transactions
Guaranteed data consistency with BoltDB transactions
Custom MCP Tools
Define website-specific AI tools in YAML with preconfigured defaults
Authentication & RBAC
JWT tokens, API keys, per-collection permissions (opt-in)
Replication
Leader-follower replication with binlog streaming for horizontal read scaling
🎨 Web Admin Panel
Modern React-based UI for managing documents, users, and search with REST/GraphQL API toggle
Quick Start #
# Run MDDB server
docker run -d \
-p 11023:11023 \
-p 11024:11024 \
-v mddb-data:/data \
tradik/mddb:latest
# Test the API
curl http://localhost:11023/health
# Clone repository
git clone https://github.com/tradik/mddb.git
cd mddb
# Start all services (MDDB + Panel + MCP)
make docker-up
# Services available:
# - MDDB HTTP: http://localhost:11023
# - MDDB gRPC: localhost:11024
# - Web Panel: http://localhost:3000
# - MCP Server: http://localhost:9000
# Download binary
wget https://github.com/tradik/mddb/releases/download/v2.5.4/mddbd-linux-amd64
chmod +x mddbd-linux-amd64
# Run server
./mddbd-linux-amd64
# Server starts on http://localhost:11023
# Clone repository
git clone https://github.com/tradik/mddb.git
cd mddb
# Build
make build
# Run
./bin/mddbd
Download #
Latest Release
Released: March 3, 2026
Docker Image
Alpine-based (~15MB)
docker pull tradik/mddb:latest
docker pull tradik/mddb:2.3.3
View on Docker Hub
What's New in v2.5.4
- 📄 Pagination - Offset-based pagination with X-Total-Count header for metadata search
- 🎨 Panel UI Overhaul - Resizable/collapsible sidebar, result counts, pagination controls
- 🔧 MCP Config Fix - Fixed MCP Configuration panel showing HTML instead of YAML in production
- 📊 Vector Stats Fix - Fixed embedding stats always showing zero in sidebar
- 🔒 Conditional UI - Users & Groups hidden in sidebar when auth is disabled
- 🔍 API Endpoints - Added embedding config and conditional GraphQL endpoints to endpoints list
- 🧠 Vector Search UX - Auto-retry on 503 during index loading with friendly progress indicator
Documentation #
Quick Start
Get up and running in 5 minutes
API Documentation
Interactive Swagger UI
InteractiveOpenAPI Spec
Machine-readable API specification
Health Checks
Docker & Kubernetes monitoring
gRPC Guide
High-performance protocol
Examples
Code examples and patterns
Docker Guide
Container deployment
Architecture
System design and internals
RAG Pipeline
WordPress → MDDB → LLM guide
NewSchema Validation
Enforce metadata structure per collection
Telemetry & Monitoring
Prometheus metrics, Grafana dashboards
NewWordPress AI Agent
Build a chatbot for your WP site
NewMCP Server
LLM integration for Windsurf & Claude
NewCustom MCP Tools
YAML-defined website-specific AI tools
NewAuthentication & RBAC
JWT tokens, API keys, role-based access control
NewAuth Quick Start
5-minute authentication setup guide
Replication Guide
Leader-follower setup, Docker Compose, monitoring
NewSearch Algorithms
TF-IDF, BM25, Flat, HNSW, IVF, PQ comparison
NewCode Examples #
# Add document with TTL (expires in 1 hour)
curl -X POST http://localhost:11023/v1/add \
-H "Content-Type: application/json" \
-d '{
"collection": "blog",
"key": "hello-world",
"lang": "en_US",
"ttl": 3600,
"meta": {
"category": ["tutorial"],
"author": ["John Doe"]
},
"contentMd": "# Hello World\n\nWelcome to MDDB!"
}'
# Import directly from URL
curl -X POST http://localhost:11023/v1/import-url \
-d '{"collection":"docs", "url":"https://example.com/guide.md", "lang":"en_US"}'
# Semantic search - flat (exact, default)
curl -X POST http://localhost:11023/v1/vector-search \
-H "Content-Type: application/json" \
-d '{
"collection": "kb",
"query": "how do I cancel my subscription?",
"topK": 5,
"threshold": 0.7,
"includeContent": true
}'
# HNSW - fast approximate nearest neighbor
curl -X POST http://localhost:11023/v1/vector-search \
-d '{"collection":"kb", "query":"refund", "topK":5, "algorithm":"hnsw"}'
# IVF - clustered search for large collections
curl -X POST http://localhost:11023/v1/vector-search \
-d '{"collection":"kb", "query":"refund", "topK":5, "algorithm":"ivf"}'
# PQ - compressed, memory-efficient search
curl -X POST http://localhost:11023/v1/vector-search \
-d '{"collection":"kb", "query":"refund", "topK":5, "algorithm":"pq"}'
# Full-text search with TF-IDF (default)
curl -X POST http://localhost:11023/v1/fts \
-H "Content-Type: application/json" \
-d '{
"collection": "blog",
"query": "markdown database tutorial",
"limit": 10
}'
# Full-text search with BM25 scoring
curl -X POST http://localhost:11023/v1/fts \
-H "Content-Type: application/json" \
-d '{
"collection": "blog",
"query": "markdown database tutorial",
"limit": 10,
"algorithm": "bm25"
}'
# Register webhook for document changes
curl -X POST http://localhost:11023/v1/webhooks \
-d '{"url":"https://your-app.com/hook", "events":["doc.added","doc.updated"]}'
# Set TTL on existing document (0 = remove)
curl -X POST http://localhost:11023/v1/set-ttl \
-d '{"collection":"cache", "key":"temp", "lang":"en", "ttl":7200}'
curl -X POST http://localhost:11023/v1/search \
-H "Content-Type: application/json" \
-d '{
"collection": "blog",
"filterMeta": {
"category": ["tutorial"],
"status": ["published"]
},
"sort": "updatedAt",
"limit": 10
}'
from mddb import MDDB
db = MDDB.connect('localhost:11023', 'write').collection('kb')
# Add document
db.add('faq', 'en_US', {'category': ['billing']}, '# Billing FAQ\n\nCancel in Settings.')
# Vector search (RAG pipeline step 1)
results = db.vector_search('how to cancel?', top_k=3, include_content=True)
# Full-text search
results = db.fts_search('billing refund', limit=10)
# Webhooks
db.register_webhook('https://app.com/hook', ['doc.added'], 'kb')
# Import from URL
db.import_url('https://example.com/docs.md', 'en_US')
# TTL
db.set_ttl('temp-key', 'en', 3600) # expires in 1h
<?php
require_once 'mddb.php';
$db = mddb::connect('localhost:11023', 'write');
// Add document
$db->collection('blog')->add('hello', 'en_US', ['category' => ['tutorial']], '# Hello');
// Vector search
$results = $db->collection('kb')->vectorSearch('cancel subscription', 5, 0.7, true);
// Full-text search
$results = $db->collection('blog')->ftsSearch('database tutorial', 10);
// Webhooks
$db->registerWebhook('https://app.com/hook', ['doc.added', 'doc.updated']);
// Import from URL
$db->collection('docs')->importUrl('https://example.com/post.md', 'en_US');
// TTL
$db->collection('cache')->setTtl('temp', 'en', 3600);
# Docker (Easiest) - for Windsurf / Claude Desktop
# Configure ~/.windsurf/mcp.json:
{
"mcpServers": {
"mddb": {
"command": "docker",
"args": [
"run", "-i", "--rm", "--network", "host",
"-e", "MDDB_GRPC_ADDRESS=localhost:11024",
"-e", "MDDB_REST_BASE_URL=http://localhost:11023",
"tradik/mddb:mcp-2.3.3"
]
}
}
}
# MCP provides 20+ tools including:
# - add_document, get_document, search, delete
# - vector_search, full_text_search
# - import_url, set_ttl
# - register_webhook, list_webhooks, delete_webhook
# - export, backup, restore, stats
Use Cases #
🤖 RAG / AI Pipelines
Semantic vector search + LLM integration via MCP. Build knowledge bases for AI assistants
📝 Content Management
Blogs, docs, and knowledge bases with version control, webhooks, and TTL
🔔 Event-Driven Apps
Webhooks trigger HTTP callbacks on doc changes for real-time sync and notifications
🌐 Multi-language Sites
Store and manage content in multiple languages with the same document key
⏱️ Cache / Temporary Data
Document TTL with auto-expiry for session data, cache layers, and temporary content
📚 Documentation Platforms
Import from URLs, full-text search, revision history, and rich metadata
🔄 Leader-Follower Replication #
Scale reads horizontally with binlog-based streaming replication. A single leader handles writes and streams transactions in real-time to read-only followers via gRPC.
graph LR
C[Clients] -->|Writes/Reads| L[Leader]
C -->|Reads| F1[Follower 1]
C -->|Reads| F2[Follower 2]
L -->|gRPC binlog stream| F1
L -->|gRPC binlog stream| F2