# install_plugin

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/plugins/discovery/install_plugin)

Install a marketplace plugin into the versioned cache and enable it.

Copies the plugin source into `plugins/cache/{marketplace}/{plugin}/{version}/`,
writes `installed_plugins.json`, and enables the plugin.

## Signature

```python
install_plugin(
    plugin_id: str,
) -> PluginInstance
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `plugin_id` | `str` | Yes | Plugin id in `{name}@{marketplace}` form. |

## Returns

`PluginInstance`

Discovered plugin instance loaded from the cache path.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/e4c1ffe9ee63d7854147de490ca27495ef157a7b/libs/code/deepagents_code/plugins/discovery.py#L203)