# get_session

> **Function** in `langchain_neo4j`

📖 [View in docs](https://reference.langchain.com/python/langchain-neo4j/checkpoint/_internal/get_session)

Get a Neo4j session from a driver.

## Signature

```python
get_session(
    driver: Driver,
    database: str | None = None,
) -> Iterator[Session]
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `driver` | `Driver` | Yes | The Neo4j driver instance. |
| `database` | `str \| None` | No | Optional database name. (default: `None`) |

---

[View source on GitHub](https://github.com/langchain-ai/langchain-neo4j/blob/9bfd947b3ce63ca58fe27c059f9db6c3cc90cf78/libs/neo4j/langchain_neo4j/checkpoint/_internal.py#L75)