Skip to main content
A Graph in R2R is a knowledge graph associated with a specific Collection. Each Graph organizes and connects extracted knowledge—such as entities, relationships, and communities—into a structured, queryable network. It serves as the semantic backbone of R2R, enabling advanced reasoning, knowledge discovery, and relational search. Each Graph contains:
  • Entities — extracted information nodes from documents (e.g., people, organizations, concepts).
  • Relationships — links between entities that define how they relate.
  • Communities — LLM-generated clusters of related entities identified through Leiden clustering.
  • Document Mappings — records of which documents contributed to the graph’s knowledge base.

Key Features

Git-like Model

  • Each Collection has an independent, associated Graph.
  • Graphs can diverge and evolve separately from their parent collection.
  • The pull operation syncs knowledge from documents into the graph.
  • Supports experimental changes without impacting the base Collection or source data.

Knowledge Organization

  • Automatic entity and relationship extraction from documents.
  • Community detection enables hierarchical knowledge structures.
  • Support for manual creation and editing of entities, relationships, and communities.
  • Rich metadata and property management for nodes and edges.

Access Control

  • Graph operations inherit Collection-level permissions.
  • Certain operations (e.g., community generation) require superuser privileges.
  • Document-level access checks are enforced when pulling or synchronizing data.

Core Graph Operations

MethodEndpointDescription
GET/graphs/Retrieve an overview of available graphs.
POST/graphs//pullSynchronize documents and extract their knowledge into the graph.
POST/graphs//Retrieve details of a specific collection’s graph.

Entity Management

MethodEndpointDescription
GET/graphs//entitiesList entities within a collection’s graph.
POST/graphs//entitiesCreate a new entity.
GET/graphs//entities/Retrieve details for a specific entity.
Similar CRUD endpoints exist for managing relationships (/relationships) and communities (/communities).