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

feat: GraphDBBlock #2017

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

feat: GraphDBBlock #2017

wants to merge 12 commits into from

Conversation

X-TRON404
Copy link
Collaborator

@X-TRON404 X-TRON404 commented Mar 26, 2025

Description

GraphDBBlock for agent memory. This is a part of the feature for #1712

Checklist

Go over all the following points, and put an x in all the boxes that apply.

  • I have read the CONTRIBUTION guide (required)
  • I have linked this PR to an issue using the Development section on the right sidebar or by adding Fixes #issue-number in the PR description (required)
  • I have checked if any dependencies need to be added or updated in pyproject.toml and uv lock
  • I have updated the tests accordingly (required for a bug fix or a new feature)
  • I have updated the documentation if needed:
  • I have added examples if this is a new feature

If you are unsure about any of these, don't hesitate to ask. We are here to help!

@Wendong-Fan
Copy link
Member

@cafeii will help with code review

Copy link
Collaborator

@zjrwtx zjrwtx left a comment

Choose a reason for hiding this comment

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

thanks @X-TRON404 !left some comments

"""
return self._graph_db_block.retrieve(
query=self._current_query,
numberOfNearestNeighbours=self._retrieve_limit,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
numberOfNearestNeighbours=self._retrieve_limit,
number_of_nearest_neighbours=self._retrieve_limit,

Copy link
Collaborator

@zjrwtx zjrwtx left a comment

Choose a reason for hiding this comment

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

maybe we can add some @Retry to write etc

numberOfNearestNeighbours=self._retrieve_limit,
)

def write_records(self, records: List[MemoryRecord]) -> None:
Copy link
Collaborator

Choose a reason for hiding this comment

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

may be we can add batch process

"""
CREATE VECTOR INDEX message_embeddings IF NOT EXISTS
FOR (m:Message) ON (m.embedding)
OPTIONS {indexConfig: {`vector.dimensions`: 1536,
Copy link
Collaborator

Choose a reason for hiding this comment

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

the dim should vary with different embedding models

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants