You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -14,11 +14,12 @@ English | [中文](README.zh_CN.md)
14
14
15
15
# Overview
16
16
17
-
**Eino['aino]** (pronounced similarly to "I know") aims to be the ultimate LLM application development framework in Golang. Drawing inspirations from many excellent LLM application development frameworks in the open-source community such as LangChain & LlamaIndex, etc., as well as learning from cutting-edge research and real world applications, Eino offers an LLM application development framework that emphasizes on simplicity, scalability, reliability and effectiveness that better aligns with Golang programming conventions.
17
+
**Eino['aino]** (pronounced similarly to "I know") aims to be the ultimate LLM application development framework in Golang. Drawing inspirations from many excellent LLM application development frameworks in the open-source community such as LangChain & Google ADK, etc., as well as learning from cutting-edge research and real world applications, Eino offers an LLM application development framework that emphasizes on simplicity, scalability, reliability and effectiveness that better aligns with Golang programming conventions.
18
18
19
19
What Eino provides are:
20
20
- a carefully curated list of **component** abstractions and implementations that can be easily reused and combined to build LLM applications
21
21
- a powerful **composition** framework that does the heavy lifting of strong type checking, stream processing, concurrency management, aspect injection, option assignment, etc. for the user.
22
+
- an **Agent Development Kit (ADK)** that provides high-level abstractions for building AI agents with multi-agent orchestration, human-in-the-loop interrupts, and prebuilt agent patterns.
22
23
- a set of meticulously designed **API** that obsesses on simplicity and clarity.
23
24
- an ever-growing collection of best practices in the form of bundled **flows** and **examples**.
24
25
- a useful set of tools that covers the entire development cycle, from visualized development and debugging to online tracing and evaluation.
Now let's create a 'ReAct' agent: A ChatModel binds to Tools. It receives input Messages and decides independently whether to call the Tool or output the final result. The execution result of the Tool will again become the input Message for the ChatModel and serve as the context for the next round of independent judgment.
144
-
145
-

146
-
147
-
We provide a complete implementation for ReAct Agent out of the box in the `flow` package. Check out the code here: [flow/agent/react](https://github.com/cloudwego/eino/blob/main/flow/agent/react/react.go)
148
-
149
-
Our implementation of ReAct Agent uses Eino's **graph orchestration** exclusively, which provides the following benefits out of the box:
144
+
Eino's **graph orchestration** provides the following benefits out of the box:
150
145
- Type checking: it makes sure the two nodes' input and output types match at compile time.
151
146
- Stream processing: concatenates message stream before passing to chatModel and toolsNode if needed, and copies the stream into callback handlers.
152
147
- Concurrency management: the shared state can be safely read and written because the StatePreHandler is concurrency safe.
Now let's create a 'ReAct' agent: A ChatModel binds to Tools. It receives input Messages and decides independently whether to call the Tool or output the final result. The execution result of the Tool will again become the input Message for the ChatModel and serve as the context for the next round of independent judgment.
180
+
181
+

182
+
183
+
Eino's **Agent Development Kit (ADK)** provides `ChatModelAgent` that implements this pattern out of the box:
iter:= runner.Query(ctx, "What's the weather in Beijing this weekend?")
199
+
for {
200
+
event, ok:= iter.Next()
201
+
if !ok {
202
+
break
203
+
}
204
+
// process agent events (model outputs, tool calls, etc.)
205
+
}
206
+
```
207
+
208
+
The ADK handles the ReAct loop internally, emitting events for each step of the agent's reasoning process.
209
+
210
+
Beyond the basic ReAct pattern, ADK provides powerful capabilities for building production-ready agent systems:
211
+
212
+
**Multi-Agent with Context Management**: Agents can transfer control to sub-agents or be wrapped as tools. The framework automatically manages conversation context across agent boundaries:
213
+
214
+
```Go
215
+
// Set up agent hierarchy - mainAgent can now transfer to sub-agents
- Graph orchestration is powerful and flexible enough to implement complex business logic:
202
294
- type checking, stream processing, concurrency management, aspect injection and option assignment are handled by the framework.
203
295
- branch out execution at runtime, read and write global state, or do field level data mapping using workflow(currently in alpha stage).
296
+
-**Aspects (Callbacks)** handle cross-cutting concerns such as logging, tracing, and metrics. Five aspects are supported: OnStart, OnEnd, OnError, OnStartWithStreamInput, OnEndWithStreamOutput. Custom callback handlers can be added during graph run via options.
297
+
298
+
## Agent Development Kit (ADK)
204
299
300
+
While graph orchestration gives you fine-grained control, the **ADK** package provides higher-level abstractions optimized for building AI agents:
301
+
302
+
-**ChatModelAgent**: A ReAct-style agent that handles tool calling, conversation state, and the reasoning loop automatically.
303
+
-**Multi-Agent with Context Engineering**: Build hierarchical agent systems where conversation history is automatically managed across agent transfers and agent-as-tool invocations, enabling seamless context sharing between specialized agents.
304
+
-**Workflow Agents**: Compose agents using `SequentialAgent`, `ParallelAgent`, and `LoopAgent` for complex execution flows.
305
+
-**Human-in-the-Loop**: `Interrupt` and `Resume` mechanisms with checkpoint persistence for workflows requiring human approval or input.
306
+
-**Prebuilt Patterns**: Ready-to-use implementations including Deep Agent (task orchestration), Supervisor (hierarchical coordination), and Plan-Execute-Replan.
307
+
-**Agent Middlewares**: Extensible middleware system for adding tools (filesystem operations) and managing context (token reduction).
| Collect | Accepts stream type StreamReader[I] and returns non-stream type O |
222
325
| Transform | Accepts stream type StreamReader[I] and returns stream type StreamReader[O]|
223
326
224
-
## Highly Extensible Aspects (Callbacks)
225
-
226
-
- Aspects handle cross-cutting concerns such as logging, tracing, metrics, etc., as well as exposing internal details of component implementations.
227
-
- Five aspects are supported: **OnStart, OnEnd, OnError, OnStartWithStreamInput, OnEndWithStreamOutput**.
228
-
- Developers can easily create custom callback handlers, add them during graph run via options, and they will be invoked during graph run.
229
-
- Graph can also inject aspects to those component implementations that do not support callbacks on their own.
230
-
231
327
# Eino Framework Structure
232
328
233
329

234
330
235
331
The Eino framework consists of several parts:
236
332
237
-
- Eino(this repo): Contains Eino's type definitions, streaming mechanism, component abstractions, orchestration capabilities, aspect mechanisms, etc.
333
+
- Eino(this repo): Contains Eino's type definitions, streaming mechanism, component abstractions, orchestration capabilities, agent implementations, aspect mechanisms, etc.
238
334
239
335
-[EinoExt](https://github.com/cloudwego/eino-ext): Component implementations, callback handlers implementations, component usage examples, and various tools such as evaluators, prompt optimizers.
0 commit comments