diff --git a/docs/docs/Agents/agents.mdx b/docs/docs/Agents/agents.mdx index 2120e303a..bf18f6e99 100644 --- a/docs/docs/Agents/agents.mdx +++ b/docs/docs/Agents/agents.mdx @@ -122,6 +122,25 @@ In the **Agent Instructions** (`system_prompt`) field, you can provide custom in These instructions are applied in addition to the **Input** (`input_value`), which can be entered directly or provided through another component, such as a **Chat Input** component. +### Agent memory + +Langflow Agents have built-in memory enabled by default that allows them to remember previous messages in a conversation. +This memory acts as a rolling chat history window, ensuring the Agent can reference earlier exchanges and maintain context without requiring a separate [Message History](/components-helpers#message-history) component. + +The Agent’s internal chat history is stored in the Langflow database, just like the [Message History](/components-helpers#message-history) helper component. +The default storage option in Langflow is a [SQLite](https://www.sqlite.org/) database stored in your system's cache directory: + +- **macOS Desktop**: `/Users//.langflow/data/database.db` +- **Windows Desktop**: `C:\Users\\AppData\Roaming\com.Langflow\data\langflow.db` +- **OSS macOS/Windows/Linux/WSL (uv pip install)**: `/lib/python3.12/site-packages/langflow/langflow.db` (Python version may vary) +- **OSS macOS/Windows/Linux/WSL (git clone)**: `/src/backend/base/langflow/langflow.db` + +If your Langflow deployment has `LANGFLOW_DATABASE_URL` set to PostgreSQL, the Agent memory will use the PostgreSQL database. +Each conversation is associated with a session ID, so messages are grouped and retrieved per session. +This means your chat history is saved and can be accessed or retrieved later, even if you refresh or revisit the flow. + +The number of stored messages can be configured in the **Number of Chat History Messages** field in the Agent component. + ### Tools Agents are most useful when they have the appropriate tools available to complete requests. diff --git a/docs/docs/Components/components-helpers.mdx b/docs/docs/Components/components-helpers.mdx index 7ddc32de2..e1afcd1a3 100644 --- a/docs/docs/Components/components-helpers.mdx +++ b/docs/docs/Components/components-helpers.mdx @@ -55,7 +55,14 @@ The Current Date component returns the current date and time in a selected timez Prior to Langflow 1.5, this component was two separate components called **Chat History** and **Message Store**. ::: -This component provides combined chat history and message store functionality. This component can use Langflow's SQLite database or external memory to store and retrieve chat messages. +This component handles chat history and message storage using Langflow’s SQLite database or an external memory source to save and retrieve chat messages. The default storage option is a [SQLite](https://www.sqlite.org/) database stored in your system's cache directory: + +- **macOS Desktop**: `/Users//.langflow/data/database.db` +- **Windows Desktop**: `C:\Users\\AppData\Roaming\com.Langflow\data\langflow.db` +- **OSS macOS/Windows/Linux/WSL (uv pip install)**: `/lib/python3.12/site-packages/langflow/langflow.db` (Python version may vary) +- **OSS macOS/Windows/Linux/WSL (git clone)**: `/src/backend/base/langflow/langflow.db` + +If your Langflow deployment has `LANGFLOW_DATABASE_URL` set to PostgreSQL, the Message History component will use the PostgreSQL database. Chat memory is distinct from vector store memory, because it is built specifically for storing and retrieving chat messages from databases. diff --git a/docs/docs/Concepts/concepts-flows.mdx b/docs/docs/Concepts/concepts-flows.mdx index 0c75c2af6..b5afd16cc 100644 --- a/docs/docs/Concepts/concepts-flows.mdx +++ b/docs/docs/Concepts/concepts-flows.mdx @@ -83,9 +83,10 @@ From the **Projects** page, you can manage flows within each of your projects: Flows and [flow logs](#flow-logs) are stored on local disk at the following default locations: -- **Linux and WSL**: `home//.cache/langflow/` -- **macOS**: `/Users//Library/Caches/langflow/` -- **Windows**: `%LOCALAPPDATA%\langflow\langflow\Cache` +- **macOS Desktop**: `/Users//.langflow/cache` +- **Windows Desktop**: `C:\Users\\AppData\Roaming\com.Langflow\cache` +- **OSS macOS/Windows/Linux/WSL (uv pip install)**: `/lib/python3.12/site-packages/langflow/cache` +- **OSS macOS/Windows/Linux/WSL (git clone)**: `/src/backend/base/langflow/cache` The flow storage location can be customized with the [`LANGFLOW_CONFIG_DIR`](/environment-variables#LANGFLOW_CONFIG_DIR) environment variable. diff --git a/docs/docs/Concepts/mcp-server.mdx b/docs/docs/Concepts/mcp-server.mdx index fd83b6262..343153fcb 100644 --- a/docs/docs/Concepts/mcp-server.mdx +++ b/docs/docs/Concepts/mcp-server.mdx @@ -25,6 +25,10 @@ As an MCP server, Langflow exposes your flows as [tools](https://modelcontextpro ## Select and configure flows to expose as MCP tools {#select-flows-to-serve} +:::important MCP flow requirements +A flow must contain a [**Chat Output**](/components-io#chat-output) component to be used as a tool by MCP clients. +::: + Each [Langflow project](/concepts-flows#projects) has an MCP server that exposes the project's flows as tools that MCP clients can use to generate responses. By default, all flows in a project are exposed as tools on the project's MCP server. diff --git a/docs/docs/Configuration/environment-variables.mdx b/docs/docs/Configuration/environment-variables.mdx index 910d1882b..d70d95d42 100644 --- a/docs/docs/Configuration/environment-variables.mdx +++ b/docs/docs/Configuration/environment-variables.mdx @@ -192,7 +192,7 @@ The following table lists the environment variables supported by Langflow. | LANGFLOW_BUNDLE_URLS | List[String] | `[]` | A list of URLs from which to load component bundles and flows. Supports GitHub URLs. If LANGFLOW_AUTO_LOGIN is enabled, flows from these bundles are loaded into the database. | | LANGFLOW_CACHE_TYPE | String | `async` | Set the cache type for Langflow. Possible values: `async`, `redis`, `memory`, `disk`.
If you set the type to `redis`, then you must also set the following environment variables: LANGFLOW_REDIS_HOST, LANGFLOW_REDIS_PORT, LANGFLOW_REDIS_DB, and LANGFLOW_REDIS_CACHE_EXPIRE. | | LANGFLOW_COMPONENTS_PATH | String | `langflow/components` | Path to the directory containing custom components.
See [`--components-path` option](./configuration-cli.mdx#run-components-path). | -| LANGFLOW_CONFIG_DIR | String | See description | Set the Langflow configuration directory where files, logs, and the Langflow database are stored. Defaults: **Linux/WSL**: `~/.cache/langflow/`
**macOS**: `/Users//Library/Caches/langflow/`
**Windows**: `%LOCALAPPDATA%\langflow\langflow\Cache`| +| LANGFLOW_CONFIG_DIR | String | See description | Set the Langflow configuration directory where files, logs, and the Langflow database are stored. Defaults:
**macOS Desktop cache**: `/Users//.langflow/cache`
**Windows Desktop cache**: `C:\Users\\AppData\Roaming\com.Langflow\cache`
**OSS macOS/Windows/Linux/WSL (uv pip install) cache**: `/lib/python3.12/site-packages/langflow/cache`
**OSS macOS/Windows/Linux/WSL (git clone) cache**: `/src/backend/base/langflow/cache` | | LANGFLOW_DATABASE_URL | String | Not set | Set the database URL for Langflow. If not provided, Langflow uses a SQLite database. | | LANGFLOW_USE_NOOP_DATABASE | Boolean | `false` | Use a no-op database, which avoids database connections and operations. Useful for running flows without a database. | | LANGFLOW_DATABASE_CONNECTION_RETRY | Boolean | `false` | If True, Langflow tries to connect to the database again if it fails. | diff --git a/docs/docs/Develop/logging.mdx b/docs/docs/Develop/logging.mdx index 95227fc30..c7abe415e 100644 --- a/docs/docs/Develop/logging.mdx +++ b/docs/docs/Develop/logging.mdx @@ -15,9 +15,10 @@ The default `log_level` is `ERROR`. Other options are `DEBUG`, `INFO`, `WARNING` The default logfile is called `langflow.log`, and its location depends on your operating system. -* Linux/WSL: `\~/.cache/langflow/` -* macOS: `/Users/\/Library/Caches/langflow/` -* Windows: `%LOCALAPPDATA%\langflow\langflow\Cache` +- **macOS Desktop**:`/Users//.langflow/cache` +- **Windows Desktop**:`C:\Users\\AppData\Roaming\com.Langflow\cache` +- **OSS macOS/Windows/Linux/WSL (uv pip install)**: `/lib/python3.12/site-packages/langflow/cache` +- **OSS macOS/Windows/Linux/WSL (git clone)**: `/src/backend/base/langflow/cache` The `LANGFLOW_LOG_ENV` controls log output and formatting. The `container` option outputs serialized JSON to stdout. The `container_csv` option outputs CSV-formatted plain text to stdout. The `default` (or not set) logging option outputs prettified output with [RichHandler](https://rich.readthedocs.io/en/stable/reference/logging.html). diff --git a/docs/docs/Develop/memory.mdx b/docs/docs/Develop/memory.mdx index fc71df3c4..d844a0c91 100644 --- a/docs/docs/Develop/memory.mdx +++ b/docs/docs/Develop/memory.mdx @@ -12,9 +12,10 @@ Langflow supports both local memory and external memory options. The default storage option in Langflow is a [SQLite](https://www.sqlite.org/) database stored in your system's cache directory: -- Linux/WSL: `~/.cache/langflow/langflow.db` -- macOS: `/Users//Library/Caches/langflow/langflow.db` -- Windows: `%LOCALAPPDATA%\langflow\langflow\Cache\langflow.db` +- **macOS Desktop**: `/Users//.langflow/data/database.db` +- **Windows Desktop**: `C:\Users\\AppData\Roaming\com.Langflow\data\langflow.db` +- **OSS macOS/Windows/Linux/WSL (uv pip install)**: `/lib/python3.12/site-packages/langflow/langflow.db` (Python version may vary) +- **OSS macOS/Windows/Linux/WSL (git clone)**: `/src/backend/base/langflow/langflow.db` The following tables are stored in `langflow.db`: