Projects
Applied Algorithms
ScoutSearch
A local documentation search engine with explainable BM25 ranking and atomic index updates.
1,654
Documentation passages
13.91 ms
Broad-query p50 before
2.42 ms
Broad-query p50 after
27/27
Query configurations matching reference
Benchmark methodology
The local benchmark used 1,654 passages from 382 CPython documentation files, with three timed repetitions after warming each path. It measured the search engine in-process.
View benchmark reportProblem
Engineering documentation needs searchable terms and exact phrases, with ranking that can be inspected and verified while documents are edited or imported.
PythonSQLiteBM25ReactTypeScriptBenchmarking
GitHub Repository Documentation01
Python Indexer02
SQLite Positional Postings03
BM25 Scoring04
React Search Results05
Architecture
- The Python indexer normalizes input and stores documents, corpus statistics, and positional postings in SQLite.
- The search engine uses covering indexes and SQL arithmetic for BM25 scoring. Phrase queries verify term positions before ranking.
- The React interface renders results and explains per-term score contributions.
Design Decisions
- Used SQL aggregation for broad term queries and retained positional verification for exact phrases.
- Used transactions for index updates and consistent snapshots for search reads.
Performance
- Broad-query median latency fell from 13.91 ms to 2.42 ms on the pinned local corpus.
- The same benchmark records selective, phrase, and collection-filter workloads so their tradeoffs remain visible.
Validation
- All 27 query configurations matched the independent full-scan reference on match counts, top-10 rankings, and scores.
- The corpus manifest and evaluation script document how to reproduce the benchmark.
Lessons Learned
Benchmark each query shape against a correctness reference before optimizing.
Keep ranking statistics and document postings on the same read snapshot during concurrent updates.