Show HN: Zep – Open-Source Graph Memory for AI Apps
Hi HN, we're Daniel, Paul, Travis, and Preston from Zep. We’ve just open-sourced Zep Community Edition, a memory layer for AI agents that continuously learns facts from user interactions and changing business data. Zep ensures that your Agent has the knowledge needed to accomplish tasks successfully.

Github: https://github.com/getzep/zep

Zep walkthrough: https://vimeo.com/1013045013

A few weeks ago, we shared Graphiti, our library for building temporal Knowledge Graphs (https://news.ycombinator.com/item?id=41445445). Zep runs Graphiti under the hood, progressively building and updating a temporal graph from chat interactions, tool use, and business data in JSON or unstructured text.

Zep allows you to build personalized and more accurate user experiences. With increased LLM context lengths, including the entire chat history, RAG results, and other instructions in a prompt can be tempting. We’ve experienced poor temporal reasoning and recall, hallucinations, and slow and expensive inference when doing so.

We believe temporal graphs are the most expressive and dense structure for modeling an agent’s dynamic world (changing user preferences, traits, business data etc). We took inspiration from projects such as MemGPT but found that agent-powered retrieval and complex multi-level architectures are slow, non-deterministic, and difficult to reason with. Zep’s approach, which asynchronously precomputes the graph and related facts, supports very low-latency, deterministic retrieval.

Here’s how Zep works, from adding memories to organizing the graph:

1. Zep identifies nodes and relationships in chat messages or business data. You can specify if new entities should be added to a user and/or group of users.

2. The graph is searched for similar existing nodes. Zep deduplicates new nodes and edge types, ensuring orderly ontology growth.

3. Temporal information is extracted from various sources like chat timestamps, JSON date fields, or article publication dates.

4. New nodes and edges are added to the graph with temporal metadata.

5. Temporal data is reasoned with, and existing edges are updated if no longer valid. More below.

6. Natural language facts are generated for each edge and embedded for semantic and full-text search.

Zep retrieves facts by examining recent user data and combining semantic, BM25, and graph search methods. One technique we’ve found helpful is reranking semantic and full-text results by distance from a user node.

Zep is framework agnostic and can be used with LangChain, LangGraph, LlamaIndex, or without a framework. SDKs for Python, TypeScript, and Go are available.

# More about how Zep manages state changes

Zep reconciles changes in facts as the agent’s environment changes. We use temporal metadata on graph edges to track fact validity, allowing agents to reason with these state changes:

Fact: “Kendra loves Adidas shoes” (valid_at: 2024-08-10)

User message: “I’m so angry! My favorite Adidas shoes fell apart! Puma’s are my new favorite shoes!” (2024-09-25)

Facts:

- “Kendra loves Adidas shoes.” (valid_at: 2024-08-10, invalid_at: 2024-09-25)

- “Kendra’s Adidas shoes fell apart.” (valid_at: 2024-09-25)

- “Kendra prefers Puma.” (valid_at: 2024-09-25)

You can read more about Graphiti’s design here: https://blog.getzep.com/llm-rag-knowledge-graphs-faster-and-...

Zep Community Edition is released under the Apache Software License v2. We’ll be launching a commercial version of Zep soon, which like Zep Community Edition, builds a graph of an agent’s world.

Zep on GitHub: https://github.com/getzep/zep

Quick Start: https://help.getzep.com/ce/quickstart

Key Concepts: https://help.getzep.com/concepts

SDKs: https://help.getzep.com/ce/sdks

Let us know what you think! We’d love your thoughts, feedback, bug reports, and/or contributions!