Skip to content

Key Architecture ideas from Zep #6

Description

@hussainzs

Here are key ideas to consider (include or improve upon) from Zep's paper. assign it to david and alex

Bi-temporal:

Bo asked what bi-temporal meant in Zep. They have two timelines for each node.
T = chronological ordering of events themselves.
T'= data ingestion timeline. So t' created = when it was created in memory, and t' expired = when memory was marked expired.

Episodic nodes with Entities

  1. Episodic nodes = text, JSON etc.
  2. Episodic edges connect episodic nodes with entity nodes, which are entities duh.
  3. example: episode "in Q2, marketing campaigns on Google Ads had ROI of 24% while commercial ads had ROI of 21%". This episodic node will be connected to several entities: "Google Ads", "Quarter 2", "marketing campaigns", "commercial Ads", including "speaker".

Community summaries

  1. Clusters of events can have summaries inspired by GraphRAG. This helps answer holistic queries about the entire graph or subgraph. like "brief me on all marketing campaigns we ran last year and their ROI" or "what cloud services am I running and what issues I had so far this year?"
  2. How do we determine communities? One approach is the Leiden community detection algorithm as used in GraphRAG. However, raw Leiden will be computationally costly for us because we will be updating data often, and raw Leiden recomputes the communities every time. --> This is why Zep updates summaries at the time of Node creation with community refreshes periodically.

De-duplication of Nodes, edges, entities

Zep uses full-text search and similarity search to find similar nodes and then deduplicates them using an LLM (I think this should work well). Specifically, they de-duplicate with some entity as a starting point: find all similar entities or relationships and see if they are duplicated. This reduces the search space and computational complexity.

Processes to run at the time of edge and node creation:

De-duplicate:

i.e., do we want to de-duplicate at the time of memory insertion/update? This would make sense as it allows us to de-duplicate, similar to Zep. But maybe we can think of a better approach?

Contradiction resolution:

Zep also invalidates existing edges using an LLM at the time of edge creation. It compares new edges to semantically related existing edges and identifies contradictions.

Community creation and update:

When nodes are created and inserted into the graph along with their relationships, find out all the neighbors of the new node n. Find out which community each neighbor belongs to? Insert this new node n into the community where most of its neighbors belong to.
Criticism: This is a naive algorithm; as we can tell, there are many issues with this. We should come up with a better approach, maybe a variation of Leiden that doesn't recompute every time.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

help wantedExtra attention is neededtodo itemtask to be done by team

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions