Skip to content
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

Add Falkordb vectorstore Integration #16047

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

A5jadAli
Copy link

This pull request introduces support for FalkorDB as a vectorstore option in LlamaIndex. The changes include:

  • Integration code: Added new code in base.py to handle operations with Falkordb following the structure of other vectorstore integrations.
  • Testing: Included tests.py to verify the integration works as expected.

Copy link
Contributor

@AviAvni AviAvni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it look like more tests need to be added


_logger = logging.getLogger(__name__)

def check_if_not_null(props: List[str], values: List[Any]) -> None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this function only used once just inline it


def retrieve_existing_index(self) -> bool:
index_information = self._driver.query(
"SHOW INDEXES "
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replace with
CALL db.indexes()

def retrieve_existing_index(self) -> bool:
index_information = self._driver.query(
"SHOW INDEXES "
"YIELD name, type, entityType, properties, options "
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

filter_params = {}

similarity_query = (
f"WITH n, vector.similarity.{self.distance_strategy}("
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@AviAvni AviAvni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it looks good now missing the docs and all the other files like in the other libs like pyproject.toml etc

@A5jadAli
Copy link
Author

@AviAvni please have a look at docs and if there's anything you think we need to change drop a comment, I'll fix it asap.

Copy link
Contributor

@AviAvni AviAvni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small change

from llama_index.vector_stores.falkordb import FalkorDBVectorStore

vector_store = FalkorDBVectorStore(
url="bolt://localhost:7687",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to falkor://

@A5jadAli A5jadAli marked this pull request as ready for review September 25, 2024 08:59
@dosubot dosubot bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Sep 25, 2024
@gkorland
Copy link
Contributor

@logan-markewich can you please review/merge?

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Sep 30, 2024
@logan-markewich logan-markewich self-assigned this Sep 30, 2024
@logan-markewich logan-markewich enabled auto-merge (squash) September 30, 2024 22:07
@logan-markewich
Copy link
Collaborator

@gkorland @AviAvni I fixed a handful of issues, but the unit tests don't seem to work. Did you run them locally?

@A5jadAli
Copy link
Author

A5jadAli commented Oct 4, 2024 via email

@logan-markewich
Copy link
Collaborator

@A5jadAli try running them, they don't actually work. Previously the mock db client wasn't being used (and the URL was also invalid) -- changed it slightly to use the mock client so that things are actually testable in CICD, but most tests fail (likely because things aren't mocked out entirely)

@A5jadAli
Copy link
Author

A5jadAli commented Oct 5, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer size:XL This PR changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants