Skip to main content
Graphiti is a Python framework for building temporally-aware, multi-tenant knowledge graphs designed for multi-agent AI systems with persistent memory. It enables real-time integration of structured and unstructured data, supporting advanced hybrid search, temporal reasoning, and collaborative agent memory.

Overview

Graphiti provides a powerful abstraction layer for building knowledge graphs that:
  • Track temporal changes: Understand how entities and relationships evolve over time
  • Support multi-tenancy: Isolated memory spaces for different users or agents
  • Enable hybrid search: Combine semantic search with graph traversal
  • Scale efficiently: Built on top of FalkorDB’s high-performance graph engine

Why Graphiti + FalkorDB?

FalkorDB’s Added Value

  • Multi-tenant, multi-agent memory: Isolated graph instances for different users or agents, each with their own persistent memory
  • High performance: Fast graph operations and efficient memory usage
  • Cloud and on-premises ready: Works with FalkorDB Cloud or your own deployment
  • Easy integration: Seamless connection with Graphiti for scalable, production-ready knowledge graphs

Use Cases

  • AI memory for multi-agent systems: Provide persistent, context-rich memory for each agent
  • Enterprise knowledge management: Aggregate and search across documents, conversations, and structured data
  • Conversational AI: Track facts, entities, and relationships over time for more accurate responses
  • E-commerce: Manage inventory, personalize recommendations, and track customer interactions over time
  • Research and analytics: Temporal and semantic search across large, heterogeneous datasets

Getting Started

Prerequisites

  • Python 3.10 or higher
  • FalkorDB instance (Cloud or self-hosted)
  • OpenAI API key (for embeddings and LLM features)

Installation

Install Graphiti with FalkorDB support:

Quick Start Example

Here’s a complete example to get you started with Graphiti and FalkorDB:

Understanding the Code

  1. Initialize Graphiti: Connect to your FalkorDB instance with the connection URI
  2. Build Indices: Create necessary graph indices and constraints (one-time setup)
  3. Add Episodes: Store information as “episodes” - chunks of text or structured data with temporal context
  4. Search: Query the graph using natural language or specific parameters
  5. Close: Clean up connections when done

Advanced Features

Graphiti supports multiple search types:

Temporal Queries

Query the graph at specific points in time:

Multi-Tenant Architecture

Create isolated graphs for different users or agents:

Configuration Options

Connection Parameters

Custom LLM Configuration

Best Practices

  1. Batch Episodes: When loading large amounts of data, batch your episodes for better performance
  2. Set Reference Times: Always provide reference times for temporal tracking
  3. Use Descriptive Names: Give episodes meaningful names for easier retrieval
  4. Index Strategy: Build indices once during setup, not on every run
  5. Connection Pooling: Reuse Graphiti instances when possible instead of creating new connections

Troubleshooting

Connection Issues

If you can’t connect to FalkorDB:
  • Verify your connection string format: falkor://host:port
  • Check if FalkorDB is running: redis-cli ping
  • Ensure credentials are correct for authenticated instances

Performance Optimization

  • Use batching for bulk operations
  • Monitor memory usage with GRAPH.MEMORY USAGE command
  • Consider graph partitioning for very large knowledge bases

Resources

Next Steps

  • Explore Cognee for alternative memory management approaches
  • Learn about GenAI Tools for graph reasoning and LLM integrations

Frequently Asked Questions

Temporally-aware means Graphiti tracks how entities and relationships change over time. Each episode includes a reference time, allowing you to query the state of knowledge at any point in history and understand the evolution of relationships.
Use the falkor:// URI scheme when initializing Graphiti: Graphiti(uri='falkor://localhost:6379'). For FalkorDB Cloud, include credentials: falkor://your-instance.falkordb.cloud:6379 with username and password parameters.
An episode is a unit of information stored in the knowledge graph - it can be text, a message, or structured data with temporal context. Graphiti processes episodes to extract entities and relationships, building the graph incrementally over time.
Create isolated graphs for different users or agents by specifying a unique graph_name parameter: Graphiti(uri='falkor://localhost:6379', graph_name='user1_memory'). Each graph is completely isolated, leveraging FalkorDB’s native multi-graph support.
No. Call await graphiti.build_indices_and_constraints() once during initial setup to create necessary graph indices and constraints. Subsequent runs of your application can skip this step.