Skip to content

Long Term Memory: add time and source to knowdledge atoms

Extend the Neo4J knowledge graph

  • add time properties to nodes and relations (created_on, modified_on)
  • add source properties to nodes and relations: name of the document, 'store' user command
  • fill in these new properties into the responses
  • allow queries like "what did you learn on 12.04.25?"

Graphiti

Graphiti is a framework for building and querying temporally-aware knowledge graphs, specifically tailored for AI agents operating in dynamic environments. Unlike traditional retrieval-augmented generation (RAG) methods, Graphiti continuously integrates user interactions, structured and unstructured enterprise data, and external information into a coherent, queryable graph.

Key concepts:

  1. Temporal Knowledge Graphs
  2. Incremental Updates / Episodic Ingestion
  3. Hybrid Retrieval / Search
  4. MCP server

Major usecase : Agent Memory

image.png

Tasks

Creation of Knowledge Graph

  • add_episode - Episodes represent a single data ingestion event. An episode is itself a node, and any nodes identified while ingesting the episode are related to the episode via MENTIONS edges.

    Supported episode types: text, message,json

    Graphiti automatically:

    • Chunks the text
    • Extracts entities + relationships
    • Cleans and normalizes them
    • Stores them in Neo4j
    • Creates embeddings per node

Create a test node in AI-Builder ( wip )

  • search -
    • Perform a hybrid search combining semantic similarity and BM25 retrieval
    • Perform a node search using _search method with standard recipes ( There are 15 receipes )

Notes :

  1. Episodic node: Store raw , unstructured data like a context holder . They typically do not have a custom entity types themselves but rather contain content from which specific custom entity types are extracted.
  2. Summary of a node changes when episodes gets added in later stages. Also since LLM formulates the summary, it summarizes contents that are not added in the text data as well. ( eg: Brexit in UK summary )
  3. If episode 1 and 2 have similar information ( or identical), the created relationship gets invalidated even if both confirm the same. According to Graphiti, it will be invalidated but similar relationship edge must be created but that did not happen in most.
  4. Lot of Random relationships as edges and sometime wrong arrows ( eg: Germany> contains>EU)
  5. Confusions with year data eg: Croatia membership to EU valid 2013, invalid 2016 and valid 2004, invalid 2008.

Fork Graphiti and modify according to our needs ( Work in Jan 2026 )

Explore different techniques ( wip )

Features:

  1. Custom entity and edge creation
  2. Temporal Behavior - historical buildups
  3. Causal chain and event.

References

  1. https://github.com/getzep/graphiti/tree/main
  2. https://help.getzep.com/graphiti/integrations/lang-graph-agent
  3. https://help.getzep.com/graphiti/core-concepts/adding-episodes
Edited by Sangamithra Panneer Selvam