MCPcopy Index your code
hub / github.com/InfinitiBit/graphbit

github.com/InfinitiBit/graphbit @Graphbit_Python_v0.6.8

Chat with this repo
repository ↗ · DeepWiki ↗ · release Graphbit_Python_v0.6.8 ↗ · + Follow
4,019 symbols 15,375 edges 249 files 2,361 documented · 59%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

GraphBit - High Performance Agentic Framework

<img src="https://github.com/InfinitiBit/graphbit/raw/Graphbit_Python_v0.6.8/assets/GraphBit_Final_GB_Github_GIF.gif" style="max-width: 600px; height: auto;" alt="Logo" />






<img alt="GraphBit - Developer-first, enterprise-grade LLM framework. | Product Hunt" loading="lazy" width="250" height="54" decoding="async" data-nimg="1" class="w-auto h-[54px] max-w-[250px]" style="color:transparent" src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=1004951&amp;theme=light&amp;t=1757340621693"> <img alt="GraphBit - Developer-first, enterprise-grade LLM framework. | Product Hunt" loading="lazy" width="250" height="54" decoding="async" data-nimg="1" class="w-auto h-[54px] max-w-[250px]" style="color:transparent" src="https://api.producthunt.com/widgets/embed-image/v1/top-post-badge.svg?post_id=1004951&amp;theme=light&amp;period=daily&amp;t=1757933101511">








<a href="https://graphbit.ai/">Website</a> |
<a href="https://docs.graphbit.ai/">Docs</a> |
<a href="https://discord.com/invite/FMhgB3paMD">Discord</a>












<a href="https://trendshift.io/repositories/14884" target="_blank"><img src="https://trendshift.io/api/badge/repositories/14884" alt="InfinitiBit%2Fgraphbit | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>



<a href="https://pepy.tech/projects/graphbit"><img src="https://static.pepy.tech/personalized-badge/graphbit?period=total&units=INTERNATIONAL_SYSTEM&left_color=GREY&right_color=GREEN&left_text=Downloads" alt="PyPI Downloads"/></a>







<a href="https://pypi.org/project/graphbit/"><img src="https://img.shields.io/pypi/v/graphbit?color=blue&label=PyPI" alt="PyPI"></a>

<a href="https://github.com/InfinitiBit/graphbit/actions/workflows/update-docs.yml"><img src="https://img.shields.io/github/actions/workflow/status/InfinitiBit/graphbit/update-docs.yml?branch=main&label=Build" alt="Build Status"></a>
<a href="https://github.com/InfinitiBit/graphbit/blob/main/CONTRIBUTING.md"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs Welcome"></a>



<a href="https://www.rust-lang.org"><img src="https://img.shields.io/badge/rust-1.70+-orange.svg?logo=rust" alt="Rust Version"></a>
<a href="https://www.python.org"><img src="https://img.shields.io/badge/python-3.9--3.13-blue.svg?logo=python&logoColor=white" alt="Python Version"></a>
<a href="https://github.com/InfinitiBit/graphbit/blob/main/LICENSE.md"><img src="https://img.shields.io/badge/license-Custom-lightgrey.svg" alt="License"></a>







<a href="https://www.youtube.com/@graphbitAI"><img src="https://img.shields.io/badge/YouTube-FF0000?logo=youtube&logoColor=white" alt="YouTube"></a>
<a href="https://x.com/graphbit_ai"><img src="https://img.shields.io/badge/X-000000?logo=x&logoColor=white" alt="X"></a>
<a href="https://discord.com/invite/FMhgB3paMD"><img src="https://img.shields.io/badge/Discord-7289da?logo=discord&logoColor=white" alt="Discord"></a>
<a href="https://www.linkedin.com/showcase/graphbitai/"><img src="https://img.shields.io/badge/LinkedIn-0077B5?logo=linkedin&logoColor=white" alt="LinkedIn"></a>

Type-Safe AI Agent Workflows with Rust Performance


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


GraphBit is an open-source agentic AI framework for deterministic, concurrent, low-overhead execution.

Why GraphBit?

Built byInfinitiBitMunichGermanyDE

Efficiency decides who scales. GraphBit is built for developers who need deterministic, concurrent, and ultra-efficient AI execution without the overhead.

Built with a Rust core and a minimal Python layer, GraphBit delivers up to 68× lower CPU usage and 140× lower memory footprint than other frameworks, while maintaining equal or greater throughput.

It powers multi-agent workflows that run in parallel, persist memory across steps, self-recover from failures, and ensure 100% task reliability. GraphBit is built for production workloads, from enterprise AI systems to low-resource edge deployments.

Used in Production

Grant Thornton Logo

Grant Thornton Germany adopted GraphBit to move AI from "permanent pilot" to production without regulatory risk as a core component of their tech stack.

Key Features

  • 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
  • Resource Management - Concurrency controls and memory optimization
  • Observability - Built-in tracing, structured logs, and performance metrics

Benchmark

GraphBit was built for efficiency at scale, not theoretical claims, but measured results.

Our internal benchmark suite compared GraphBit to leading Python-based agent frameworks across identical workloads.

Metric GraphBit Other Frameworks Gain
CPU Usage 1.0× baseline 68.3× higher ~68× CPU
Memory Footprint 1.0× baseline 140× higher ~140× Memory
Execution Speed ≈ equal / faster Consistent throughput
Determinism 100% success Variable Guaranteed reliability

GraphBit consistently delivers production-grade efficiency across LLM calls, tool invocations, and multi-agent chains.

Benchmark Demo

GraphBit Benchmark Demo

Watch the GraphBit Benchmark Demo

When to Use GraphBit

Choose GraphBit if you need:

  • Production-grade multi-agent systems that won't collapse under load
  • Type-safe execution and reproducible outputs
  • Real-time orchestration for hybrid or streaming AI applications
  • Rust-level efficiency with Python-level ergonomics

If you're scaling beyond prototypes or care about runtime determinism, GraphBit is for you.

Quick Start

Installation

Recommended to use virtual environment.

pip install graphbit

Quick Start Video Tutorial

GraphBit Quick Start Tutorial

Watch the Install GraphBit via PyPI | Full Example & Run Guide tutorial

Environment Setup

Set up API keys you want to use in your project:

# OpenAI (optional – required if using OpenAI models)
export OPENAI_API_KEY=your_openai_api_key_here

# Anthropic (optional – required if using Anthropic models)
export ANTHROPIC_API_KEY=your_anthropic_api_key_here

Security Note: Never commit API keys to version control. Always use environment variables or secure secret management.

Basic Usage

import os

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

# Initialize and configure
config = LlmConfig.openai(os.getenv("OPENAI_API_KEY"), "gpt-4o-mini")

# Create executor
executor = Executor(config)

# Create tools with clear descriptions for LLM selection
@tool(_description="Get current weather information for any city")
def get_weather(location: str) -> dict:
    return {"location": location, "temperature": 22, "condition": "sunny"}

@tool(_description="Perform mathematical calculations and return results")
def calculate(expression: str) -> str:
    return f"Result: {eval(expression)}"

# Build workflow
workflow = Workflow("Analysis Pipeline")

# Create agent nodes
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
    """
)

# Connect and execute
id1 = workflow.add_node(smart_agent)
id2 = workflow.add_node(processor)
workflow.connect(id1, id2)

# Run (optionally with a guardrail policy for PII masking/mapping)
result = executor.execute(workflow)
# Or with policy: result = executor.execute(workflow, policy=GuardRailPolicyConfig.from_json('{"guardrail_policy": {"pii_rules": [...]}}'))
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"))

Building Your First Agent Workflow by GraphBit

Making Agent Workflow by GraphBit

Watch the Making Agent Workflow by GraphBit tutorial

Observability & Tracing

GraphBit Tracer captures and monitors LLM calls and AI workflows with minimal configuration. It wraps GraphBit LLM clients and workflow executors to trace prompts, responses, token usage, latency, and errors without changing your code.

GraphBit Observability & Tracing

Watch the GraphBit Observability & Tracing tutorial

High-Level Architecture

GraphBit Architecture

Three-tier design for reliability and performance: - Rust Core - Workflow engine, agents, and LLM providers - Orchestration Layer - Project management and execution - Python API - PyO3 bindings with async support

Python API Integrations

GraphBit provides a rich Python API for building and integrating agentic workflows:

  • LLM Clients - Multi-provider LLM integrations (OpenAI, Anthropic, Azure, and more)
  • Workflows - Define and manage multi-agent workflow graphs with state management
  • Nodes - Agent nodes, tool nodes, and custom workflow components
  • Executors - Workflow execution engine with configuration management
  • Tool System - Function decorators, registry, and execution framework for agent tools
  • Workflow Results - Execution results with metadata, timing, and output access
  • Embeddings - Vector embeddings for semantic search and retrieval
  • Workflow Context - Shared state and variables across workflow execution
  • Document Loaders - Load and parse documents from multiple formats (PDF, DOCX, TXT, JSON, CSV, XML, HTML)
  • Text Splitters - Split documents into chunks (character, token, sentence, recursive)

For the complete list of classes, methods, and usage examples, see the Python API Reference.

Ecosystem & Extensions

GraphBit's modular architecture supports external integrations:

Category Examples
LLM Providers OpenAI, Anthropic, Azure OpenAI, DeepSeek, Together, Ollama, OpenRouter, Fireworks, Mistral AI, Replicate, Perplexity, HuggingFace, AI21, Bytedance, xAI, and more
Vector Stores Pinecone, Qdrant, Chroma, Milvus, Weaviate, FAISS, Elasticsearch, AstraDB, Redis, and more
Dat

Extension points exported contracts — how you extend this code

TextSplitterTrait (Interface)
Trait for all text splitter implementations [4 implementers]
core/src/text_splitter.rs
LlmProviderTrait (Interface)
(no doc) [20 implementers]
core/src/llm/providers.rs
EmbeddingProviderTrait (Interface)
(no doc) [5 implementers]
core/src/embeddings.rs
AgentTrait (Interface)
(no doc) [4 implementers]
core/src/agents.rs
CustomValidator (Interface)
Trait for custom validators [1 implementers]
core/src/validation.rs

Core symbols most depended-on inside this repo

to_string
called by 1387
python/src/llm/response.rs
clone
called by 1046
guardrail_ffi/src/lib.rs
add_node
called by 423
core/src/workflow.rs
agent
called by 242
core/src/errors.rs
get
called by 215
javascript/src/lib.rs
insert
called by 209
core/src/memory/vector.rs
is_empty
called by 199
core/src/embeddings.rs
openai
called by 181
core/src/llm/providers.rs

Shape

Method 2,410
Function 884
Class 610
Route 85
Enum 25
Interface 5

Languages

Rust50%
Python50%
TypeScript1%

Modules by API surface

tests/python_integration_tests/tests_llm.py135 symbols
tests/tools_tests/python_unit_tests/tests_tool_registry.py66 symbols
tests/tools_tests/python_unit_tests/tests_tool_executor.py61 symbols
tests/tools_tests/python_unit_tests/tests_tool_decorator.py58 symbols
tests/python_integration_tests/tests_async_execution.py58 symbols
tests/tools_tests/python_integration_tests/tests_comprehensive_integration.py53 symbols
tests/tools_tests/python_integration_tests/tests_tools_error_handling.py50 symbols
core/src/workflow.rs49 symbols
tests/python_integration_tests/tests_static_workflow.py48 symbols
tests/tools_tests/python_integration_tests/tests_tools_workflow.py47 symbols
python/src/workflow/executor.rs45 symbols
tests/python_integration_tests/tests_embeddings.py43 symbols

Datastores touched

(mongodb)Database · 1 repos

For agents

$ claude mcp add graphbit \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact