Getting Started

Install InferaGraph and build your first interactive knowledge graph in minutes.

Installation

Install the core package and your preferred LLM provider.

Core

$ pnpm add @inferagraph/core

LLM Providers (pick one or more)

$ pnpm add @inferagraph/anthropic-provider # Claude
$ pnpm add @inferagraph/openai-provider # GPT
$ pnpm add @inferagraph/azure-foundry-provider # Azure

Peer Dependencies

$ pnpm add react react-dom three

Quick Start

Get up and running with InferaGraph in your framework of choice. The minimum is a data prop—everything else is optional.

import { InferaGraph } from '@inferagraph/core/react';
import type { GraphData } from '@inferagraph/core/data';

const data: GraphData = {
  nodes: [
    { id: 'abraham', attributes: { name: 'Abraham', type: 'person' } },
    { id: 'sarah', attributes: { name: 'Sarah', type: 'person' } },
    { id: 'isaac', attributes: { name: 'Isaac', type: 'person' } },
  ],
  edges: [
    { id: 'e1', sourceId: 'abraham', targetId: 'sarah', attributes: { type: 'husband_of' } },
    { id: 'e2', sourceId: 'abraham', targetId: 'isaac', attributes: { type: 'father_of' } },
  ],
};

function App() {
  return <InferaGraph data={data} layout="graph" />;
}

Add AI

Pass an LLM provider as the llm prop and InferaGraph unlocks chat, semantic search, and tool-driven graph manipulation. The host never calls the LLM directly—your keys, your terms.

import { InferaGraph } from '@inferagraph/core/react';
import { openaiProvider } from '@inferagraph/openai-provider';

const llm = openaiProvider({ apiKey: process.env.OPENAI_API_KEY });

function App() {
  return <InferaGraph data={data} llm={llm} />;
}

// That's it. The host never invokes the LLM directly—
// useInferaGraphChat() and useInferaGraphSearch() are now live.

See the provider catalog for OpenAI, Anthropic, Azure Foundry, and a mock provider for testing.