{"by":"roseway4","descendants":21,"id":41445445,"kids":[41449316,41449048,41454721,41455922,41456728,41448223,41445450],"score":142,"text":"Hey HN! We&#x27;re Paul, Preston, and Daniel from Zep. We&#x27;ve just open-sourced Graphiti, a Python library for building temporal Knowledge Graphs using LLMs.<p>Graphiti helps you create and query graphs that evolve over time. Knowledge Graphs have been explored extensively for information retrieval. What makes Graphiti unique is its ability to build a knowledge graph while handling changing relationships and maintaining historical context.<p>At Zep, we build a memory layer for LLM applications. Developers use Zep to recall relevant user information from past conversations without including the entire chat history in a prompt.  Accurate context is crucial for LLM applications. If an AI agent doesn&#x27;t remember that you&#x27;ve changed jobs or confuses the chronology of events, its responses can be jarring or irrelevant, or worse, inaccurate.<p>Before Graphiti, our approach to storing and retrieving user “memory” was, in effect, a specialized RAG pipeline. An LLM extracted “facts” from a user’s chat history. Semantic search, reranking, and other techniques then surfaced facts relevant to the current conversation back to a developer for inclusion in their prompt.<p>We attempted to reconcile how new information may change our understanding of existing facts:<p>Fact: “Kendra loves Adidas shoes”<p>User message: “I’m so angry! My favorite Adidas shoes fell apart! Puma’s are my new favorite shoes!”<p>Facts:<p>- “Kendra used to love Adidas shoes but now prefers Puma.”<p>- “Kendra’s Adidas shoes fell apart.”<p>Unfortunately, this approach became problematic. Reconciling facts from increasingly complex conversations challenged even frontier LLMs such as gpt-4o. We saw incomplete facts, poor recall, and hallucinations. Our RAG search also failed at times to capture the nuanced relationships between facts, leading to irrelevant or contradictory information being retrieved.<p>We tried fixing these issues with prompt optimization but saw diminishing returns on effort. We realized that a graph would help model a user’s complex world, potentially addressing these challenges.<p>We were intrigued by Microsoft’s GraphRAG, which expanded on RAG text chunking with a graph to better model a document corpus. However, it didn&#x27;t solve our core problem: GraphRAG is designed for static documents and doesn&#x27;t natively handle temporality.<p>So, we built Graphiti, which is designed from the ground up to handle constantly changing information, hybrid semantic and graph search, and scale:<p>- Temporal Awareness: Tracks changes in facts and relationships over time. Graph edges include temporal metadata to record relationship lifecycles.<p>- Episodic Processing: Ingests data as discrete episodes, maintaining data provenance and enabling incremental processing.<p>- Hybrid Search: Semantic and BM25 full-text search, with the ability to rerank results by distance from a central node.<p>- Scalable: Designed for large datasets, parallelizing LLM calls for batch processing while preserving event chronology.<p>- Varied Sources: Ingests both unstructured text and structured data.<p>Graphiti has significantly improved our ability to maintain accurate user context. It does a far better job of fact reconciliation over long, complex conversations. Node distance reranking, which places a user at the center of the graph, has also been a valuable tool. Quantitative data evaluation results may be a future ShowHN.<p>Work is ongoing, including:<p>1. Improving support for faster and cheaper small language models.<p>2. Exploring fine-tuning to improve accuracy and reduce latency.<p>3. Adding new querying capabilities, including search over neighborhood (sub-graph) summaries.<p>## Getting Started<p>Graphiti is open source and available on GitHub: <a href=\"https:&#x2F;&#x2F;github.com&#x2F;getzep&#x2F;graphiti\">https:&#x2F;&#x2F;github.com&#x2F;getzep&#x2F;graphiti</a>.<p>We&#x27;d love to hear your thoughts. Please also consider contributing!","time":1725456079,"title":"Show HN: Graphiti – LLM-Powered Temporal Knowledge Graphs","type":"story","url":"https://github.com/getzep/graphiti"}