LangSmith 使用 Redis 支持我们的队列/缓存操作。默认情况下,LangSmith 自托管将使用内部 Redis 实例。但是,您可以配置 LangSmith 使用外部 Redis 实例。通过配置外部 Redis 实例,您可以更轻松地管理 Redis 实例的备份、扩展和其他操作任务。

要求

  • 您的 LangSmith 实例将具有网络访问权限的已配置 Redis 实例。我们建议使用托管 Redis 服务,例如:
  • 注意:我们仅正式支持 Redis 版本 >= 5。
  • 我们不支持 Redis 集群。
  • 默认情况下,我们建议至少具有 2 个 vCPU 和 8GB 内存的实例。但是,实际要求将取决于您的跟踪工作负载。我们建议监控您的 Redis 实例并根据需要扩展。
某些层级的托管 Redis 服务可能在幕后使用 Redis 集群,但您可以指向集群中的单个节点。例如,在 Azure Cache for Redis 上,Premium 层及更高层使用 Redis 集群,因此您需要使用较低层。

Connection String

We use redis-py to connect to Redis. This library supports a variety of connection strings. You can find more information on the connection string format here. You will need to assemble the connection string for your Redis instance. This connection string should include the following information:
  • Host
  • Database
  • Port
  • URL params
This will take the form of:
"redis://host:port/db?<url_params>"
An example connection string might look like:
"redis://langsmith-redis:6379/0"
To use SSL, you can use the rediss:// prefix. An example connection string with SSL might look like:
"rediss://langsmith-redis:6380/0?password=foo"

Configuration

With your connection string in hand, you can configure your LangSmith instance to use an external Redis instance. You can do this by modifying the values file for your LangSmith Helm Chart installation or the .env file for your Docker installation.
redis:
  external:
    enabled: true
    connectionUrl: "Your connection url"
Once configured, you should be able to reinstall your LangSmith instance. If everything is configured correctly, your LangSmith instance should now be using your external Redis instance.
Connect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.