Skip to content
doc-serve logo

Doc-Serve Skill

doc-serve

Advanced document search with BM25 keyword matching, semantic vector search, and hybrid retrieval. Enables precise technical queries, conceptual understanding, and intelligent result fusion. Supports local document indexing and provides comprehensive search capabilities for knowledge bases.

SKILL.md

Full skill instructions

Doc-Serve Skill

Overview

doc-serve provides advanced document search capabilities with three powerful search modes: BM25 keyword search, semantic vector search, and intelligent hybrid retrieval. It indexes local documentation (Markdown, PDF, TXT) and enables precise technical queries, conceptual understanding, and comprehensive knowledge discovery.

Capabilities

  1. Multi-Mode Search: BM25 (keyword), Vector (semantic), Hybrid (fusion)
  2. Automatic Setup: Repository cloning and CLI tool installation
  3. Server Management: Start/​stop API server with health monitoring
  4. Smart Indexing: Document processing with chunking and embeddings
  5. Advanced Retrieval: Context-aware search with scoring transparency
  6. API Integration: RESTful endpoints with OpenAPI documentation

When to Use

  • Technical queries: "Find AuthenticationError handling"
  • Conceptual questions: "How does OAuth authentication work?"
  • Comprehensive search: "Complete guide to error handling"
  • Domain knowledge: Search internal documentation and knowledge bases
  • API references: Find function definitions, error codes, specifications

Core Workflow

1. Setup Verification

doc-svr-ctl --version  # Check CLI tools installed

2. Server Management

doc-serve &            # Start server in background
doc-svr-ctl status     # Verify server health

3. Document Indexing

doc-svr-ctl index /​path/​to/​docs  # Index documentation

4. Intelligent Search

# Choose search mode based on query type
doc-svr-ctl query "exact function name" --mode bm25      # Technical terms
doc-svr-ctl query "how concept works" --mode vector      # Explanations
doc-svr-ctl query "complete solution" --mode hybrid      # Best of both

Search Mode Selection Guide

Query TypeRecommended ModeExample
Technical termsBM25"AuthenticationError"
Function namesBM25"recursiveCharacterTextSplitter"
Error codesBM25"HTTP 404"
ExplanationsVector"how authentication works"
ConceptsVector"best practices guide"
Mixed contentHybrid"implement OAuth with error handling"
ComprehensiveHybrid"complete troubleshooting guide"

Best Practices

  • Mode Selection: Use BM25 for technical terms, Vector for concepts, Hybrid for comprehensive results
  • Threshold Tuning: Start at 0.7, lower to 0.3-0.5 for more results
  • Alpha Weighting: Adjust hybrid balance (0.0=BM25, 1.0=Vector)
  • Source Citation: Always reference source filenames in responses
  • Background Operation: Run server with doc-serve & for interactive use

Reference Documentation

Search Mode Guides

Troubleshooting

API Documentation

Example Usage Scenarios

Technical Query (BM25 Mode)

User: "What does the documentation say about AuthenticationError?"

Execution:

doc-svr-ctl query "AuthenticationError" --mode bm25 --threshold 0.2

Response: "According to auth_module.md, AuthenticationError is raised when credentials are invalid, with fields for username, timestamp, and failure reason."

Conceptual Query (Vector Mode)

User: "How does the authentication system work?"

Execution:

doc-svr-ctl query "authentication system flow" --mode vector --threshold 0.5

Response: "The authentication system uses a multi-step flow: credential validation, token generation with JWT, session management via Redis, and automatic logout after 30 minutes (from auth_overview.md)."

Comprehensive Query (Hybrid Mode)

User: "Complete guide to implementing error handling"

Execution:

doc-svr-ctl query "error handling implementation guide" --mode hybrid --alpha 0.6 --top-k 8

Response: "Complete error handling implementation: 1) Exception hierarchy design, 2) Try-catch patterns, 3) Error logging with structured data, 4) User-friendly error messages, 5) Recovery strategies (from error_handling.md and logging_guide.md)."

Performance Characteristics

ModeSpeedAPI RequiredBest For
BM25⚡ 10-50ms❌ NoTechnical terms, exact matches
Vector🐌 800-1500ms✅ YesConcepts, explanations
Hybrid🐌 1000-1800ms✅ YesComprehensive, best quality

Configuration Requirements

API Keys (for Vector/​Hybrid modes)

# Required for semantic search
export OPENAI_API_KEY="sk-proj-..."
export ANTHROPIC_API_KEY="sk-ant-..."  # Optional

Environment Setup

# Install tools
task install:global

# Configure API keys in .env file
cd doc-serve-server
echo "OPENAI_API_KEY=your-key-here" > .env

Advanced Features

  • Alpha Weighting: Fine-tune hybrid search balance
  • Scoring Transparency: Individual vector/​BM25 scores with --scores
  • JSON Output: Structured data with --json for scripting
  • Batch Processing: Efficient indexing of large document collections
  • Health Monitoring: Server status and indexing progress tracking

Integration Patterns

CLI Scripting

# Automated searches in scripts
RESULT=$(doc-svr-ctl query "$QUERY" --mode hybrid --json)
echo "$RESULT" | jq '.results[0].text'

API Integration

import requests

response = requests.post('http://localhost:8000/​query/', json={
    'query': 'authentication guide',
    'mode': 'hybrid',
    'alpha': 0.5
})
results = response.json()['results']

CI/​CD Integration

# Documentation validation in CI
doc-svr-ctl query "deprecated feature" --mode bm25 --threshold 0.1
if [ $? -eq 0 ]; then echo "Documentation search working"; fi

Limitations & Considerations

  • API Costs: Vector/​hybrid modes require OpenAI API credits
  • Setup Complexity: Initial configuration requires API keys and indexing
  • Resource Usage: Server requires ~500MB RAM for typical document collections
  • File Formats: Supports Markdown, PDF, plain text (not Word docs or images)

Getting Started Checklist

  • Install CLI tools: task install:global
  • Set API keys in environment or .env file
  • Start server: doc-serve &
  • Index documents: doc-svr-ctl index /​path/​to/​docs
  • Test search: doc-svr-ctl query "test query"
  • Explore modes: Try BM25, vector, and hybrid search

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View