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

# autogen.agentchat.contrib.graph_rag.neo4j_graph_rag_capability.Neo4jGraphCapability

<h2 id="autogen.agentchat.contrib.graph_rag.neo4j_graph_rag_capability.Neo4jGraphCapability" class="doc doc-heading">
  <code class="doc-symbol doc-symbol-heading doc-symbol-class" />

  <span class="doc doc-object-name doc-class-name">Neo4jGraphCapability</span>
</h2>

```python theme={null}
Neo4jGraphCapability(query_engine: Neo4jGraphQueryEngine)
```

The Neo4j graph capability integrates Neo4j Property graph into a graph rag agent.<br />Ref: [https://neo4j.com/labs/genai-ecosystem/llamaindex/#\_property\_graph\_constructing\_modules](https://neo4j.com/labs/genai-ecosystem/llamaindex/#_property_graph_constructing_modules)

For usage, please refer to example notebook/agentchat\_graph\_rag\_neo4j.ipynb

Initialize GraphRAG capability with a graph query engine

<b>Parameters:</b>

| Name           | Description                                                                                                                               |
| -------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `query_engine` | **Type:** [Neo4jGraphQueryEngine](/docs/api-reference/autogen/agentchat/contrib/graph_rag/neo4j_graph_query_engine/Neo4jGraphQueryEngine) |

### Instance Methods

<code class="doc-symbol doc-symbol-heading doc-symbol-method" />

#### add\_to\_agent

```python theme={null}
add_to_agent(self, agent: ConversableAgent) -> None
```

Add Neo4j GraphRAG capability to a UserProxyAgent.<br />The restriction to a UserProxyAgent to make sure the returned message only contains information retrieved from the graph DB instead of any LLMs.

<b>Parameters:</b>

| Name    | Description                                                                |
| ------- | -------------------------------------------------------------------------- |
| `agent` | **Type:** [ConversableAgent](/docs/api-reference/autogen/ConversableAgent) |

<br />
