Skip to main content
LibreChat is joining ClickHouse to power the open-source Agentic Data Stack 🎉 Learn more
LibreChat

Agents 端点对象结构

此页面适用于 agents endpoint。

示例

endpoints:
  agents:
    recursionLimit: 50
    maxRecursionLimit: 100
    disableBuilder: false
    # (optional) Agent Capabilities available to all users. Omit the ones you wish to exclude. Defaults to list below.
    # capabilities: ["deferred_tools", "execute_code", "file_search", "web_search", "artifacts", "subagents", "actions", "context", "skills", "tools", "chain", "ocr"]
    # (optional) File citation configuration for file_search capability
    maxCitations: 30 # Maximum total citations in responses (1-50)
    maxCitationsPerFile: 7 # Maximum citations from each file (1-10)
    minRelevanceScore: 0.45 # Minimum relevance score threshold (0.0-1.0)
    titleTiming: immediate
    skills:
      maxCatalogSkills: 20

此配置启用了用于 Agent 的构建器界面。

recursionLimit

KeyTypeDescriptionExample
recursionLimitNumber设置代理在一次运行中可以执行的默认步数。Controls recursion depth to prevent infinite loops. When limit is reached, raises GraphRecursionError. This value can be configured from the UI up to the maxRecursionLimit.

默认值: 25

示例:

recursionLimit: 50

有关 agent 步骤的更多信息,请参阅 Max Agent Steps

maxRecursionLimit

KeyTypeDescriptionExample
maxRecursionLimitNumber设置代理在单次运行中可采取的最大步数。Defines the upper limit for the recursionLimit that can be set from the UI. This prevents users from setting excessively high values.

默认值: 如果省略,则默认为 recursionLimit 的值;如果 recursionLimit 也被省略,则默认为 50。

示例:

maxRecursionLimit: 100

有关 agent 步骤的更多信息,请参阅 Max Agent Steps

titleTiming

KeyTypeDescriptionExample
titleTimingString控制何时为 agents endpoint 生成对话标题。有效值:"immediate" 或 "final"。Defaults to "immediate".

默认值: "immediate"

可用值:

  • "immediate": 在请求开始时立即生成标题,与模型响应并行,并使用用户的首条消息。
  • "final": 将标题生成推迟到完整响应完成后进行。这保留了旧有的行为。

示例:

titleTiming: immediate

disableBuilder

KeyTypeDescriptionExample
disableBuilderBoolean控制智能体构建器界面的可见性与使用。When set to `true`, disables the builder interface for the agent, limiting direct manual interaction.

默认值: false

示例:

disableBuilder: false

allowedProviders

KeyTypeDescriptionExample
allowedProvidersArray/List of Strings指定允许与 Agents 功能配合使用的 endpoint 提供商列表(例如 "openAI"、"anthropic"、"google")。If defined, only agents configured with these providers can be initialized. If omitted or empty, all configured providers are allowed.

默认值: [](空列表,允许所有提供商)

注意: 必须是以下选项之一,或者是在您的 configuration 中定义的自定义 endpoint 名称: - openAI, azureOpenAI, google, anthropic, assistants, azureAssistants, bedrock

示例:

allowedProviders:
  - openAI
  - google

capabilities

KeyTypeDescriptionExample
capabilitiesArray/List of Strings指定可供所有用户在 agents endpoint 中使用的智能体功能。Defines the agent capabilities that are available to all users for the agents endpoint. You can omit the capabilities you wish to exclude from the list.

默认值: ["deferred_tools", "execute_code", "file_search", "web_search", "artifacts", "subagents", "actions", "context", "skills", "tools", "chain", "ocr"]

示例:

capabilities:
  - 'deferred_tools'
  - 'execute_code'
  - 'file_search'
  - 'web_search'
  - 'artifacts'
  - 'subagents'
  - 'actions'
  - 'context'
  - 'skills'
  - 'tools'
  - 'chain'
  - 'ocr'

注意: 此字段为可选字段。如果省略,默认行为是包含 default 中列出的所有功能。

skills

控制代理的 endpoint 级别 Skills 设置。

KeyTypeDescriptionExample
skills.maxCatalogSkillsNumber限制模型可见目录中可用的活跃 Skill 数量。必须介于 1 到 100 之间。maxCatalogSkills: 20

默认值: 没有超出运行时目录限制的已配置上限。

示例:

skills:
  maxCatalogSkills: 20

这不会禁用 Skills。请使用 skills 功能以及针对每个 agent/model-spec 的技能范围界定来控制 Skills 是否可用。

maxCitations

KeyTypeDescriptionExample
maxCitationsNumber控制单个智能体响应中可包含的引用总数上限。When using file_search capability, limits the total number of source citations returned to prevent overwhelming responses while ensuring comprehensive coverage.

默认值: 30

范围: 1-50

示例:

maxCitations: 30

maxCitationsPerFile

KeyTypeDescriptionExample
maxCitationsPerFileNumber限制可从单个文件中提取的最大引用数量。Ensures citation diversity by preventing any single file from dominating the citations, encouraging representation from multiple sources.

默认值: 7

范围: 1-10

示例:

maxCitationsPerFile: 7

minRelevanceScore

KeyTypeDescriptionExample
minRelevanceScoreNumber设置源文件包含在响应中所需的最低相关性得分阈值。Filters out low-quality matches based on vector similarity scores. Higher values (e.g., 0.7) ensure only highly relevant sources are cited, while lower values (e.g., 0.0) include all sources regardless of quality.

默认值: 0.45(45% 相关性阈值)

范围: 0.0-1.0

示例:

minRelevanceScore: 0.45

文件引用配置示例

默认配置(平衡)

endpoints:
  agents:
    maxCitations: 30
    maxCitationsPerFile: 7
    minRelevanceScore: 0.45

提供全面的引用,同时防止回复内容过多并过滤掉低质量的匹配结果。

严格配置(高质量)

endpoints:
  agents:
    maxCitations: 10
    maxCitationsPerFile: 3
    minRelevanceScore: 0.7

仅包含高度相关的引用,并设有严格限制以确保回复聚焦。

全面配置(研究)

endpoints:
  agents:
    maxCitations: 50
    maxCitationsPerFile: 10
    minRelevanceScore: 0.0

针对详尽研究任务的最大化信息提取,包括所有来源,无论其相关性如何。

智能体功能 (Agent Capabilities)

capabilities 字段允许您为智能体启用或禁用特定功能。可用的功能包括:

  • deferred_tools: 允许智能体在运行时发现延迟加载的 MCP 工具,而不是预先将所有工具加载到上下文中。
  • execute_code: 允许智能体执行代码。
  • file_search: 允许 agent 搜索并与文件进行交互。启用后,引用行为由 maxCitationsmaxCitationsPerFileminRelevanceScore 设置控制。
  • web_search: 为智能体启用网络搜索功能,允许其搜索并从互联网检索信息。
  • artifacts: 允许智能体生成交互式工件(React 组件、HTML、Mermaid 图表)。
  • subagents: 启用隔离上下文的子智能体运行。请参阅 Subagents
  • actions: 允许智能体执行预定义的操作。
  • context: 启用聊天中的“上传为文本”功能以及智能体的“文件上下文”功能,允许用户上传文件,并将其内容提取并直接包含在对话中。
  • skills: 在侧边栏中启用 Skills,支持手动 $ 调用、模型调用的 Skills 以及智能体技能白名单。请参阅 Skills
  • tools: 授予代理访问各种工具的权限。
  • chain: 启用代理链(Agent Chaining)的 Beta 功能,也称为智能体混合(Mixture-of-Agents,简称 MoA)工作流。
  • ocr: 可选功能,用于增强聊天中的“上传为文本”以及智能体的“文件上下文”功能,允许上传文件并使用 OCR 进行处理。需要配置 OCR 服务。

通过指定功能,您可以控制用户在与智能体交互时可使用的特性。

示例配置

以下是配置 agents endpoint 并设置自定义能力和文件引用功能的示例:

endpoints:
  agents:
    disableBuilder: false
    # File citation configuration
    maxCitations: 20
    maxCitationsPerFile: 5
    minRelevanceScore: 0.6
    # Custom capabilities
    capabilities:
      - 'execute_code'
      - 'file_search'
      - 'skills'
      - 'subagents'
      - 'actions'
      - 'artifacts'
      - 'context'
      - 'ocr'
      - 'web_search'

在此示例中:

  • 构建器界面已启用
  • 文件引用总数限制为 20 个,每个文件最多 5 个。
  • 仅包含相关性在 60% 以上的来源
  • LibreChat Agents 可以访问代码执行、文件搜索(带引用)、Skills、Subagents、actions、artifacts、文件上下文、OCR 服务(如果已配置)以及网络搜索功能。

子代理 (Subagents)

subagents 字段用于控制当 subagents 功能可用时,父 Agent 可以生成的独立子 Agent。

KeyTypeDescriptionExample
enabledBoolean当为 true 时,将子代理生成工具添加到此代理。默认:禁用。enabled: true
allowSelfBoolean允许智能体在全新的隔离上下文中生成自身。默认值:true。allowSelf: true
agent_idsArray/List of Strings此智能体可以生成的特定智能体。最多:10 个。agent_ids: ["agent_researcher"]
subagents:
  enabled: true
  allowSelf: true
  agent_ids:
    - 'agent_researcher'
    - 'agent_reviewer'

有关面向用户的行为和限制,请参阅 Subagents

注意事项

  • 除非您正在使用 modelSpecs 来定义可供选择的智能体列表,否则不建议禁用构建器界面。
  • 文件引用配置(maxCitationsmaxCitationsPerFileminRelevanceScore)仅在启用了 file_search 功能时生效。
  • 相关性得分是使用向量相似度计算得出的,其中 1.0 表示完全匹配,0.0 表示完全不相似。
  • 引用限制有助于在全面的信息检索与响应质量及性能之间取得平衡。
  • context 功能无需 OCR 配置即可通过文本解析方法工作。配置 OCR 后可提升提取质量。
  • ocr 功能需要配置 OCR 服务(请参阅 OCR 配置)。

这篇指南怎么样?