# extract_cypher

> **Function** in `langchain_community`

📖 [View in docs](https://reference.langchain.com/python/langchain-community/chains/graph_qa/memgraph/extract_cypher)

Extract Cypher code from a text.

## Signature

```python
extract_cypher(
    text: str,
) -> str
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `text` | `str` | Yes | Text to extract Cypher code from. |

## Returns

`str`

Cypher code extracted from the text.

---

[View source on GitHub](https://github.com/langchain-ai/langchain-community/blob/d5ea8358933260ad48dd31f7f8076555c7b4885a/libs/community/langchain_community/chains/graph_qa/memgraph.py#L42)