feat(memory): tantivy-jieba TantivyStore (CC-Adv alternative)#161
Open
feat(memory): tantivy-jieba TantivyStore (CC-Adv alternative)#161
Conversation
Replace vector-search-based WarmStore with full-text BM25 search using tantivy + tantivy-jieba. This eliminates the LanceDB dependency, embedding generation overhead, and the CPU spike issue (#139). Key changes: - New TantivyStore: BM25 scoring, jieba CJK tokenization, persistent index - Remove WarmStore (LanceDB), embedding.rs (HashEmbedding), arrow deps - Replace MemoryError::LanceDb with MemoryError::SearchEngine - Update MemoryConfig: tantivy_index_path replaces warm_store_path - Simplify memory tools: remove EmbeddingGenerator parameter - Update gateway.rs: remove embedding from learning pipeline [CC-Adv] Bahtya
- Upgrade tantivy 0.24 → 0.26, tantivy-jieba 0.14 → 0.19 - Use i64 timestamp fields (micros) instead of tantivy DateTime - Use RangeQuery::new() with Bound terms instead of new_f64_bounds - Fix writer mutability (use `mut` for MutexGuard) - Remove embedding field from MemoryEntry and MemoryQuery - Add reader to TantivyStore for consistent reads - Add concurrent writes test Bahtya
- Chain LowerCaser filter to JiebaTokenizer for case-insensitive BM25 - Fix upsert capacity check: skip limit when overwriting existing entry - Fix test_combined_text_and_category_search: expect 2 results not 1 Bahtya
This was referenced Apr 23, 2026
Owner
Author
|
[CC-Adv] PR #161 价值总结 — 双层架构备选方案 PR #160 已合并,PR #162 是当前待合并的 clean 版本。本 PR(#161)作为备选参考保留,提供 PR #162 中缺失的以下功能: PR #161 额外价值1. Critical Category PinningPR #162 删除了 HotStore,导致 // hot_store.rs — Critical entries never evicted
if entry.category == MemoryCategory::Critical {
continue; // skip LRU eviction
}2. LRU 淘汰策略HotStore 使用 3. 零延迟热数据缓存HotStore 维护内存中的 4. TieredStore 透明分层
5. 现有数据兼容PR #161 保留了 何时需要 PR #161
分支状态
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Alternative implementation of the LanceDB → tantivy-jieba migration, preserving HotStore + TieredStore.
Key differences from PR #160 (CC-Main):
tantivy_index_path(vstantivy_store_pathin PR feat(memory): replace LanceDB with tantivy-jieba full-text search #160)See issue #159 for full independent analysis and issue #158 for RFC discussion.
[CC-Adv]
Test plan
Bahtya