# GraphCypherQAChain

> **Class** in `langchain_neo4j`

📖 [View in docs](https://reference.langchain.com/python/langchain-neo4j/chains/graph_qa/cypher/GraphCypherQAChain)

Chain for question-answering against a graph by generating Cypher statements.

!!! warning "Security note"

    Make sure that the database connection uses credentials that are narrowly-scoped
    to only include necessary permissions. Failure to do so may result in data
    corruption or loss, since the calling code may attempt commands that would
    result in deletion, mutation of data if appropriately prompted or reading
    sensitive data if such data is present in the database.

    The best way to guard against such negative outcomes is to (as appropriate)
    limit the permissions granted to the credentials used with this tool.

    See https://docs.langchain.com/oss/python/security-policy for more information.

## Signature

```python
GraphCypherQAChain(
    self,
    **kwargs: Any = {},
)
```

## Extends

- `Chain`

## Constructors

```python
__init__(
    self,
    **kwargs: Any = {},
) -> None
```


## Properties

- `graph`
- `cypher_generation_chain`
- `qa_chain`
- `graph_schema`
- `input_key`
- `output_key`
- `example_key`
- `top_k`
- `return_intermediate_steps`
- `return_direct`
- `cypher_query_corrector`
- `use_function_response`
- `allow_dangerous_requests`
- `input_keys`
- `output_keys`

## Methods

- [`from_llm()`](https://reference.langchain.com/python/langchain-neo4j/chains/graph_qa/cypher/GraphCypherQAChain/from_llm)

---

[View source on GitHub](https://github.com/langchain-ai/langchain-neo4j/blob/9bfd947b3ce63ca58fe27c059f9db6c3cc90cf78/libs/neo4j/langchain_neo4j/chains/graph_qa/cypher.py#L103)