# BackendContext

> **Class** in `deepagents`

📖 [View in docs](https://reference.langchain.com/python/deepagents/backends/store/BackendContext)

Context passed to namespace factory functions.

Deprecated: `BackendContext` will be removed in version 0.7.0.
Namespace factories now receive a `Runtime` instance directly.
Migrate from `lambda ctx: (ctx.runtime.context.user_id, "fs")`
to `lambda rt: (rt.server_info.user.identity, "fs")`.

## Signature

```python
BackendContext(
    self,
    state: StateT,
    runtime: Runtime[ContextT],
)
```

## Extends

- `Generic[StateT, ContextT]`

## Constructors

```python
__init__(
    self,
    state: StateT,
    runtime: Runtime[ContextT],
) -> None
```

| Name | Type |
|------|------|
| `state` | `StateT` |
| `runtime` | `Runtime[ContextT]` |


## Properties

- `state`
- `runtime`

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/0b13f3e0e2726fdb7bbe1e0cf88dac76dbd43b01/libs/deepagents/deepagents/backends/store.py#L45)