feat: Add Hybrid Search functionality to AstraDB + AstraPy / LangChain Updates (#7358)

* feat: Add Hybrid Search functionality and AstraPy 2.0 and associated deps (#7357)

* astrapy 2.0 tentative full pass

* Update the create collection function

---------

Co-authored-by: Stefano Lottini <stefano.lottini@datastax.com>

* Update deps

* Update uv.lock

* Fix linting errors in astradb

* Update package lock

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

* Add basic UI scaffolding for hybrid search

* [autofix.ci] apply automated fixes

* Continue to clean up component

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

* Fix the keyspace compatibility

* [autofix.ci] apply automated fixes

* feat: add nodeId, nodeClass, and handleNodeClass props to dropdown an… (#7406)

feat: add nodeId, nodeClass, and handleNodeClass props to dropdown and string render components

Co-authored-by: deon-sanchez <deon.sanchez@datastax.com>

* Update uv.lock

* Update uv.lock

* Add hybrid search support in collection creation

* [autofix.ci] apply automated fixes

* Updates from review comments

* [autofix.ci] apply automated fixes

* Add in lexical search support

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

* Detect collection hybrid params

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

* Pass lexical terms at search time

* [autofix.ci] apply automated fixes

* Update test_astra_component.py

* Add Query Input and Mixin on backend

* Adds Query on supported types

* Adds types for query modal and component

* Adds size for new query modal

* Adds query modal

* Adds query component

* Adds query component on parameter render

* [autofix.ci] apply automated fixes

* Feedback from review

* [autofix.ci] apply automated fixes

* ✨ (switch-case-size.ts): Update height value to 'h-fit' for 'small-query' case to improve responsiveness
✨ (queryInputComponent.spec.ts): Add unit test for user interaction with query input component, including updating code and testing functionality

* Switch to multiline for lexical terms

* [autofix.ci] apply automated fixes

* Create Hybrid Search RAG.json

* Update Hybrid Search RAG.json

* Added queryInput in vectorstore model

* Added queryInput in lexical terms

* Update model.py

* Update Hybrid Search RAG.json

* Add query support in field validation

* fix: bump Astra Assistants version to support AstraPy 2.0 (#7535)

2.2.12

Co-authored-by: phact <estevezsebastian@gmail.com>

* Update uv.lock

* Fixed QueryInput not receiving text from handle

* Set search type to similarity search when hybrid

* Always set to similarity when we have the reranker

* [autofix.ci] apply automated fixes

* Add logging for hybrid search support

* Update starter projects

* Update Hybrid Search RAG.json

* Added dropdown toggle on backend

* Added toggle on dropdown on frontend

* Added showing only value if there is just one option in the dropdown

* Added toggle to Dropdown Input on Astra Db

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

* init toggle value as true or false

* Change it to send null value if toggle is disabled

* Added resizer on search query

* Added Search Hybrid, Lexical and Vector icons

* Added icons and new Lexical Search on Dropdown Input of Astra DB

* Updated starter projects

* Changed descriptions on astradb component

* Changed starter projects

* Lexical search option for dropdown

* Update astradb.py

* Update starter projects

* One small lexical update

* Update astradb.py

* Update projects

* [autofix.ci] apply automated fixes

* Fixed dropdown changing when toggle is off

* Update astradb.py

* [autofix.ci] apply automated fixes

* Don't show lexical terms on new collection creation

* ✨ (actionsMainPage-shard-0.spec.ts): add functionality to add flow to test on empty langflow button click
✨ (filterEdge-shard-1.spec.ts): add functionality to add flow to test on empty langflow button click
♻️ (await-bootstrap-test.ts): refactor code to reuse addFlowToTestOnEmptyLangflow function for adding flow to test on empty langflow button click

* [autofix.ci] apply automated fixes

* 🐛 (filterEdge-shard-1.spec.ts): fix incorrect reference to memoriesAstra DB Chat Memory, update to memoriesMem0 Chat Memory for accurate testing data.

---------

Co-authored-by: Stefano Lottini <stefano.lottini@datastax.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: deon-sanchez <deon.sanchez@datastax.com>
Co-authored-by: Lucas Oliveira <lucas.edu.oli@hotmail.com>
Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
Co-authored-by: phact <estevezsebastian@gmail.com>
This commit is contained in:
Eric Hare 2025-04-11 11:03:34 -07:00 • committed by GitHub
commit 907a594428
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
30 changed files with 4901 additions and 1804 deletions

View file

@ -1,4 +1,5 @@
import { expect, test } from "@playwright/test";
import { addFlowToTestOnEmptyLangflow } from "../../utils/add-flow-to-test-on-empty-langflow";
import { adjustScreenView } from "../../utils/adjust-screen-view";
import { awaitBootstrapTest } from "../../utils/await-bootstrap-test";
@ -62,6 +63,12 @@ test(
await page.waitForSelector('[data-testid="mainpage_title"]', {
timeout: 30000,
});
const countEmptyButton = await page
.getByTestId("new_project_btn_empty_page")
.count();
if (countEmptyButton > 0) {
await addFlowToTestOnEmptyLangflow(page);
}
await page.getByTestId("upload-folder-button").last().click();
},
);

View file

@ -1,4 +1,5 @@
import { expect, test } from "@playwright/test";
import { addFlowToTestOnEmptyLangflow } from "../../utils/add-flow-to-test-on-empty-langflow";
import { addLegacyComponents } from "../../utils/add-legacy-components";
import { adjustScreenView } from "../../utils/adjust-screen-view";
import { awaitBootstrapTest } from "../../utils/await-bootstrap-test";
@ -9,6 +10,10 @@ test(
async ({ page }) => {
await awaitBootstrapTest(page);
await page.waitForSelector('[data-testid="mainpage_title"]', {
timeout: 30000,
});
await page.getByTestId("blank-flow").click();
await page.waitForSelector('[data-testid="sidebar-options-trigger"]', {
@ -73,7 +78,7 @@ test(
"vectorstoresAstra DB",
"langchain_utilitiesTool Calling Agent",
"langchain_utilitiesConversationChain",
"memoriesAstra DB Chat Memory",
"memoriesMem0 Chat Memory",
"logicCondition",
"langchain_utilitiesSelf Query Retriever",
"langchain_utilitiesCharacterTextSplitter",