Skip to content
项目

关于

GraphBit 是全球首个企业级 Agentic AI 框架,以 Rust 为核心并提供 Python 封装,带来无与伦比的速度、安全性和可扩展性。它以极低的 CPU 和内存占用支持可靠的多智能体工作流,可用于真实的企业生产环境。

安全与隐私

这些数字如何统计

可以做什么

  • Tool Selection - LLMs intelligently choose tools based on descriptions
  • Type Safety - Strong typing through every execution layer
  • Reliability - Circuit breakers, retry policies, and error handling and fault recovery
  • Multi-LLM Support - OpenAI, Azure OpenAI, Anthropic, OpenRouter, DeepSeek, Replicate, Ollama, TogetherAI and more

实测星标增长

24小时
更新延迟
7天
更新延迟
15天
更新延迟
1个月
更新延迟

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README_Multi_Lingual_i18n_Files/README.zh-CN.md

原文

GraphBit - 高性能智能体框架 (简体中文)

Logo

GraphBit - Developer-first, enterprise-grade LLM framework. | Product Hunt GraphBit - Developer-first, enterprise-grade LLM framework. | Product Hunt

Website | Docs | Discord


PyPI Downloads

PyPI PyPI Downloads Build Status PRs Welcome
Rust Version Python Version License

YouTube X Discord LinkedIn

具有 Rust 性能的类型安全 AI 智能体工作流


🚧 翻译进行中 - 本文档正在从英文翻译中。

📖 Read in English | 阅读英文版


其他语言版本: 🇨🇳 繁體中文 | 🇪🇸 Español | 🇫🇷 Français | 🇩🇪 Deutsch | 🇯🇵 日本語 | 🇰🇷 한국어 | 🇮🇳 हिन्दी | 🇸🇦 العربية | 🇮🇹 Italiano | 🇧🇷 Português | 🇷🇺 Русский | 🇧🇩 বাংলা


关于 GraphBit

GraphBit 是一个源代码可用的智能体 AI 框架,专为需要确定性、并发和低开销执行的开发者设计。

为什么选择 GraphBit?

效率决定谁能扩展规模。GraphBit 专为需要确定性、并发和超高效 AI 执行而无需额外开销的开发者而构建。

GraphBit 采用 Rust 核心和最小化的 Python 层,与其他框架相比,CPU 使用率降低高达 68 倍,内存占用降低 140 倍,同时保持相同或更高的吞吐量。

它支持并行运行的多智能体工作流,跨步骤持久化内存,从故障中自我恢复,并确保 100% 的任务可靠性。GraphBit 专为生产工作负载而构建,从企业 AI 系统到低资源边缘部署。

主要特性

  • 工具选择 - LLM 根据描述智能选择工具
  • 类型安全 - 每个执行层都有强类型
  • 可靠性 - 断路器、重试策略、错误处理和故障恢复
  • 多 LLM 支持 - OpenAI、Azure OpenAI、Anthropic、OpenRouter、DeepSeek、Replicate、Ollama、TogetherAI 等
  • 资源管理 - 并发控制和内存优化
  • 可观测性 - 内置跟踪、结构化日志和性能指标

基准测试

GraphBit 为大规模效率而构建,不是理论声明,而是实测结果。

我们的内部基准测试套件在相同工作负载下将 GraphBit 与领先的基于 Python 的智能体框架进行了比较。

指标 GraphBit 其他框架 增益
CPU 使用率 1.0× 基准 68.3× 更高 ~68× CPU
内存占用 1.0× 基准 140× 更高 ~140× 内存
执行速度 ≈ 相等 / 更快 — 一致的吞吐量
确定性 100% 成功 可变 保证的可靠性

GraphBit 在 LLM 调用、工具调用和多智能体链中始终提供生产级效率。

基准测试演示

GraphBit Benchmark Demo

观看 GraphBit 基准测试演示

何时使用 GraphBit

如果您需要以下功能,请选择 GraphBit:

  • 不会在负载下崩溃的生产级多智能体系统
  • 类型安全的执行和可重现的输出
  • 用于混合或流式 AI 应用的实时编排
  • Rust 级别的效率和 Python 级别的人体工程学

如果您正在扩展原型之外或关心运行时确定性,GraphBit 适合您。

快速开始

安装

建议使用虚拟环境。

pip install graphbit

快速入门视频教程

GraphBit Quick Start Tutorial

观看通过 PyPI 安装 GraphBit | 完整示例和运行指南教程

环境设置

设置您想在项目中使用的 API 密钥:

# OpenAI(可选 – 如果使用 OpenAI 模型则需要)
export OPENAI_API_KEY=your_openai_api_key_here

# Anthropic(可选 – 如果使用 Anthropic 模型则需要)
export ANTHROPIC_API_KEY=your_anthropic_api_key_here

安全提示:切勿将 API 密钥提交到版本控制。始终使用环境变量或安全的密钥管理。

基本用法

import os

from graphbit import LlmConfig, Executor, Workflow, Node, tool

# 初始化和配置
config = LlmConfig.openai(os.getenv("OPENAI_API_KEY"), "gpt-4o-mini")

# 创建执行器
executor = Executor(config)

# 创建具有清晰描述的工具以供 LLM 选择
@tool(_description="获取任何城市的当前天气信息")
def get_weather(location: str) -> dict:
    return {"location": location, "temperature": 22, "condition": "sunny"}

@tool(_description="执行数学计算并返回结果")
def calculate(expression: str) -> str:
    return f"Result: {eval(expression)}"

# 构建工作流
workflow = Workflow("Analysis Pipeline")

# 创建智能体节点
smart_agent = Node.agent(
    name="Smart Agent",
    prompt="What's the weather in Paris and calculate 15 + 27?",
    system_prompt="You are an assistant skilled in weather lookup and math calculations. Use tools to answer queries accurately.",
    tools=[get_weather, calculate]
)

processor = Node.agent(
    name="Data Processor",
    prompt="Process the results obtained from Smart Agent.",
    system_prompt="""You process and organize results from other agents.

    - Summarize and clarify key points
    - Structure your output for easy reading
    - Focus on actionable insights
    """
)

# 连接和执行
id1 = workflow.add_node(smart_agent)
id2 = workflow.add_node(processor)
workflow.connect(id1, id2)

result = executor.execute(workflow)
print(f"Workflow completed: {result.is_success()}")
print("\nSmart Agent Output: \n", result.get_node_output("Smart Agent"))
print("\nData Processor Output: \n", result.get_node_output("Data Processor"))

可观测性与追踪

GraphBit Tracer 以最小配置捕获和监控 LLM 调用和 AI 工作流。它包装 GraphBit LLM 客户端和工作流执行器,以追踪提示、响应、令牌使用、延迟和错误,而无需更改您的代码。

GraphBit Observability & Tracing

观看 GraphBit 可观测性与追踪教程

高层架构

GraphBit Architecture

三层设计确保可靠性和性能:

  • Rust 核心 - 工作流引擎、智能体和 LLM 提供商
  • 编排层 - 项目管理和执行
  • Python API - PyO3 绑定,支持异步

Python API 集成

GraphBit 提供丰富的 Python API 用于构建和集成智能体工作流:

  • LLM 客户端 - 多提供商 LLM 集成(OpenAI、Anthropic、Azure 等)
  • 工作流 - 定义和管理具有状态管理的多智能体工作流图
  • 节点 - 智能体节点、工具节点和自定义工作流组件
  • 执行器 - 具有配置管理的工作流执行引擎
  • 工具系统 - 智能体工具的函数装饰器、注册表和执行框架
  • 工作流结果 - 带有元数据、时间和输出访问的执行结果
  • 嵌入 - 用于语义搜索和检索的向量嵌入
  • 工作流上下文 - 工作流执行过程中的共享状态和变量
  • 文档加载器 - 从多种格式加载和解析文档(PDF、DOCX、TXT、JSON、CSV、XML、HTML)
  • 文本分割器 - 将文档分割成块(字符、令牌、句子、递归)

有关类、方法和使用示例的完整列表,请参阅 Python API 参考。

文档

完整文档请访问:https://docs.graphbit.ai/

生态系统与扩展

GraphBit 的模块化架构支持外部集成:

类别 示例
LLM 提供商 OpenAI, Anthropic, Azure OpenAI, DeepSeek, Together, Ollama, OpenRouter, Fireworks, Mistral AI, Replicate, Perplexity, HuggingFace, AI21, Bytedance, xAI, 等
向量存储 Pinecone, Qdrant, Chroma, Milvus, Weaviate, FAISS, Elasticsearch, AstraDB, Redis, 等
数据库 PostgreSQL (PGVector), MongoDB, MariaDB, IBM DB2, Redis, 等
云平台 AWS (Boto3), Azure, Google Cloud Platform, 等
搜索 API Serper, Google Search, GitHub Search, GitLab Search, 等
嵌入模型 OpenAI Embeddings, Voyage AI, 等

扩展由社区开发和维护。

GraphBit Ecosystem - Stop Choosing, Start Orchestrating

使用 GraphBit 构建您的第一个智能体工作流

Making Agent Workflow by GraphBit

观看使用 GraphBit 创建智能体工作流教程

为 GraphBit 做贡献

我们欢迎贡献。要开始,请参阅 Contributing 文件了解开发设置和指南。

GraphBit 由一个优秀的研究人员和工程师社区构建。

安全

如果您发现安全漏洞,请通过 GitHub Security 或电子邮件负责任地报告,而不是创建公开问题。

详细报告程序和响应时间表,请参阅我们的 Security Policy。

许可证

GraphBit 项目遵循 Apache 许可证 2.0 版本。

有关完整条款和条件,请参阅 完整许可证。

Copyright © 2023–2026 InfinitiBit GmbH. All rights reserved.


注意: 此翻译由社区维护。如果您发现任何错误或想要改进翻译,请提交 Pull Request。

探索相关项目

加载中…