| name | md-docs-search |
| description | Full-text search across structured Markdown documentation archives using SQLite FTS5. Use when you need to search large collections of Markdown articles that are separated by "---" delimiters and contain source URLs (marked with "*Source:" pattern). Provides fast BM25-ranked search with automatic source URL extraction for citations. Ideal for research, documentation lookups, and knowledge base exploration. Requires indexing documentation first with `docs.py index`. |
Markdown Documentation Full-Text Search
Fast, indexed full-text search across Markdown documentation archives using SQLite FTS5 with BM25 relevance ranking.
When to Use
- Searching documentation archives for specific features, capabilities, or information
- Finding official source URLs to cite in reports
- Looking up technical specifications or configuration details
- Research across multiple documentation sources
Document Format Expected
Articles separated by --- delimiter with *Source: URL:
# Article Title
*Source: https://docs.example.com/path/to/article.html*
Article content here...
---
# Next Article Title
*Source: https://docs.example.com/another/article.html*
More content...
Quick Start
scripts/docs.py index ./docs
scripts/docs.py search "kubernetes backup" --max 5
scripts/docs.py status
Primary Tool: docs.py
The unified CLI handles all operations:
Indexing
scripts/docs.py index ./docs
scripts/docs.py index ./docs --rebuild
scripts/docs.py index ./docs --db /path/to/custom.db
Searching
scripts/docs.py search "kubernetes backup"
scripts/docs.py search "AWS AND S3 AND snapshot"
scripts/docs.py search '"exact phrase match"'
scripts/docs.py search "kube*"
scripts/docs.py search "backup NOT restore"
scripts/docs.py search "kubernetes" --title-only
scripts/docs.py search "kubernetes" --format json
scripts/docs.py search "kubernetes" --format markdown
scripts/docs.py search "kubernetes" --context 400
scripts/docs.py search "kubernetes" --format json --full-content
FTS5 Query Syntax
| Syntax | Meaning |
|---|
term1 term2 | Documents with term1 OR term2 (ranked) |
term1 AND term2 | Documents with both terms |
term1 OR term2 | Documents with either term |
"exact phrase" | Exact phrase match |
prefix* | Words starting with prefix |
term1 NOT term2 | term1 without term2 |
title:term | Search only titles |
Getting Specific Articles
scripts/docs.py get "system_requirements" --full
scripts/docs.py get "backup" --all
Status
scripts/docs.py status
Workflow for Research Tasks
Discovery Phase
scripts/docs.py status
scripts/docs.py search "<feature>" --max 20
Research Phase
scripts/docs.py search "<feature> AND <platform>"
scripts/docs.py search "limitation OR restriction OR 'not supported'"
Citation Phase
Every search result includes the Source: URL โ use this in your reports:
According to documentation, [finding]...
Source: https://docs.example.com/path/to/article.html
Multi-Source Setup
Each agent or project can have their own documentation and index:
~/docs/VendorA/
โโโ docs_part_01.md
โโโ docs.db # Index lives with docs
โโโ ...
~/docs/VendorB/
โโโ docs.md
โโโ docs.db
โโโ ...
The docs.py script auto-detects the database location.
Advanced Scripts
For specialized needs:
scripts/fts_search.py โ Direct FTS5 search with more options
scripts/index_docs.py โ Standalone indexing
scripts/list_sources.py โ List all source URLs
scripts/get_article.py โ Direct article retrieval
scripts/search_docs.py โ Regex-based search (no index needed)
Research Patterns
For common search patterns (feature research, architecture, security, etc.), see references/search-patterns.md.
Example Session
scripts/docs.py status
scripts/docs.py search "kubernetes backup" --max 5
scripts/docs.py search "kubernetes AND AWS" --max 5
scripts/docs.py search "limitation OR 'not supported'"
scripts/docs.py get "system_requirements" --full
Best Practices
- Index once, search many times โ FTS5 is fast because it's indexed
- Use boolean operators โ
AND, OR, NOT for precision
- Phrase search for exact terms โ
"exact match" with quotes
- Always cite sources โ Include
Source: URLs in reports
- Rebuild periodically โ Re-index when documentation updates
- Use JSON for analysis โ Pipe to
jq or other tools for processing