Repository navigation
feat(code-intel): make brain answer questions and show which signals found what - #745
Merged
Merged
Conversation
…found what (#717) A question such as "how does web_search pick its backend" needed every word in one symbol name, so the keyword signal found nothing and only the vector hits were left. cora brain now reduces the question to its content words (stop words dropped, snake_case split) and ranks a symbol by how many of them it matches. Results were also returned in table order instead of rank order; they are now sorted by the fused score. A static text embedding counts for half in the fusion. cora brain prints how many hits keyword, vector and graph found and warns when the vector index is empty, built with other dimensions, or text-only. The MCP brain tool uses the same question handling. A fixed question over a small fixture is kept as a regression test.
1 task done
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.
What
cora brainreduces a question to its content words (stop words dropped,snake_casesplit) and ranks a symbol by how many of them it matches, so a sentence now finds symbols by keyword. The MCPcora.brain_searchtool uses the same handling.cora brainprints how many hits keyword, vector and graph found, and warns when the vector index is empty, built with other dimensions, or text-only. The warnings go to stderr, so--jsonstays a plain array.Why
A question such as "how does web_search pick its backend and read env" needed every word in one symbol name, so the keyword signal found nothing and only unrelated vector hits were left. Together with the lost ordering, the output looked arbitrary. Refs #717: this covers the
brainitem except the embedding-model evaluation, which needs a real provider and is not part of this change.Testing
cargo test -- --list).cora brain "how does the review store prune findings"now returnsprune,review_store,Findingsand related symbols by keyword, with the signal counts and a static-embedding warning.cargo fmt --all -- --check,cargo clippy --all-targets --features tree-sitter -- -D warnings,cargo test --features tree-sitter,cora review --base origin/develop: no issues.