# load_extension

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/extensions/loader/load_extension)

Load one extension transactionally.

## Signature

```python
load_extension(
    source: SourceInfo,
    registry: ExtensionRegistry,
    *,
    cwd: Path,
    mode: ExtensionMode,
) -> ExtensionAPI
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `source` | `SourceInfo` | Yes | Extension entry file and import shape. |
| `registry` | `ExtensionRegistry` | Yes | Destination for registrations. |
| `cwd` | `Path` | Yes | Session working directory. |
| `mode` | `ExtensionMode` | Yes | Runtime mode. |

## Returns

`ExtensionAPI`

The active registrar owned by the extension runtime.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/caaa7e7c12d214afa5cf0a1afed8eb6232aa6f7b/libs/code/deepagents_code/extensions/loader.py#L67)