For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
PlaygroundDiscordStatusDashboardSign Up >
DocumentationSDK ReferenceGraphiti
DocumentationSDK ReferenceGraphiti
  • Getting Started
    • Coding with LLMs
    • Key Concepts
    • Quickstart
    • Building an Agent Walkthrough
    • Memory
    • Projects
    • Users
    • Sessions
    • Groups
  • Working with the Graph
    • Understanding the Graph
    • Utilizing Facts and Summaries
    • Customizing Graph Structure
    • Adding Data to the Graph
    • Reading Data from the Graph
    • Searching the Graph
    • Deleting Data from the Graph
    • Debugging
  • Cookbook
    • Check Data Ingestion Status
    • Customize Your Memory Context String
    • Add User Specific Business Data to User Graphs
    • Share Memory Across Users Using Group Graphs
    • Get Most Relevant Facts for an Arbitrary Query
    • Find Facts Relevant to a Specific Node
  • Best Practices
    • Performance Best Practices
    • Adding JSON Best Practices
  • Ecosystem
    • LangGraph
    • Autogen
  • Migrations
    • February 2026 Deprecation Wave
    • Migrate from Mem0
  • FAQ
    • Frequently Asked Questions
  • Legal
    • Privacy Policy
    • Terms of Service
    • Website Terms of Use
LogoLogo
PlaygroundDiscordStatusDashboardSign Up >
On this page
  • Adding a Session
  • Getting a Session
  • Deleting a Session
  • Listing Sessions
Getting Started

Sessions

Was this page helpful?
Previous

Groups

Group graphs can be used to create and manage additional non-user specific graphs.

Next
Built with

Sessions represent a conversation. Each User can have multiple sessions, and each session is a sequence of chat messages.

Chat messages are added to sessions using memory.add, which both adds those messages to the session history and ingests those messages into the user-level knowledge graph. The user knowledge graph contains data from all of that user’s sessions to create an integrated understanding of the user.

The knowledge graph does not separate the data from different sessions, but integrates the data together to create a unified picture of the user. So the get session memory endpoint and the associated memory.get method don’t return memory derived only from that session, but instead return whatever user-level memory is most relevant to that session, based on the session’s most recent messages.

Adding a Session

SessionIDs are arbitrary identifiers that you can map to relevant business objects in your app, such as users or a conversation a user might have with your app. Before you create a session, make sure you have created a user first. Then create a session with:

1client = Zep(
2 api_key=API_KEY,
3)
4session_id = uuid.uuid4().hex # A new session identifier
5
6client.memory.add_session(
7 session_id=session_id,
8 user_id=user_id,
9)

Getting a Session

1session = client.memory.get_session(session_id)
2print(session.dict())

Deleting a Session

Deleting a session deletes it and its associated messages. It does not however delete the associated data in the user’s knowledge graph. To remove data from the graph, see deleting data from the graph.

1client.memory.delete(session_id)

Listing Sessions

You can list all Sessions in the Zep Memory Store with page_size and page_number parameters for pagination.

1# List the first 10 Sessions
2result = client.memory.list_sessions(page_size=10, page_number=1)
3for session in result.sessions:
4 print(session)