-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(query): Add custom lancedb query generation for lancedb search #518
feat(query): Add custom lancedb query generation for lancedb search #518
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Couple of comments
swiftide/tests/lancedb.rs
Outdated
.context("Failed to create vector similarity query")? | ||
.column(&vector_field); | ||
|
||
let result_limit = usize::try_from(similarity_config.top_k()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe just use an arbitrary number? Feels a bit complicated to just create a new search strategy, if you really need a number.
1705ed1
to
6e99c2d
Compare
Hi @timonv, I've updated the custom strategy implementation in
Would appreciate your thoughts on whether this prototype aligns with your expectations. |
This commit implements the CustomStrategy trait for LanceDB vector similarity search, enabling flexible query generation with metadata filtering. Signed-off-by: shamb0 <[email protected]>
6e99c2d
to
39d7b97
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work, this is really good! Will merge it asap.
## 🤖 New release * `swiftide`: 0.16.4 -> 0.17.0 (✓ API compatible changes) * `swiftide-agents`: 0.16.4 -> 0.17.0 (✓ API compatible changes) * `swiftide-core`: 0.16.4 -> 0.17.0 (⚠️ API breaking changes) * `swiftide-macros`: 0.16.4 -> 0.17.0 * `swiftide-indexing`: 0.16.4 -> 0.17.0 * `swiftide-integrations`: 0.16.4 -> 0.17.0 (✓ API compatible changes) * `swiftide-query`: 0.16.4 -> 0.17.0 ###⚠️ `swiftide-core` breaking changes ``` --- failure trait_method_added: pub trait method added --- Description: A non-sealed public trait added a new method without a default implementation, which breaks downstream implementations of the trait ref: https://doc.rust-lang.org/cargo/reference/semver.html#trait-new-item-no-default impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.38.0/src/lints/trait_method_added.ron Failed in: trait method swiftide_core::agent_traits::AgentContext::redrive in file /tmp/.tmps520nh/swiftide/swiftide-core/src/agent_traits.rs:153 trait method swiftide_core::AgentContext::redrive in file /tmp/.tmps520nh/swiftide/swiftide-core/src/agent_traits.rs:153 ``` <details><summary><i><b>Changelog</b></i></summary><p> ## `swiftide` <blockquote> ## [0.17.0](v0.16.4...v0.17.0) - 2025-01-16 ### New features - [835c35e](835c35e) *(agents)* Redrive completions manually on failure (#551) ````text Sometimes LLMs fail a completion without deterministic errors, or the user case where you just want to retry. `redrive` can now be called on a context, popping any new messages (if any), and making the messages available again to the agent. ```` - [f83f3f0](f83f3f0) *(agents)* Implement ToolExecutor for common dyn pointers (#549) - [7f85735](7f85735) *(query)* Add custom lancedb query generation for lancedb search (#518) - [ce4e34b](ce4e34b) *(tree-sitter)* Add golang support (#552) ````text Seems someone conveniently forgot to add Golang support for the splitter. ```` ### Miscellaneous - [0000000](0000000) Update Cargo.lock dependencies **Full Changelog**: 0.16.4...0.17.0 </blockquote> </p></details> --- This PR was generated with [release-plz](https://github.com/release-plz/release-plz/).
Fixes: #511
This PR implements the
CustomStrategy<Q>
trait for LanceDB, enabling flexible and customizable vector similarity search capabilities. The implementation follows the successful pattern established in the pgvector integration while leveraging LanceDB-specific features.