Cognee + Graphiti: Integrating Temporal-Aware Graphs
At cognee, we provide innovative solutions for knowledge representation and retrieval. Cognee is a robust framework for creating, querying, and leveraging graphs to extract meaningful insights. While many tools in the market offer specialized features - like Graphiti’s temporal-aware graphs - we stand apart by integrating with such tools, allowing users to bring their own logic and extend cognee’s core capabilities.
Our recent integration with Graphiti is a prime example of this adaptability. It demonstrates how Cognee enables users to enhance their workflows by adding custom functionality, rather than relying on disparate memory systems from multiple providers
Graphiti Integration: Adding Temporal Awareness to Cognee
Graphiti specializes in building temporal-aware graphs, a feature that tracks and represents the progression of entities and relationships over time. Through this integration, cognee has not only incorporated Graphiti’s strengths but also showcased its ability to adapt external tools into its ecosystem.
How Graphiti is Integrated into Cognee
To enable seamless interaction with their graph data, we’ve developed a new Pydantic object to store and manage Graphiti nodes and edges in cognee’s vector collections. Cognee provides a DataPoint class that is a Pydantic object that can be stored in a graph and vector store with any graph/vector store adapter we support. This means adding a new tool, means just extending a class. The new nodes encapsulate textual attributes such as name, summary, and content.
- Name: An identifying label.
- Summary: A concise overview.
- Content: The main body of data generated by Graphiti.
The integration brings:
- Feature Enrichment: Cognee enhances Graphiti’s nodes with system-specific features, tailoring the data for our platform.
- Storage and Indexing: Textual data from Graphiti nodes is stored in our database, and vector collections are created for efficient retrieval of both nodes and edges.
- Graph Transformation: Cognee adapts Graphiti’s temporal graphs into its modular framework, creating a seamless pipeline for handling and analyzing data.
This process enables users to use Graphiti’s temporal-awareness features while maintaining the robustness and scalability of cognee’s core framework.
Here’s a snippet showcasing the transformation and indexing process and it can be found in our Github repo.
Benefits of the Integration
The integration showcases the flexibility and scalability of cognee’s architecture. Key advantages include:
- Bring Your Own Logic: Users can easily integrate external tools, models, or custom logic into cognee without compromising its core functionality.
- Enhanced Functionality: By building on cognee’s foundation, users can add specialized features like temporal awareness or any other domain-specific capabilities.
- Unified Workflow: Instead of piecing together fragmented systems, users can rely on cognee as a unified platform that adapts to their needs.
Example Use Case
Imagine a user querying: “When was Kamala Harris in office?”
Here’s how cognee processes the query using the integration.
Try it yourself in this notebook.
Cognee is flexible, so what?
The integration of Graphiti into cognee represents a leap forward in our mission to enable adaptable, contextually aware data retrieval. Instead of imposing rigid workflows, cognee enables users to integrate their preferred methods, tools or libraries.
Stay tuned as we continue to release a few more interesting integrations along the way. Whether you're exploring integrations like Graphiti or building custom solutions, the cognee community is here to support you.
Love what we're building? Try cognee out, check out tutorial on GitHub. ⭐