eino README

The project's README from github.com/cloudwego/eino. As one markdown file: README.md.

Eino

coverage Release WebSite License Go Report Card OpenIssue ClosedIssue Stars Forks

English | 中文

Overview

Eino['aino] is an LLM application development framework in Golang. It draws from LangChain, Google ADK, and other open-source frameworks, and is designed to follow Golang conventions.

Eino provides:

Quick Start

ChatModelAgent

Configure a ChatModel, optionally add tools, and you have a working agent:

chatModel, _ := openai.NewChatModel(ctx, &openai.ChatModelConfig{
    Model:  "gpt-4o",
    APIKey: os.Getenv("OPENAI_API_KEY"),
})

agent, _ := adk.NewChatModelAgent(ctx, &adk.ChatModelAgentConfig{
    Model: chatModel,
})

runner := adk.NewRunner(ctx, adk.RunnerConfig{Agent: agent})
iter := runner.Query(ctx, "Hello, who are you?")
for {
    event, ok := iter.Next()
    if !ok {
        break
    }
    fmt.Println(event.Message.Content)
}

Add tools to give the agent capabilities:

agent, _ := adk.NewChatModelAgent(ctx, &adk.ChatModelAgentConfig{
    Model: chatModel,
    ToolsConfig: adk.ToolsConfig{
        ToolsNodeConfig: compose.ToolsNodeConfig{
            Tools: []tool.BaseTool{weatherTool, calculatorTool},
        },
    },
})

The agent handles the ReAct loop internally — it decides when to call tools and when to respond.

→ ChatModelAgent examples · docs

DeepAgent

For complex tasks, use DeepAgent. It breaks down problems into steps, delegates to sub-agents, and tracks progress:

deepAgent, _ := deep.New(ctx, &deep.Config{
    ChatModel: chatModel,
    SubAgents: []adk.Agent{researchAgent, codeAgent},
    ToolsConfig: adk.ToolsConfig{
        ToolsNodeConfig: compose.ToolsNodeConfig{
            Tools: []tool.BaseTool{shellTool, pythonTool, webSearchTool},
        },
    },
})

runner := adk.NewRunner(ctx, adk.RunnerConfig{Agent: deepAgent})
iter := runner.Query(ctx, "Analyze the sales data in report.csv and generate a summary chart")

DeepAgent can be configured to coordinate multiple specialized agents, run shell commands, execute Python code, and search the web.

→ DeepAgent example · docs

Composition

When you need precise control over execution flow, use compose to build graphs and workflows:

graph := compose.NewGraph[*Input, *Output]()
graph.AddLambdaNode("validate", validateFn)
graph.AddChatModelNode("generate", chatModel)
graph.AddLambdaNode("format", formatFn)

graph.AddEdge(compose.START, "validate")
graph.AddEdge("validate", "generate")
graph.AddEdge("generate", "format")
graph.AddEdge("format", compose.END)

runnable, _ := graph.Compile(ctx)
result, _ := runnable.Invoke(ctx, input)

Compositions can be exposed as tools for agents, bridging deterministic workflows with autonomous behavior:

tool, _ := graphtool.NewInvokableGraphTool(graph, "data_pipeline", "Process and validate data")

agent, _ := adk.NewChatModelAgent(ctx, &adk.ChatModelAgentConfig{
    Model: chatModel,
    ToolsConfig: adk.ToolsConfig{
        ToolsNodeConfig: compose.ToolsNodeConfig{
            Tools: []tool.BaseTool{tool},
        },
    },
})

This lets you build domain-specific pipelines with exact control, then let agents decide when to use them.

→ GraphTool examples · compose docs

Key Features

Component Ecosystem

Eino defines component abstractions (ChatModel, Tool, Retriever, Embedding, etc.) with official implementations for OpenAI, Claude, Gemini, Ark, Ollama, Elasticsearch, and more.

→ eino-ext

Stream Processing

Eino automatically handles streaming throughout orchestration: concatenating, boxing, merging, and copying streams as data flows between nodes. Components only implement the streaming paradigms that make sense for them; the framework handles the rest.

→ docs

Callback Aspects

Inject logging, tracing, and metrics at fixed points (OnStart, OnEnd, OnError, OnStartWithStreamInput, OnEndWithStreamOutput) across components, graphs, and agents.

→ docs

Interrupt/Resume

Any agent or tool can pause execution for human input and resume from checkpoint. The framework handles state persistence and routing.

→ docs · examples

Framework Structure

The Eino framework consists of:

Documentation

Dependencies

Code Style

This repo uses golangci-lint. Check locally with:

golangci-lint run ./...

Rules enforced:

Security

If you discover a potential security issue in this project, or think you may have discovered a security issue, we ask that you notify Bytedance Security via our security center or vulnerability reporting email.

Do not create a public GitHub issue.

Contact

    LarkGroup

License

This project is licensed under the Apache-2.0 License.

eino (cloudwego/eino)

Searching Database…

13.3K ·GitHub
这是什么?Eino 是一个面向 Go 语言的大模型(LLM)/AI 应用开发框架,设计思路借鉴了 LangChain 和 Google ADK。它提供可复用的组件(ChatModel、Tool、Retriever、ChatTemplate)、智能体开发套件,以及一个组合引擎,用于为 AI 应用搭建图和工作流。
这是一个完整的框架,还是只是一个组件库?这是一个完整的框架:它包含组件抽象、用于构建智能体的智能体开发套件(ADK),以及一个用于把组件连接成图和工作流的组合层;具体的组件实现则放在另一个仓库 EinoExt 中。
我该怎么开始用它构建智能体?配置一个 ChatModel(可选择是否带上工具)来创建 ChatModelAgent,它会自动运行 ReAct 循环;也可以使用 compose 来构建图和工作流,以精确控制执行流程;组合出来的结果还可以作为工具提供给智能体使用。
我需要什么版本的 Go,还要装哪些额外的包?需要 Go 1.18 或更高版本;具体的组件实现(OpenAI、Claude、Gemini、Ark、Ollama、Elasticsearch 等)则放在单独的 eino-ext 仓库中。
它自带现成的模型和工具对接,还是只提供接口?这个仓库主要定义抽象接口和编排逻辑;具体的服务商对接(OpenAI、Claude、Gemini、Ollama、Elasticsearch 等)由 EinoExt 单独实现,所以你很可能也需要那个配套模块。
DeepAgent 是用来做什么的?DeepAgent 用于处理复杂任务:它会把问题拆分成若干步骤,把工作分派给子智能体,并跟踪进度;还可以配置为协调多个专用智能体、运行 shell 命令、执行 Python 代码,以及搜索网络。
Eino 如何处理组件之间的流式数据?数据在节点之间流动时,Eino 会在编排过程中自动管理流式数据,包括拼接、装箱、合并和复制流,因此组件只需实现与自身相关的流式模式即可。
长时间运行的智能体可以暂停等待人工输入吗?可以。任何智能体或工具都可以通过中断/恢复机制暂停执行、等待人工输入,之后从已保存的检查点继续运行;状态持久化和路由由框架负责处理。
我怎样观察智能体和图在做什么?Eino 允许你在组件、图和智能体的固定回调点(OnStart、OnEnd、OnError 以及流式变体)中注入日志、追踪和指标;另外还有一个独立的 Eino Devops 工具,用于可视化开发和调试。
Creator
cloudwego
Size
15.3 MB
Stars
13.3K
Age
1y
Commits · 90 Days