Files
TORCH/reports/performance/retriever-optimized.md
T
google-labs-jules[bot]andPR0M3TH3AN 9e6d99eb1e ⚡ optimize lexical search with inverted index
- Implemented LexicalIndex class in src/services/memory/retriever.js.
- Added WeakMap caching for indices based on memory array references.
- Improved memory array stability in src/services/memory/index.js using a storeVersion counter.
- Achieved ~2x speedup for 10k memories and ~9x speedup for 100k memories in benchmarks.
- Maintains compatibility with existing textMatchSimilarity scoring.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-20 03:51:34 +00:00

483 B

Lexical Search Optimized Performance

Date: Fri Feb 20 03:36:33 UTC 2026

Summary

Implemented an inverted index with a WeakMap cache. The performance boost is significant, especially as the number of memories grows.

Comparison (10,000 memories, 100 queries)

  • Baseline: 15.80ms / query
  • Optimized: 7.50ms / query
  • Improvement: 2.1x speedup

Comparison (100,000 memories, 10 queries)

  • Baseline: 118.91ms / query
  • Optimized: 13.41ms / query
  • Improvement: 8.8x speedup