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

[graph_memory]: improve delete/add graph memory #2073

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

spike-spiegel-21
Copy link
Collaborator

Description

Flow of graph memory addtion:

  1. Extracts all the entities/nodes and their types mentioned in the query. (Returns: dictionary of {nodes:type})
  2. Eshtablish relations among the extracted nodes. (Input: list of nodes(that does not contains types). Returns: list of source -- relationship -- destination)

(Note: The above 2 LLM calls are made to ensure that all the facts are retrieved from the query/data. The single LLM seems to be overloaded if we expect source (and their types) -- relationship -- destination (and their types))

  1. Search similar nodes and their respective inbound and outbound relations.
  2. LLM call to find what relationship we want to delete based on the query/data. (it returns the relations that we have to delete

Now we have a list of entities (source -- relationship -- destination) that we need to add and delete.

  1. Delete relationships
  2. Add relationships
  • Find whichever node is common (source and destination) via similarity search (0.9 threshold) and then then merge it.

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.

1 participant