From a927f3a7603bd4bc07a1d60f51576fe2a9ac1572 Mon Sep 17 00:00:00 2001 From: Will Wilson Date: Sun, 8 Mar 2026 22:10:25 +0000 Subject: [PATCH] docs: fix chain architecture, YAML structure, recursionLimit, tool labels Address review feedback: - Correct chain capability description (UI config, not delegation mechanism) - Fix agent-to-agent linking description (edges/agent_ids, not tool registry) - Fix YAML to nest under endpoints.agents, remove maxContextTokens - Update recursionLimit to correct default - Clarify custom MCP tool IDs vs built-in tools Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- docs/docs/features/agent-chains.mdx | 34 ++++++++++++++++------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/docs/docs/features/agent-chains.mdx b/docs/docs/features/agent-chains.mdx index d59d2a275f..ae9582441b 100644 --- a/docs/docs/features/agent-chains.mdx +++ b/docs/docs/features/agent-chains.mdx @@ -36,7 +36,7 @@ User sees consolidated response ## How it works in LibreChat v0.8.3+ 1. **Agents are created in Agent Builder UI** — there is no JSON import; each agent must be created manually via the interface at `/agent-builder` -2. **Specialist agents appear as tools** — once created, any agent with the `tools` capability can call other agents as tools +2. **Specialist agents are linked via agent chains** — the orchestrator is configured with edges that reference other agents by `agent_ids`. Agents do not appear as built-in tools in the standard tool registry. 3. **Context is passed explicitly** — the orchestrator passes relevant information in its delegation call ## Minimal toolset principle @@ -45,7 +45,7 @@ Give each specialist agent **only** the tools it needs. An over-tooled agent is | Agent Type | Recommended Tools | |------------|------------------| -| Research | perplexica_search, navigate, snapshot | +| Research | perplexica_search, navigate, snapshot (Custom MCP tools) | | Action | domain-specific APIs, write operations | | Summariser | No tools (just processes input text) | | Data | execute_code, file_search | @@ -80,9 +80,13 @@ ALWAYS complete tool calls before responding to the user. NEVER generate placeholder text — call the tool immediately. ``` -### 3. Enable the `chain` capability +### 3. (Optional) Enable the Chain Capability -In the orchestrator's Agent Builder configuration, enable the **Chain** capability. This allows the agent to invoke other agents as tools. +In the orchestrator's Agent Builder configuration, the **Chain** capability controls the +Agent Builder UI for configuring sequential chains between this agent and specific other +agents (via `agent_ids`). It does **not** by itself enable agent-as-a-tool delegation — +that behavior comes from combining the **tools** capability with properly configured agent +handoffs. ## Delegation patterns @@ -110,20 +114,20 @@ User: "Find the current Bitcoin price and analyse the trend" |-------|----------| | Specialist agent not appearing as a tool | Ensure the specialist was saved in Agent Builder; refresh the orchestrator | | Orchestrator generates text instead of calling agent | Add explicit delegation instructions to system prompt; enable `tools` capability | -| Infinite loop between agents | Set `recursionLimit` in `librechat.yaml` agents config (default: 25) | +| Infinite loop between agents | Set `recursionLimit` in `librechat.yaml` under `endpoints.agents` (no hardcoded default; recommended: 50) | | Agent calls wrong specialist | Make delegation rules more specific in orchestrator system prompt | ## librechat.yaml configuration ```yaml -agents: - disableBuilder: false - recursionLimit: 25 - maxContextTokens: 32000 - capabilities: - - execute_code - - file_search - - artifacts - - tools - - chain +endpoints: + agents: + disableBuilder: false + recursionLimit: 50 + capabilities: + - execute_code + - file_search + - artifacts + - tools + - chain ```