Skip to content
Python JavaScript

Home

# GraphBit - High Performance Agentic Framework

GraphBit Logo

Website | Docs | Discord

InfinitiBit%2Fgraphbit | Trendshift
NPM Total Downloads

NPM Build Status PRs Welcome
Rust Version Node Version License

YouTube X Discord LinkedIn

**Type-Safe AI Agent Workflows with Rust Performance**

Installation

npm install @infinitibit_gmbh/graphbit

Quick Start

import { init, LlmClient, LlmConfig } from '@infinitibit_gmbh/graphbit';

// Initialize GraphBit
init();

// Configure LLM provider
const config = LlmConfig.openai({
  apiKey: process.env.OPENAI_API_KEY,
  model: 'gpt-4o-mini'
});

// Create client and generate completion
const client = new LlmClient(config);
const response = await client.complete('What is AI?', 100);
console.log(response);

Features

  • 🤖 Multi-LLM Support - OpenAI, Anthropic, Ollama
  • 🔄 Workflow Automation - Build complex agentic workflows
  • 🛠️ Tool Integration - Function calling and tool execution
  • 📄 Document Processing - PDF, DOCX, text splitting
  • 🎯 Type-Safe - Full TypeScript support
  • High Performance - Native Rust implementation via NAPI

Core APIs

LLM Client

const client = new LlmClient(config);
await client.complete(prompt, maxTokens);
await client.completeBatch(prompts, maxTokens, temperature, concurrency);

Workflows

const workflow = new WorkflowBuilder('My Workflow')
  .description('Description')
  .build();

const executor = new Executor(llmConfig);
const result = await executor.execute(workflow);

Embeddings

const embClient = new EmbeddingClient(embConfig);
const response = await embClient.embed(['text 1', 'text 2']);
const similarity = EmbeddingClient.similarity(emb1, emb2);

Document Processing

const loader = new DocumentLoader();
const doc = await loader.loadFile('./document.pdf', 'pdf');

const splitter = TextSplitter.recursive(500, 50);
const chunks = await splitter.split(doc.content);

Tool Calling (with Async Support)

const { ToolRegistry, registerAsync } = require('@infinitibit_gmbh/graphbit');

const registry = new ToolRegistry();

// Register async tools with proper timing tracking
registerAsync(registry, 'fetchData', 'Fetches external data', {}, async (args) => {
  const response = await fetch(args.url);
  return await response.json();
});

const result = await registry.execute('fetchData', { url: 'https://api.example.com' });
console.log(result.executionTimeMs); // Includes full async wait time

Documentation

Requirements

  • Node.js ≥ 16.0.0
  • Supported platforms: Windows, macOS, Linux (x64, ARM64)

License

Apache License, Version 2.0.

Quick Navigation

🚀 Getting Started

📚 User Guide

🔧 API Reference

🔗 Connectors & Integrations

🛠️ Development

📋 Examples & Use Cases

What is GraphBit?

GraphBit is a declarative framework for building reliable AI agent workflows with strong type safety, comprehensive error handling, and predictable performance. It features:

  • 🔒 Type Safety - Strong typing throughout the execution pipeline
  • 🛡️ Reliability - Circuit breakers, retry policies, and error handling
  • 🤖 Multi-LLM Support - OpenAI, Anthropic, Ollama
  • ⚡ Performance - Rust core with Node.js bindings for optimal speed
  • 📊 Observability - Built-in metrics and execution tracing
  • 🔧 Resource Management - Concurrency controls and memory optimization

Architecture

GraphBit uses a three-tier architecture:

GraphBit JS Architecture

Community & Support


Ready to build your first AI workflow? Start with GraphBit's Quick Start Tutorial!