|
1 | 1 | --- |
2 | 2 | Description: "" |
3 | | -date: "2025-02-11" |
| 3 | +date: "2025-07-21" |
4 | 4 | lastmod: "" |
5 | 5 | tags: [] |
6 | | -title: 'Eino: Chain & Graph & Workflow Orchestration' |
7 | | -weight: 0 |
| 6 | +title: 'Eino: Chain & Graph & Workflow 编排功能' |
| 7 | +weight: 2 |
8 | 8 | --- |
9 | 9 |
|
10 | | -In LLM applications, `Components` are the smallest units that provide "atomic capabilities," such as: |
| 10 | +在大模型应用中,`Components` 组件是提供 『原子能力』的最小单元,比如: |
11 | 11 |
|
12 | | -- `ChatModel` provides the conversation capability of LLM |
13 | | -- `Embedding` provides semantic-based text vectorization capabilities |
14 | | -- `Retriever` provides relevant content retrieval capabilities |
15 | | -- `ToolsNode` provides the capability to execute external tools |
| 12 | +- `ChatModel` 提供了大模型的对话能力 |
| 13 | +- `Embedding` 提供了基于语义的文本向量化能力 |
| 14 | +- `Retriever` 提供了关联内容召回的能力 |
| 15 | +- `ToolsNode` 提供了执行外部工具的能力 |
16 | 16 |
|
17 | | -> For detailed information on components, refer to: [Eino: Components](/docs/eino/core_modules/components) |
| 17 | +> 详细的组件介绍可以参考: [Eino: Components 组件](/zh/docs/eino/core_modules/components) |
18 | 18 |
|
19 | | -An LLM application, in addition to needing these atomic capabilities, also needs to **combine and sequence** these atomic capabilities based on contextual business logic. This is called **Orchestration**. |
| 19 | +一个大模型应用,除了需要这些原子能力之外,还需要根据场景化的业务逻辑,**对这些原子能力进行组合、串联**,这就是 **『编排』**。 |
20 | 20 |
|
21 | | -Developing LLM applications has its own typical characteristics: The custom business logic itself is usually not very complex, primarily involving the combination and sequencing of "atomic capabilities." |
| 21 | +大模型应用的开发有其自身典型的特征: 自定义的业务逻辑本身不会很复杂,几乎主要都是对『原子能力』的组合串联。 |
22 | 22 |
|
23 | | -In traditional code development, business logic is expressed through "code execution logic." When transitioning to LLM application development, the most straightforward approach is "to call components manually and use the results as inputs for subsequent component calls." Such an approach results in `messy code`, `difficulty in reuse`, and `lack of aspect-oriented capabilities`... |
| 23 | +传统代码开发过程中,业务逻辑用 “代码的执行逻辑” 来表达,迁移到大模型应用开发中时,最直接想到的方法就是 “自行调用组件,自行把结果作为下一组件的输入进行调用”。这样的结果,就是 `代码杂乱`、`很难复用`、`没有切面能力`…… |
24 | 24 |
|
25 | | -When developers pursue code that is '**elegant**' and follows the '**clean code principles**,' they find a significant gap when applying traditional code organization methods to LLM applications. |
| 25 | +当开发者们追求代码『**优雅**』和『**整洁之道**』时,就发现把传统代码组织方式用到大模型应用中时有着巨大的鸿沟。 |
26 | 26 |
|
27 | | -Eino's initial goal was to make LLM application development extremely simple, ensuring that the application code logic is "simple," "intuitive," "elegant," and "robust." |
| 27 | +Eino 的初衷是让大模型应用开发变得非常简单,就一定要让应用的代码逻辑 “简单” “直观” “优雅” “健壮”。 |
28 | 28 |
|
29 | | -Eino has the following insights into "Orchestration": |
| 29 | +Eino 对「编排」有着这样的洞察: |
30 | 30 |
|
31 | | -- Orchestration should become a clear layer on top of business logic, **without embedding business logic into orchestration**. |
32 | | -- The core of the LLM application is "sequencing and combining components that provide atomic capabilities," **with components being the "first citizens" of orchestration**. |
33 | | -- From an abstract perspective, orchestration builds a network where data flows through. Each node within the network has specific format/content requirements for the flowing data. The key to a seamlessly flowing data network is "**whether the data formats between upstream and downstream nodes are aligned**?". |
34 | | -- The complexity of business scenarios will be reflected in the complexity of orchestration artifacts. Only **horizontal governance capabilities** can keep complex scenarios under control. |
35 | | -- LLMs will continue to develop rapidly, and so will LLM applications. Only applications with **expansion capabilities** will have vitality. |
| 31 | +- 编排要成为在业务逻辑之上的清晰的一层,**不能让业务逻辑融入到编排中**。 |
| 32 | +- 大模型应用的核心是 “对提供原子能力的组件” 进行组合串联,**组件是编排的 “第一公民”**。 |
| 33 | +- 抽象视角看编排:编排是在构建一张网络,数据则在这个网络中流动,网络的每个节点都对流动的数据有格式/内容的要求,一个能顺畅流动的数据网络,关键就是 “**上下游节点间的数据格式是否对齐**?”。 |
| 34 | +- 业务场景的复杂度会反映在编排产物的复杂性上,只有**横向的治理能力**才能让复杂场景不失控。 |
| 35 | +- 大模型是会持续保持高速发展的,大模型应用也是,只有**具备扩展能力的应用才拥有生命力**。 |
36 | 36 |
|
37 | | -Therefore, Eino provides a solution for "orchestration based on the Graph model (node + edge), with **components** as atomic nodes and **upstream-downstream type alignment** as the foundation." |
| 37 | +于是,Eino 提供了 “基于 Graph 模型 (node + edge) 的,以**组件**为原子节点的,以**上下游类型对齐**为基础的编排” 的解决方案。 |
38 | 38 |
|
39 | | -Specifically, the following features are implemented: |
| 39 | +具体来说,实现了如下特性: |
40 | 40 |
|
41 | | -- Everything is centered around "components," standardizing the encapsulation of business functionalities, making **division of responsibilities clear** and **reuse** natural. |
42 | | - - For more details, refer to: [Eino: Components](/docs/eino/core_modules/components) |
43 | | -- The complexity of business logic is encapsulated within the components, giving the orchestration layer a more global perspective, making **logic layers very clear**. |
44 | | -- Provides aspect capabilities and a callback mechanism that supports node-based **unified governance capabilities**. |
45 | | - - For more details, refer to: [Eino: Callback Manual](/docs/eino/core_modules/chain_and_graph_orchestration/callback_manual) |
46 | | -- Provides a call option mechanism, **extensibility** is the most fundamental requirement of the system in rapid iterations. |
47 | | - - For more details, refer to: [Eino: CallOption capabilities and specification](/docs/eino/core_modules/chain_and_graph_orchestration/call_option_capabilities) |
48 | | -- Provides an enhanced "type alignment" development method, reducing the mental burden on developers and leveraging Go's **type safety** features. |
49 | | - - For more details, refer to: [Eino: The design concept of orchestration](/docs/eino/core_modules/chain_and_graph_orchestration/orchestration_design_principles) |
50 | | -- Provides an **"automated stream conversion"** capability, removing "stream" from the "source of complexity ranking" in the orchestration system. |
51 | | - - For more details, refer to: [Eino Points of Streaming Orchestration](/docs/eino/core_modules/chain_and_graph_orchestration/stream_programming_essentials) |
| 41 | +- 一切以 “组件” 为核心,规范了业务功能的封装方式,让**职责划分变得清晰**,让**复用**变成自然而然 |
| 42 | + - 详细信息参考:[Eino: Components 组件](/zh/docs/eino/core_modules/components) |
| 43 | +- 业务逻辑复杂度封装到组件内部,编排层拥有更全局的视角,让**逻辑层次变得非常清晰** |
| 44 | +- 提供了切面能力,callback 机制支持了基于节点的**统一治理能力** |
| 45 | + - 详细信息参考:[Eino: Callback 用户手册](/zh/docs/eino/core_modules/chain_and_graph_orchestration/callback_manual) |
| 46 | +- 提供了 call option 的机制,**扩展性**是快速迭代中的系统最基本的诉求 |
| 47 | + - 详细信息参考:[Eino: CallOption 能力与规范](/zh/docs/eino/core_modules/chain_and_graph_orchestration/call_option_capabilities) |
| 48 | +- 提供了 “类型对齐” 的开发方式的强化,降低开发者心智负担,把 golang 的**类型安全**特性发挥出来 |
| 49 | + - 详细信息参考:[Eino: 编排的设计理念](/zh/docs/eino/core_modules/chain_and_graph_orchestration/orchestration_design_principles) |
| 50 | +- 提供了 “**流的自动转换**” 能力,让 “流” 在「编排系统的复杂性来源榜」中除名 |
| 51 | + - 详细信息参考:[Eino 流式编程要点](/zh/docs/eino/core_modules/chain_and_graph_orchestration/stream_programming_essentials) |
52 | 52 |
|
53 | | -Graph itself is powerful and semantically complete, capable of rendering almost any "data flow network," such as "branching," "parallel," and "loop." |
| 53 | +Graph 本身是强大且语义完备的,可以用这项底层几乎绘制出所有的 “数据流动网络”,比如 “分支”、“并行”、“循环”。 |
54 | 54 |
|
55 | | -However, Graph is not without its drawbacks. Based on the "node" and "edge" model, Graph requires developers to use the `graph.AddXXXNode()` and `graph.AddEdge()` interfaces to create a data channel, which is powerful but somewhat complex. |
| 55 | +但 Graph 并不是没有缺点的,基于 “点” “边” 模型的 Graph 在使用时,要求开发者要使用 `graph.AddXXXNode()` 和 `graph.AddEdge()` 两个接口来创建一个数据通道,强大但是略显复杂。 |
56 | 56 |
|
57 | | -In most real-world business scenarios, simply "connecting in sequence" is often sufficient. Therefore, Eino encapsulates an easier-to-use interface called `Chain`. Chain is a wrapper around Graph, exposing almost all of Graph's capabilities except for "loops." |
| 57 | +而在现实的大多数业务场景中,往往仅需要 “按顺序串联” 即可,因此,Eino 封装了接口更易于使用的 `Chain`。Chain 是对 Graph 的封装,除了 “环” 之外,Chain 暴露了几乎所有 Graph 的能力。 |
0 commit comments