
Chris CoutinhoandClaude
02700a8e2c
perf: Eliminate double-fetching in semantic search sampling
Performance optimization that removes redundant verification step and
makes content fetching parallel in nc_semantic_search_answer tool.
Changes:
- Remove verification.py module (only had 1 caller)
- Refactor nc_semantic_search to do inline deduplication instead of
calling verify_search_results()
- Migrate verification patterns (anyio task group, semaphore limiting)
to nc_semantic_search_answer's content fetching
- Change content fetching from sequential loop to parallel execution
Performance impact:
- Before: 10 API calls (5 parallel verification + 5 sequential content)
= ~5.5s overhead
- After: 5 API calls (parallel content fetch) = ~0.5s overhead
- Result: 50% fewer API calls, ~10x faster for sampling operations
Technical details:
- Uses anyio.create_task_group() for structured concurrency
- Semaphore limiting (max_concurrent=20) prevents connection pool exhaustion
- Index-based storage maintains result ordering
- Expected failures (deleted notes) logged at debug level
- Deduplication handles hybrid search returning same doc from dense + sparse
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-16 10:25:04 +01:00
..
2025-11-16 07:01:35 +01:00
2025-11-16 07:03:18 +01:00
2025-11-13 21:57:14 +01:00
2025-11-05 15:19:55 +01:00
2025-11-12 02:46:30 +01:00
2025-11-09 05:53:53 +01:00
2025-11-16 07:03:18 +01:00
2025-11-16 10:25:04 +01:00
2025-11-16 10:25:04 +01:00
2025-10-25 19:52:45 +02:00
2025-11-16 07:01:35 +01:00
2025-05-04 23:24:55 +02:00
2025-11-16 03:51:45 +01:00
2025-11-11 20:35:08 +01:00
2025-11-13 21:48:58 +01:00
2025-11-05 21:44:04 +01:00