diff --git a/docs/docs/Configuration/environment-variables.mdx b/docs/docs/Configuration/environment-variables.mdx index c8b71c5baa..be1e605e8e 100644 --- a/docs/docs/Configuration/environment-variables.mdx +++ b/docs/docs/Configuration/environment-variables.mdx @@ -155,7 +155,7 @@ The following table lists the environment variables supported by Langflow. | `LANGFLOW_AUTO_SAVING_INTERVAL` | Integer | `1000` | Set the interval for flow auto-saving in milliseconds. | | `LANGFLOW_BACKEND_ONLY` | Boolean | False | Run only the Langflow backend service (no frontend). | | `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`. See also [`langflow run`](/configuration-cli#langflow-run). | +| `LANGFLOW_CACHE_TYPE` | String | `async` | Set the cache type for Langflow's internal caching system. For detailed cache configuration options, see [Configure cache memory](/memory#configure-cache-memory). | | `LANGFLOW_COMPONENTS_PATH` | String | Not set | Path to the directory containing custom components. | | `LANGFLOW_CONFIG_DIR` | String | Varies | Set the Langflow configuration directory where files, logs, and the Langflow database are stored. Default path depends on your installation. See [Flow storage and logs](/concepts-flows#flow-storage-and-logs). | | `LANGFLOW_DATABASE_URL` | String | Not set | Set the database URL for Langflow. If not provided, Langflow uses a SQLite database. | @@ -170,7 +170,7 @@ The following table lists the environment variables supported by Langflow. | `LANGFLOW_FRONTEND_PATH` | String | `./frontend` | Path to the frontend directory containing build files. This is for development purposes only. See [`langflow run`](/configuration-cli#langflow-run). | | `LANGFLOW_HEALTH_CHECK_MAX_RETRIES` | Integer | `5` | Set the maximum number of retries for the health check. See [`langflow run`](/configuration-cli#langflow-run). | | `LANGFLOW_HOST` | String | `localhost` | The host on which the Langflow server will run. See [`langflow run`](/configuration-cli#langflow-run). | -| `LANGFLOW_LANGCHAIN_CACHE` | String | `InMemoryCache` | Type of cache storage to use, separate from `LANGFLOW_CACHE_TYPE`. Possible values: `InMemoryCache`, `SQLiteCache`. | +| `LANGFLOW_LANGCHAIN_CACHE` | String | `InMemoryCache` | Set the cache type for Langchain's caching system. For detailed cache configuration options, see [Configure cache memory](/memory#configure-cache-memory). | | `LANGFLOW_LOG_LEVEL` | String | `INFO` | Set the logging level for Langflow. Possible values: `DEBUG`, `INFO`, `WARNING`, `ERROR`, `CRITICAL`. | | `LANGFLOW_LOG_FILE` | String | Not set | Path to the log file. If this option isn't set, logs are written to stdout. | | `LANGFLOW_LOG_RETRIEVER_BUFFER_SIZE` | Integer | `10000` | Set the buffer size for log retrieval. Only used if `LANGFLOW_ENABLE_LOG_RETRIEVAL` is enabled. | @@ -184,11 +184,6 @@ The following table lists the environment variables supported by Langflow. | `LANGFLOW_PORT` | Integer | `7860` | The port on which the Langflow server runs. The server automatically selects a free port if the specified port is in use. | | `LANGFLOW_PROMETHEUS_ENABLED` | Boolean | False | Expose Prometheus metrics. | | `LANGFLOW_PROMETHEUS_PORT` | Integer | `9090` | Set the port on which Langflow exposes Prometheus metrics. | -| `LANGFLOW_REDIS_CACHE_EXPIRE` | Integer | `3600` | See `LANGFLOW_CACHE_TYPE`. | -| `LANGFLOW_REDIS_DB` | Integer | `0` | See `LANGFLOW_CACHE_TYPE`. | -| `LANGFLOW_REDIS_HOST` | String | `localhost` | See `LANGFLOW_CACHE_TYPE`. | -| `LANGFLOW_REDIS_PORT` | String | `6379` | See `LANGFLOW_CACHE_TYPE`. | -| `LANGFLOW_REDIS_PASSWORD` | String | Not set | Password for Redis authentication when using Redis cache type. | | `LANGFLOW_REMOVE_API_KEYS` | Boolean | False | Remove API keys from the projects saved in the database. | | `LANGFLOW_SAVE_DB_IN_CONFIG_DIR` | Boolean | False | If false (default), the Langflow database is saved in the `langflow` root directory. This means the database isn't shared between different virtual environments, and the database is deleted when you uninstall Langflow. If true, the database is saved in the `LANGFLOW_CONFIG_DIR`. | | `LANGFLOW_SECRET_KEY` | String | Automated | See [`LANGFLOW_SECRET_KEY`](/api-keys-and-authentication#langflow-secret-key). | diff --git a/docs/docs/Develop/memory.mdx b/docs/docs/Develop/memory.mdx index f1fec6fc9c..20039433d0 100644 --- a/docs/docs/Develop/memory.mdx +++ b/docs/docs/Develop/memory.mdx @@ -26,17 +26,19 @@ For more information, see [Configure external memory](#configure-external-memory The following tables are stored in `langflow.db`: -• **User**: Stores user account information including credentials, permissions, profiles, and user management settings. For more information, see [API keys and authentication](/api-keys-and-authentication). +• **ApiKey**: Manages Langflow API authentication keys. Component API keys are stored in the **Variables** table. For more information, see [API keys and authentication](/api-keys-and-authentication). + +• **File**: Stores metadata for files uploaded to Langflow's file management system, including file names, paths, sizes, and storage providers. For more information, see [Manage files](/concepts-file-management). • **Flow**: Contains flow definitions, including nodes, edges, and components, stored as JSON or database records. For more information, see [Build flows](/concepts-flows). +• **Folder**: Provides a structure for flow storage, including single-user folders and shared folders accessed by multiple users. For more information, see [Manage flows in projects](/concepts-flows#projects). + • **Message**: Stores chat messages and interactions that occur between components. For more information, see [Message objects](/data-types#message) and [Store chat memory](#store-chat-memory). -• **Transaction**: Records execution history and results of flow runs. This information is used for [logging](/logging). +• **Transactions**: Records execution history and results of flow runs. This information is used for [logging](/logging). -• **ApiKey**: Manages Langflow API authentication keys. Component API keys are stored in the **Variables** table. For more information, see [API keys and authentication](/api-keys-and-authentication). - -• **Project**: Provides a structure for flow storage, including single-user projects and shared projects accessed by multiple users. For more information, see [Manage flows in projects](/concepts-flows#projects). +• **User**: Stores user account information including credentials, permissions, profiles, and user management settings. For more information, see [API keys and authentication](/api-keys-and-authentication). • **Variables**: Stores global encrypted values and credentials. For more information, see [Global variables](/configuration-global-variables). @@ -54,35 +56,47 @@ LANGFLOW_DATABASE_URL=postgresql://user:password@localhost:5432/langflow For an example, see [Configure an external PostgreSQL database](/configuration-custom-database). -### Configure the external database connection +The `LANGFLOW_DB_CONNECTION_SETTINGS` is a JSON configuration for database connection pool settings that allows you to fine-tune your database connection pool and timeout settings. -The following settings allow you to fine-tune your database connection pool and timeout settings: -``` +```bash LANGFLOW_DB_CONNECTION_SETTINGS='{"pool_size": 20, "max_overflow": 30, "pool_timeout": 30, "pool_pre_ping": true, "pool_recycle": 1800, "echo": false}' -LANGFLOW_DB_CONNECT_TIMEOUT=20 ``` -- `pool_size`: Maximum number of database connections to keep in the pool (default: 20) -- `max_overflow`: Maximum number of connections that can be created beyond the pool_size (default: 30) -- `pool_timeout`: Number of seconds to wait before timing out on getting a connection from the pool (default: 30) -- `pool_pre_ping`: If true, the pool tests connections for liveness upon each checkout (default: true) -- `pool_recycle`: Number of seconds after which a connection is automatically recycled (default: 1800, or 30 minutes) -- `echo`: If true, SQL queries are logged for debugging purposes (default: false) -- `LANGFLOW_DB_CONNECT_TIMEOUT`: Maximum number of seconds to wait when establishing a new database connection (default: 20) +### Connection pool parameters +- `pool_size`: Maximum number of database connections to keep in the pool. Default: 20 connections. +- `max_overflow`: Maximum number of connections that can be created beyond the pool_size. Default: 30 connections. +- `pool_timeout`: Number of seconds to wait before timing out on getting a connection from the pool. Default: 30 seconds. +- `pool_pre_ping`: If `true`, the pool tests connections for liveness upon each checkout. Default: `true`. +- `pool_recycle`: Number of seconds after which a connection is automatically recycled. Default: 1800 seconds (30 minutes). +- `echo`: If `true`, SQL queries are logged for debugging purposes. Default: `false`. ## Configure cache memory The default Langflow caching behavior is an asynchronous, in-memory cache. ``` LANGFLOW_LANGCHAIN_CACHE=InMemoryCache -LANGFLOW_CACHE_TYPE=Async +LANGFLOW_CACHE_TYPE=async ``` -Alternative caching options can be configured, but options other than the default asynchronous, in-memory cache aren't supported. +Langflow officially supports only the default asynchronous, in-memory cache. Other backends are experimental and may change without notice. The default behavior is suitable for most use cases. -For other options, see the `LANGFLOW_CACHE_TYPE` [environment variable](/environment-variables). +:::warning +Redis and other external cache settings are experimental and not officially supported. +::: + +### Cache environment variables + +| Variable | Type | Default | Description | +|----------|------|---------|-------------| +| `LANGFLOW_CACHE_TYPE` | String | `async` | Set the cache type for Langflow's internal caching system. | +| `LANGFLOW_LANGCHAIN_CACHE` | String | `InMemoryCache` | Set the cache type for Langchain's caching system. | +| `LANGFLOW_REDIS_HOST` | String | `localhost` | Redis server hostname. | +| `LANGFLOW_REDIS_PORT` | Integer | `6379` | Redis server port. | +| `LANGFLOW_REDIS_DB` | Integer | `0` | Redis database number. | +| `LANGFLOW_REDIS_CACHE_EXPIRE` | Integer | `3600` | Cache expiration time in seconds. | +| `LANGFLOW_REDIS_PASSWORD` | String | Not set | Redis authentication password (optional). | ## Store chat memory