AI Apps Graphiti

Graphiti: Dynamic Temporal Knowledge Graphs

Cut text-to-speech costs with Unreal Speech. 11x cheaper than 11Labs. Production-ready. Stream in 300ms. Generate 10-hr audio. 48 voices. 8 languages. Per-word timestamps. 250K chars free. Try live demo:
Non-Fiction
Fiction
News
Blog
Conversation
0/250
Filesize
0 kb
Get Started for Free
Graphiti

Graphiti

Constructs and queries dynamic, temporally-aware knowledge graphs.

Graphiti

Overview of Graphiti: Dynamic, Temporally-Aware Knowledge Graph Construction and Querying Tool

Graphiti is an open-source tool designed to build and query dynamic, temporally-aware knowledge graphs. Developed by getzep, Graphiti facilitates the representation of complex, evolving relationships between entities over time. It is particularly suited for applications that require long-term recall and state-based reasoning, such as in sales, customer service, health, and finance sectors.

Key Features

Graphiti offers several distinctive features that cater to the needs of developers and researchers working with temporally sensitive data:

  • Temporal Awareness: Graphiti tracks changes in facts and relationships over time. This feature allows users to perform point-in-time queries, with graph edges including temporal metadata to record the lifecycles of relationships.

  • Episodic Processing: The tool ingests data as discrete episodes, which helps in maintaining data provenance and allows for incremental extraction of entities and relationships.

  • Hybrid Search Capabilities: Graphiti combines semantic and BM25 full-text search, enabling the reranking of results based on their distance from a central node, such as a specific entity.

  • Scalability: Designed to handle large datasets efficiently, Graphiti supports the parallelization of large language model (LLM) calls for bulk processing while preserving the chronology of events.

  • Diverse Data Source Integration: The tool can ingest both unstructured text and structured JSON data, providing flexibility in data utilization.

Installation Requirements

To install and run Graphiti, the following components are needed:

  • Python 3.10 or higher
  • Neo4j 5.26 or higher
  • An API key from OpenAI for LLM inference and embedding

Optional:

  • API keys from alternative LLM providers like Anthropic or Groq

Installation Guide

Graphiti can be installed using pip or poetry:

pip install graphiti-core

or

poetry add graphiti-core

Quick Start Example

Here is a brief example to get started with Graphiti:

  1. Initialize Graphiti:

    from graphiti_core import Graphiti
    from datetime import datetime, timezone
    
    graphiti = Graphiti("bolt://localhost:7687", "neo4j", "password")
    graphiti.build_indices_and_constraints()
    
  2. Add Episodes:

    episodes = [
        "Kamala Harris is the Attorney General of California. She was previously the district attorney for San Francisco.",
        "As AG, Harris was in office from January 3, 2011 – January 3, 2017"
    ]
    for i, episode in enumerate(episodes):
        await graphiti.add_episode(
            name=f"Freakonomics Radio {i}",
            episode_body=episode,
            source=EpisodeType.text,
            source_description="podcast",
            reference_time=datetime.now(timezone.utc)
        )
    
  3. Search the Graph:

    results = await graphiti.search('Who was the California Attorney General?')
    

Conclusion

Graphiti is a robust tool for developers and researchers looking to explore and utilize knowledge graphs that account for temporal dynamics and complex relationships. Its ability to handle episodic data and perform hybrid searches makes it a valuable resource in various fields requiring nuanced data analysis and retrieval.

Share Graphiti:
SoBrief
SoBrief – Book Summaries
Read any book in 10 minutes. 100% free to read. Audio in 40 languages.
Sign In