Build intelligent, interactive knowledge graphs with built-in AI reasoning, physics-based layouts, and stunning 3D visualization.
pnpm add @inferagraph/core A complete platform — from graph storage and AI reasoning to 3D visualization — all in one library.
Typed nodes, directed edges, and lightning-fast traversal with built-in indexing.
const store = new GraphStore();
store.addNode('abraham', {
name: 'Abraham',
type: 'person',
gender: 'male',
era: 'patriarchs',
});
store.addEdge('e1', 'abraham', 'isaac', {
type: 'father_of',
});Ask natural language questions about your graph. Built-in context building extracts relevant subgraphs and feeds them to any LLM provider.
Query
"Who are the descendants of Abraham?"
WebGL-powered rendering with Three.js. Force-directed and hierarchical layouts with smooth physics simulation.
Extend with custom layouts, LLM providers, renderers, and data sources. First-class plugin API with full type safety.
Relevance-scored full-text search across names, aliases, tags, and content. Filter by type, era, gender, or custom predicates.
Barnes-Hut O(n log n) force calculation, spring attraction, Coulomb repulsion, and damping — all in 3D.
Barnes-Hut
N-body via octree
Spring Force
Hooke's law attraction
Coulomb Force
Electrostatic repulsion
Damping
Velocity decay
Drop-in component, context provider, and useInferaGraph hook. Load data, query AI, and render — all with familiar React patterns.
Real-time token-by-token streaming from any LLM provider. AsyncIterable API with text, done, and error chunks.
Versioned JSON serialization with toJSON/fromJSON. Export and import entire graphs with full metadata.
Define custom eras and filter nodes through time. Configurable timeline with era transitions showing appearing and disappearing nodes.
Louvain-inspired community detection. Automatic grouping by edge density with expand/collapse and convex hull boundaries.
Export graphs as PNG, SVG, or JSON. Selection-aware export with configurable resolution and metadata options.
Swap LLM providers without changing application code. Natural language queries, graph-aware context injection, and real-time streaming — all through a unified API.
Keyboard navigation with Tab/Arrow keys, multi-select with Shift/Ctrl+click and drag-box, and a synced minimap overview.
Keyboard Nav
ARIA accessible
Multi-Select
Batch operations
Minimap
Click-to-navigate
Load your graph data, ask questions in natural language, and visualize the results — all in a few lines of code.
import { GraphProvider, InferaGraph,
useInferaGraph } from '@inferagraph/core';
import { SqlDatasource } from '@inferagraph/sql-datasource';
// Connect to any database
const ds = new SqlDatasource({
dialect: 'postgres',
connection: process.env.DATABASE_URL,
});
await ds.connect();
function App() {
return (
<GraphProvider adapter={ds}>
<Explorer />
</GraphProvider>
);
}
function Explorer() {
const { expandNode, search, isReady } =
useInferaGraph();
// Expand neighbors on click (accumulating cache)
const handleClick = async (id: string) => {
await expandNode(id, 2);
};
if (!isReady) return <Loading />;
return <InferaGraph onNodeClick={handleClick} />;
}First-class support for the leading AI providers. Swap models with a single line.
Claude models
@inferagraph/anthropic-provider GPT models
@inferagraph/openai-provider Any deployed model
@inferagraph/azure-foundry-provider Pass data directly for static sites and prototypes, or connect to a database with pre-built datasource packages. You can also implement the DataAdapter interface for any custom backend.
No server required
@inferagraph/core Apache TinkerPop
@inferagraph/gremlin-datasource Azure NoSQL
@inferagraph/cosmosdb-datasource Postgres, MySQL, SQLite
@inferagraph/sql-datasource InferaGraph is MIT licensed. Use it in personal projects, commercial products, or anything in between.