Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/docs/Develop/environment-variables.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@ See [Telemetry](/contributing-telemetry).
| `LANGFLOW_BUNDLE_URLS` | List[String] | `[]` | A list of URLs from which to load custom bundles. Supports GitHub URLs. If `LANGFLOW_AUTO_LOGIN=True`, flows from these bundles are loaded into the database. |
| `LANGFLOW_COMPONENTS_PATH` | String | Not set | Path to a directory containing custom components. Typically used if you have local custom components or you are building a Docker image with custom components. |
| `LANGFLOW_COMPONENTS_INDEX_PATH` | String | Not set | File path or URL (`http://` or `https://`) to a prebuilt component index JSON file used to populate built-in components in the visual editor. When not set, Langflow uses the included index. Useful for supplying a curated component index, for example in airgapped deployments. For more information, see [Block custom components](/deployment-block-custom-components). |
| `LANGFLOW_AGENTIC_EXPERIENCE` | Boolean | `True` | Whether [Langflow Assistant](/langflow-assistant) is available. Set to `false` to turn it off for a deployment, for example if you don't want model-generated component code running on your server. The Assistant's endpoints then return `404` and its `run_assistant` MCP tool is unavailable, but the rest of the MCP toolkit at `/api/v1/agentic/mcp` is unaffected. To block code execution itself, including hand-written custom components, use `LANGFLOW_ALLOW_CUSTOM_COMPONENTS`. |
| `LANGFLOW_ALLOW_CUSTOM_COMPONENTS` | Boolean | `True` | If `false`, disables custom components and in-editor editing of component code. This feature is in beta. For more information, see [Block custom components](/deployment-block-custom-components) and [Component hardening for untrusted users](/api-keys-and-authentication#multi-tenant-component-hardening). |
| `LANGFLOW_ALLOW_COMPONENTS_PATHS_OVERRIDE` | Boolean | `True` | When `false` alongside `LANGFLOW_ALLOW_CUSTOM_COMPONENTS=false`, components contributed by `LANGFLOW_COMPONENTS_PATH` and `LANGFLOW_COMPONENTS_INDEX_PATH` no longer bypass the block. Has no effect when `LANGFLOW_ALLOW_CUSTOM_COMPONENTS=true`. For more information, see [Block custom components](/deployment-block-custom-components). |
| `LANGFLOW_BLOCK_CODE_INTERPRETER_COMPONENTS` | Boolean | `False` | If `true`, blocks built-in code-execution components (Python Interpreter, REPL/Code tools, Smart Transform, and code-running agents). See [Component hardening for untrusted users](/api-keys-and-authentication#multi-tenant-component-hardening). |
Expand Down
48 changes: 48 additions & 0 deletions docs/docs/Flows/langflow-assistant.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ To give **Langflow Assistant** context for a different flow, switch to that flow
## Prerequisites

* Connect an LLM provider in the [Global model providers page](/components-models) for **Langflow Assistant** to use
* `LANGFLOW_AGENTIC_EXPERIENCE` must be `true` (default).

**Langflow Assistant** is available out of the box. Set this to `false` to turn it off for a deployment, for example if you don't want model-generated component code running on your server.
While it is off, the Assistant's endpoints return `404`.
For more information, see [Supported environment variables](/environment-variables#supported-variables).

* Custom component creation must be enabled and permitted for your user role:
* `LANGFLOW_ALLOW_CUSTOM_COMPONENTS` must be `true` (default).
* `LANGFLOW_CUSTOM_COMPONENT_ADMIN_ONLY` must be `false` (default) for non-superusers. For superusers, this option is irrelevant.
Expand Down Expand Up @@ -276,8 +282,50 @@ For example, to prompt **Langflow Assistant** to update the system prompt field
Update @Agent.System Prompt to always respond in bullet points.
```

## Use a local or OpenAI-compatible model

**Langflow Assistant** can run on a model served from your own machine or from any OpenAI-compatible endpoint, so your prompts never leave your environment.

To use a local model served by [Ollama](https://ollama.com), set the `OLLAMA_BASE_URL` global variable to your Ollama server, such as `http://localhost:11434`.
Ollama requires no API key.

To use an OpenAI-compatible server instead of OpenAI itself, set the `OPENAI_BASE_URL` global variable to your server's URL, and set `OPENAI_API_KEY` to the key your server expects.

You can set both values as [global variables](/configuration-global-variables) or as environment variables of the same name.
Global variables take precedence, and Langflow falls back to the environment variable when no global variable is set.

:::important
**Langflow Assistant** builds flows by calling tools, so it requires a model that supports tool calling.
Small local models often can't call tools reliably, which appears as an Assistant that only chats and never changes your canvas.
If the Assistant doesn't act on your prompts, try a larger model.
:::

## Connect an external client with MCP

**Langflow Assistant** and Langflow's flow-authoring tools are available to external MCP clients, such as Cursor, Claude Code, and Codex, over a [streamable HTTP](https://modelcontextprotocol.io/docs/concepts/transports) MCP server at `/api/v1/agentic/mcp`.

This lets a client build, inspect, patch, and run your flows without opening the visual editor, including a `run_assistant` tool that calls **Langflow Assistant** itself.
Changes are saved to your flows and appear in the visual editor.

The flow-authoring tools don't require `LANGFLOW_AGENTIC_EXPERIENCE`, because each one is a Langflow API call that your API key already authorizes.
Only `run_assistant` requires it: while the Assistant is disabled, that single tool isn't listed and returns an error explaining why, and the rest of the toolkit keeps working.

Authenticate with a Langflow API key, in the same way as Langflow's other MCP endpoints:

```bash
curl -X POST "$LANGFLOW_URL/api/v1/agentic/mcp" \
-H "x-api-key: $LANGFLOW_API_KEY" \
-H "Content-Type: application/json"
```

For an MCP client, point it at `$LANGFLOW_URL/api/v1/agentic/mcp` with your API key as an `x-api-key` header.
Every tool call is authorized as your own user, so a client can only reach the flows your API key can reach.

For more information on creating an API key, see [API keys](/api-keys-and-authentication).

## See also

- [Build flows](/concepts-flows)
- [Custom components](/components-custom-components)
- [MCP server](/mcp-server)
- [Trigger flows with the Langflow API](/concepts-publish)
Loading
Loading