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

Merged
merged 6 commits into from
Jan 3, 2025

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.

@kingbootoshi kingbootoshi mentioned this pull request Jan 3, 2025
8 tasks
@spike-spiegel-21 spike-spiegel-21 merged commit 78a2ef4 into main Jan 3, 2025
5 checks passed
@spike-spiegel-21 spike-spiegel-21 deleted the graph_deletion branch January 3, 2025 16:51
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.

2 participants