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
    • Welcome
    • Overview
    • Quick Start
    • MCP Server
  • Configuration
    • LLM Configuration
    • Neo4j Configuration
    • FalkorDB Configuration
    • AWS Neptune Configuration
    • Kuzu DB Configuration
  • Core Concepts
    • Adding Episodes
    • Custom Entity and Edge Types
    • Communities
    • Graph Namespacing
  • Working with Data
    • Searching
    • CRUD Operations
    • Adding Fact Triples
  • Integrations
    • LangGraph Agent
  • Other
    • Telemetry
LogoLogo
PlaygroundDiscordStatusDashboardSign Up >
Core Concepts

Communities

How to create and update communities
Was this page helpful?
Previous

Graph Namespacing

Using group_ids to create isolated graph namespaces

Next
Built with

In Graphiti, communities (represented as CommunityNode objects) represent groups of related entity nodes. Communities can be generated using the build_communities method on the graphiti class.

1await graphiti.build_communities()

Communities are determined using the Leiden algorithm, which groups strongly connected nodes together. Communities contain a summary field that collates the summaries held on each of its member entities. This allows Graphiti to provide high-level synthesized information about what the graph contains in addition to the more granular facts stored on edges.

Once communities are built, they can also be updated with new episodes by passing in update_communities=True to the add_episode method. If a new node is added to the graph, we will determine which community it should be added to based on the most represented community of the new node’s surrounding nodes. This updating methodology is inspired by the label propagation algorithm for determining communities. However, we still recommend periodically rebuilding communities to ensure the most optimal grouping. Whenever the build_communities method is called it will remove any existing communities before creating new ones.