Repository navigation
feat: search the chats - #134
Merged
Merged
Conversation
Migration 0016 adds chat_search, an FTS5 index read through the chat_text view, so no text is stored twice; triggers keep it in step with chat_items and the migration indexes what was there. It covers what bots were told, their replies and their questions, without accents. Spec 8.8.
chat.search finds items with every word, the last one as a prefix, each
taken literally, newest first with a marked snippet, and answers outside
the queue. chat.history {until} returns from an item to the newest, to
open a chat at a result.
Search on the left (Ctrl+K) opens a page that finds words as the owner types, in all crews or one, with the words highlighted. A result opens its bot's chat at that point and marks the item for a moment.
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.
Search across the chats (spec 8.8, roadmap item 18.4).
Store and daemon
chat_search, an FTS5 index that reads text through achat_textview overchat_items, so no text is stored twice. Triggers keep it in step on insert, update and delete (a deleted bot takes its entries along), and the migration indexes existing chats. It covers what bots were told (the owner, other bots, Botloft), their replies and their questions with answers; tool calls, approvals and notices are left out. Theunicode61tokenizer ignores accents and case.chat.search {query, botId?, crewId?, before?, limit?}: every word must match, the last one may be a prefix, and FTS5 syntax in the query is taken literally. Results come newest first with a snippet that marks the words found, from active bots only. The request is answered outside the queue, likefiles.list.chat.history {botId, until}returns everything from an item to the newest (up to 1,000), to open a chat at a result.App
SidebarPages.tsxsoSidebar.tsxstays near 300 lines.Checks
cargo fmt,clippy -D warnings,cargo test --workspaceandpnpm check(306 tests) pass.tests/search.rs) and app (features/search/search.test.tsx).pnpm devpreview: Ctrl+K, results as you type, opening a result in Writer's chat with the mark.Still to check by hand
pnpm localon a real database: the migration indexes existing chats (time on a large history), and a search finds old messages.