跳转到主要内容

The two modes

Every chat request in FIM One starts with a question: is an Agent selected? The answer determines how resources — Connectors, Knowledge Bases, Skills, and MCP servers — are discovered and assembled into the tool set the LLM can use. Agent-Constrained Mode activates when the user picks a specific Agent. The system loads only the resources that Agent has been explicitly configured with:
  • Connectors: only the Agent’s bound connector_ids are loaded as tools.
  • Knowledge Bases: only the Agent’s bound kb_ids are injected as retrieval tools.
  • Skills: globally available when the Skills module is enabled (it is off by default) — all active Skills visible to the user are injected, because Skills are organizational SOPs, not Agent-specific knowledge. (See Skills as Global SOPs below.)
  • MCP Servers: only the Agent’s bound mcp_server_ids are loaded; an Agent with none bound gets no MCP tools.
  • Instructions: the Agent’s instructions field defines the persona and behavioral guidelines injected into the system prompt.
Global Auto-Discovery Mode activates when no Agent is selected (e.g., a new chat). The system auto-discovers everything accessible to the user:
  • Connectors: all Connectors visible to the user (own + subscribed from an organization or the Market) are loaded.
  • Knowledge Bases: the user’s own KBs are available for retrieval via kb_retrieve (knowledge bases cannot be shared).
  • Skills: all active Skills visible to the user are injected as SOP stubs.
  • MCP Servers: all active servers visible to the user.
  • Instructions: a generic assistant persona is used.
The branching happens inside _resolve_tools(), which is called on every chat request: The practical effect: users can start chatting immediately without configuring an Agent. The system discovers available resources and exposes them as tools. Selecting an Agent narrows the scope — it does not unlock new capabilities, it focuses existing ones.

What each mode discovers

The two modes differ in scope, not in kind. Both produce a ToolRegistry — they just fill it differently. Auto-Discovery Mode (no Agent selected): Agent-Constrained Mode (Agent selected): The key asymmetry: Connectors, Knowledge Bases and MCP Servers are scoped by the Agent, but Skills remain global in both modes. CallAgentTool (agent delegation) is only available in Auto-Discovery mode — it is not registered when a specific Agent is selected. This is a security measure: a marketplace agent could otherwise use call_agent to invoke other agents and access their private prompts. Skills are organizational rules (everyone follows the same SOPs), while Connectors and KBs are capability bindings (different agents connect to different systems).

一切皆工具

在 LLM 层面,所有资源类型汇聚成一个平面的可调用工具列表。LLM 对于它调用的是连接器、MCP 服务器还是知识库没有结构化认知。它看到的是 ToolRegistry — 一组具有名称、描述和参数模式的函数。 关键洞察:智能体不是工具 — 它是使用工具的实体。 智能体将其指令贡献给系统提示,并确定哪些工具可用。但从 LLM 的角度来看,不存在”智能体”概念 — 只有系统提示和一组可调用函数。 这种统一性使系统具有可扩展性。添加新的资源类型意味着实现 Tool 协议(name、description、parameters_schema、run())。执行引擎、上下文管理和 LLM 交互层保持不变。

技能作为全局标准操作流程

技能位于智能体之上的一个层级。它们是组织政策和流程,每个智能体都必须遵循,无论选择哪个智能体。

为什么技能不绑定到智能体

像”客户投诉处理标准操作程序”这样的技能适用于与客户互动的每个智能体。将技能绑定到智能体会产生双向所有权问题:如果技能协调智能体,而智能体拥有技能,谁来控制谁? 技能在设计上是全局的——它们是公司规则,而不是智能体特定的知识。_resolve_tools() 函数加载所有对用户可见的活跃技能,无论智能体选择如何,使用与其他资源相同的 resolve_visibility() 过滤器。

两种注入模式

技能支持两种注入模式 — 渐进式(默认)和内联式 — 由 SKILL_TOOL_MODE 或智能体的 model_config_json.skill_tool_mode 控制。在渐进式模式下,系统提示中仅显示紧凑的存根;LLM 按需调用 read_skill(name) 来加载完整内容。这是 FIM One 更广泛的渐进式披露架构的一部分,该架构可最小化所有资源类型的上下文消耗。

Agent as persona, not container

FIM One’s architecture reflects a deliberate shift from an Agent-centric model to a Resource-centric model. Previous model: the Agent was a container that gated access to all resources. No Agent selected meant no Connectors, no Skills, no specialized KB. The Agent was the mandatory entry point for any capability. Current model: the Agent is a persona — a set of instructions and behavioral guidelines — combined with an optional resource constraint. Resources exist independently of Agents. Selecting an Agent narrows the scope; not selecting one opens it fully. This means:
  • Users can start chatting immediately without configuring an Agent.
  • The system auto-discovers available resources and exposes them as tools.
  • Agents become lightweight personas that can be created quickly — just write instructions and optionally bind specific Connectors and KBs.
  • Resource management is decoupled from Agent management. Publishing a Connector to an organization makes it available to every member who subscribes to it — in auto-discovery mode, in Agent binding dropdowns, and in agent delegation resolution.

智能体委派

FIM One 支持通过 CallAgentTool 将任务委派给专家智能体 — 但仅在自动模式下(未选择智能体)。当用户选择特定智能体时,委派被禁用,该智能体专注于其自身工具。

Two modes: Auto vs Agent-selected

Why delegation is disabled in Agent-selected mode: Security. A marketplace agent could use call_agent to invoke other agents and read their private system prompts. By restricting delegation to Auto mode — where the system LLM (not any individual agent’s prompt) controls the flow — private agent prompts are never exposed to untrusted agent configurations.

自动模式作为编排层

自动模式是 UI 中的一流概念。智能体选择器将”自动”显示为默认选项。当自动模式处于活跃状态时,系统 LLM 充当编排器:它可以看到所有可见智能体的完整目录,并可以在每次迭代中将任务委派给最合适的专家。这消除了对专门”父智能体”的需求——系统本身就是编排器。

智能体目录

在运行时,所有对用户可见的活跃非构建器智能体都被组装到一个目录中。每个智能体的名称和描述都列在 call_agent 工具的参数模式中,允许 LLM 根据语义选择合适的专家 — 无需硬编码路由。

Full tool inheritance

When a delegated agent is invoked via call_agent(agent_id, task), it is assembled the way a chat with that agent is: a complete ToolRegistry built from its own configuration — its bound Connectors, Knowledge Bases and MCP servers (connected for the duration of the call) and its built-in tool categories — together with its own approval gate. Delegated agents are full execution units, not text-only advisors. An agent that has been switched off or is no longer visible to the user when it is called is reported as unavailable instead of being run.

一级委托

为了防止无限递归,被委托的智能体不会接收 call_agent 工具。委托始终是一级深度:自动模式调用专家,专家执行并返回结果。系统综合来自多个被委托智能体的结果。

并行执行

在原生函数调用模式下,LLM 可以在单个回合中调用多个 call_agent 调用。这些调用通过 asyncio.gather 并发执行,支持”同时搜索三个源”等模式。

Visibility model

All resource discovery — in both modes — is governed by a unified visibility model with two tiers: The resolve_visibility() function in web/visibility.py builds a SQL filter that covers both tiers in a single query:
This same filter is used everywhere:
  • Auto-discovering Connectors in no-agent mode
  • Building the Agent catalog for CallAgentTool
  • Loading visible Skills for system prompt injection
  • MCP server resolution
  • Agent configuration lookup (ensuring a user can only select Agents visible to them)
The uniformity means that a Connector published to an organization becomes available to its subscribers in auto-discovery mode, in Agent binding dropdowns, and in agent delegation resolution — no special wiring required. The visibility model is the single source of truth for “what can this user access.”

Relationship map

FIM One has two parallel execution paradigms — Chat (Agent-driven) and Workflow (DAG-driven) — that share the same underlying resources but orchestrate them differently. Key takeaways from the diagram:
  • Agent and Workflow are parallel paradigms. Both can use Connectors, Knowledge Bases, and MCP Servers — but through different mechanisms. Agents use them as tools in a ToolRegistry; Workflows use them as typed DAG nodes.
  • Workflow can orchestrate Agents via the AGENT node — a Workflow step can invoke a full Agent with its own ReAct/DAG loop. The reverse also works: an Agent can run a Workflow through the run_workflow tool when the Workflows module is enabled, except workflows that contain a Human Intervention step.
  • Skills are injected into Agents only. Skills are system prompt text — they guide Agent behavior. Workflows don’t consume Skills because Workflow nodes execute deterministic logic, not LLM-guided reasoning.
  • Shared resources, different access patterns. A Connector can be called by an Agent (via ConnectorToolAdapter), by a Workflow (via CONNECTOR node), or by both in the same business process — e.g., a Workflow triggers an Agent that queries the same Connector the Workflow also uses in a later step.

Workflow Engine — the other execution paradigm

While this document focuses on Agent-driven chat execution, FIM One includes a full Workflow Engine — a visual DAG editor with 9 node types for fixed-process automation. It is an optional module, off by default. The two paradigms are complementary. Use Agents when the task is open-ended (“analyze this quarter’s sales data and recommend actions”). Use Workflows when the process is known (“every Monday, pull new invoices from ERP, run compliance checks, and route exceptions to a human reviewer”). A Workflow can invoke an Agent for any step that needs flexible reasoning within an otherwise fixed pipeline. For details on Agent execution modes and Workflow node types, see Execution Modes.