feat: Implement Tantivy-based session index for full-text search #5
Notifications
Due Date
No due date set.
Blocks
Depends on
#15 feat: /sessions expand subcommand with context window (F4 UX, Task 2.6.4)
terraphim/agent-tasks
#29 feat: wildcard/relaxed query fallback when primary search returns zero results (F1.1)
terraphim/agent-tasks
#32 feat: live index_status in robot capabilities response (F3.1)
terraphim/agent-tasks
#43 feat: criterion benchmark suite for G1 performance targets
terraphim/agent-tasks
#39 feat: CodeSnippet extraction and Message.snippets in session model (F4.2)
terraphim/agent-tasks
Reference: terraphim/agent-tasks#5
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem Statement
Session search currently uses naive in-memory string matching (
String::contains) which is O(n) over all messages and does not support relevance ranking, phrase queries, or fuzzy matching. Theterraphim_sessions/src/index/directory exists but is empty.Current State
crates/terraphim_sessions/src/service.rs:181(linear scan)crates/terraphim_sessions/src/index/(no files)terraphim_sessions/Cargo.tomlAcceptance Criteria
tantivydependency toterraphim_sessions/Cargo.tomlSessionIndexwith add/search methodsSessionServicefor automatic indexing on importProposed Approach
tantivy = "0.21"toterraphim_sessions/Cargo.tomlcrates/terraphim_sessions/src/index/mod.rswith:SessionIndexSchemadefining fields (session_id, message_id, content, code_content, timestamp, role, source)SessionIndexstruct withadd_session()andsearch()methodsSessionServiceto maintain aSessionIndexalongside the cachesearch()to use Tantivy when index is available, fallback to linear scanDependencies
None
Verification
Scope
New module (~300 lines) + modifications to
service.rs. Single PR.Upstream: This issue tracks a feature for terraphim/terraphim-ai
Closing -- superseded by BM25 search. The session search now uses
OkapiBM25Scorerwith KG hybrid boost (crates/terraphim_sessions/src/search.rs). Tantivy was evaluated and rejected per ADR in favour of the existingterraphim_types::scoreinfrastructure.