Skip to content

Improved Document Indexing/ Search#149

Merged
MarcSkovMadsen merged 5 commits into
mainfrom
enhancement/panic-handling
Feb 22, 2026
Merged

Improved Document Indexing/ Search#149
MarcSkovMadsen merged 5 commits into
mainfrom
enhancement/panic-handling

Conversation

@MarcSkovMadsen

@MarcSkovMadsen MarcSkovMadsen commented Feb 20, 2026

Copy link
Copy Markdown
Owner

Summary

Major overhaul of the HoloViz MCP server

Documentation Indexing/ Search (holoviz_mcp/data.py)

Complete rewrite of the documentation indexing pipeline:

  • Document chunking: Heading-aware splitting that preserves section context, with configurable max chunk size and heading hierarchy tracking
  • Search content modes: chunk (best-matching snippet), truncated (smart-truncated around query keywords), and full (complete document) — lets callers trade off speed vs completeness
  • 3-tier hybrid search: Semantic (ChromaDB embedding) + keyword (metadata field matching) + PascalCase stem boost for component names like TextInput or FlexBox
  • Panic handling: Graceful error recovery throughout the indexing pipeline — bad notebooks, missing files, corrupt metadata, and ChromaDB failures no longer crash the full index run
  • Parallel extraction: ThreadPoolExecutor + asyncio.gather() for concurrent repo clone + document extraction across all repositories (thread-local MarkdownExporter for nbconvert safety)
  • Incremental indexing: SHA-256 file hash sidecar (index_hashes.json) enables skipping unchanged files before expensive content extraction. Re-running update index with no changes completes in ~6s (down from ~54s for a single project, ~6min for all)
  • Per-project scoping: holoviz-mcp update index --project panel only processes the specified repo(s); --full forces a complete rebuild ignoring cached hashes
  • Orphan cleanup: When a document changes and produces fewer chunks, stale chunks are automatically deleted from ChromaDB

Copilot AI review requested due to automatic review settings February 20, 2026 17:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Improves resilience of the documentation indexing vector store by handling ChromaDB “panic” / corruption scenarios via health checks, backup creation, and restore logic.

Changes:

  • Add ChromaDB initialization “health probe” that wipes and recreates the DB on failure.
  • Add pre-write filesystem backup of the ChromaDB directory and restore helper used on write failures.
  • Add tests covering corrupt DB recovery, KeyboardInterrupt passthrough, _backup_path, and restore behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
src/holoviz_mcp/holoviz_mcp/data.py Adds ChromaDB health-check init, backup/restore helpers, and write-failure recovery path during indexing.
tests/docs_mcp/test_data.py Adds integration-style tests for the new ChromaDB recovery and backup/restore behavior.

Comment thread src/holoviz_mcp/holoviz_mcp/data.py
Comment thread src/holoviz_mcp/holoviz_mcp/data.py
Comment thread src/holoviz_mcp/holoviz_mcp/data.py
Comment thread tests/docs_mcp/test_data.py
MarcSkovMadsen and others added 4 commits February 21, 2026 05:24
…/full)

Implement document chunking for large markdown files and extend the
search() content parameter to support string modes ('chunk', 'truncated',
'full') alongside the existing boolean values for backward compatibility.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add extract_pascal_terms() with stopword filtering to capture single
PascalCase component names (Scatter, Button, Tabulator) that were
previously missed by extract_tech_terms(). Integrate a metadata boost
query on source_path_stem into the search pipeline, creating a 3-tier
merge: metadata boost > keyword pre-filter > semantic similarity.

This fixes search failures for queries like "HoloViews Scatter" where
project-name filtering removed all tech terms, leaving only semantic
search which ranked reference guides too low.

Also fixes pre-existing bug in test_get_reference_guide_multiple_projects
(panel_material_ui → panel-material-ui) and updates todo.md with progress.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@MarcSkovMadsen MarcSkovMadsen changed the title panic handling Improved Document Indexing/ Search Feb 22, 2026
@MarcSkovMadsen MarcSkovMadsen merged commit 3ef9d04 into main Feb 22, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants