Graph stores in Cognee handle the storage and management of knowledge graphs, enabling relationship-based reasoning and complex knowledge representation. They work alongside vector stores to provide comprehensive knowledge storage and retrieval capabilities.
Graph stores enable relationship-based reasoning by storing entities and their connections, allowing for complex knowledge traversal and inference.

How Graph Stores Work

1

Entity Extraction

Content is analyzed to identify key entities (people, places, concepts, events).
2

Relationship Detection

Connections between entities are discovered and classified (works_at, located_in, related_to).
3

Graph Construction

Entities and relationships are stored as nodes and edges in a graph database.
4

Knowledge Traversal

Queries can traverse the graph to find complex relationships and make inferences.

Choose Your Graph Store

Select the graph database that best fits your needs:

Quick Configuration Examples

Get started with any graph store in just a few lines of code:
Enterprise Grade
import os
import cognee

# Neo4j configuration
os.environ["GRAPH_DATABASE_PROVIDER"] = "neo4j"
os.environ["GRAPH_DATABASE_URL"] = "neo4j://localhost:7687"
os.environ["GRAPH_DATABASE_USERNAME"] = "neo4j"
os.environ["GRAPH_DATABASE_PASSWORD"] = "your-password"

await cognee.add("Neo4j provides powerful graph capabilities.")
await cognee.cognify()

Graph Query Examples

Entity Relationships

Knowledge Graph Features

Entity Resolution

Smart Deduplication
  • Automatically merge duplicate entities
  • Handle name variations and aliases
  • Maintain relationship integrity

Relationship Inference

Smart Connections
  • Infer implicit relationships
  • Detect relationship patterns
  • Build comprehensive knowledge maps

Temporal Modeling

Time-Aware Graphs
  • Track relationship changes over time
  • Maintain historical context
  • Enable temporal queries

Ontology Support

Structured Knowledge
  • Define entity types and hierarchies
  • Enforce relationship constraints
  • Enable semantic reasoning

Quick Start Guides

Choose your graph store and get started in minutes:

Not Sure Which to Choose?

Start with NetworkX if you’re new to graph databases - it requires zero setup and is perfect for learning. For production use, Neo4j is the industry standard with excellent tooling and community support.