> ## Documentation Index
> Fetch the complete documentation index at: https://io.net/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

> The R2R Graphs API manages knowledge graphs tied to specific collections. It supports entity and relationship extraction, community detection, and synchronization with document data—enabling structured, queryable knowledge organization for advanced AI reasoning.

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

| Method | Endpoint                                                                          | Description                                                       |
| ------ | --------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| GET    | [/graphs/](/reference/rag/graphs/get-graph-overview)                              | Retrieve an overview of available graphs.                         |
| POST   | [/graphs/{collection_id}/pull](/reference/rag/graphs/pull-and-rebuild-graph)      | Synchronize documents and extract their knowledge into the graph. |
| POST   | [/graphs/{collection_id}/](/reference/rag/graphs/get-graph-data-for-a-collection) | Retrieve details of a specific collection’s graph.                |

## Entity Management

| Method | Endpoint                                                                                        | Description                                |
| ------ | ----------------------------------------------------------------------------------------------- | ------------------------------------------ |
| GET    | [/graphs/{collection_id}/entities](/reference/rag/graphs/list-graph-entities)                   | List entities within a collection’s graph. |
| POST   | [/graphs/{collection_id}/entities](/reference/rag/graphs/add-new-entities)                      | Create a new entity.                       |
| GET    | [/graphs/{collection_id}/entities/{entity_id}](/reference/rag/graphs/get-single-entity-details) | Retrieve details for a specific entity.    |

Similar **CRUD** endpoints exist for managing **relationships** (`/relationships`) and **communities** (`/communities`).
