Every component of InferaGraph is designed to make working with knowledge graphs intuitive, fast, and intelligent.
At the core of InferaGraph is a high-performance, in-memory graph store with copy-on-write semantics and multi-index lookups.
Typed Nodes and Edges
People, places, events, groups — with gender, era, tags, and custom attributes.
Multi-Index Lookups
Instant retrieval by type, tag, or case-insensitive name search.
BFS Traversal
Neighborhood queries with configurable depth and bidirectional edge walking.
Pathfinding
Breadth-first shortest path between any two nodes in the graph.
Subgraph Extraction
Pull out connected subsets for focused analysis or visualization.
// Full-text search with relevance scoring
const results = search.search('important');
// → [{ nodeId: 'node-1', score: 10 }, ...]
// Find shortest path
const path = query.findPath('node-1', 'node-5');
// → ['node-1', 'node-3', 'node-5']
// Get neighborhood (depth=2)
const nearby = query.getNeighbors('node-1', 2);
// Filter by any attribute
const active = filter.filterByAttribute('status', 'active');
// Custom predicates
const tagged = filter.filter(
(attrs) => attrs.tags?.includes('important')
);"What is the lineage from Abraham to King David?"
Extracting: abraham, isaac, jacob, judah,
perez, hezron, ram, amminadab,
nahshon, salmon, boaz, obed,
jesse, david
The lineage from Abraham to King David spans 14 generations through the tribe of Judah...
InferaGraph doesn't just store data — it understands it. The AI engine automatically builds context from your graph, sends it to any LLM, and parses the response to highlight relevant nodes.
Automatic Context Building
Searches relevant nodes, expands 1-hop neighbors, formats as structured Markdown for the LLM.
Intent Parsing
Extracts referenced entities from AI responses and maps them back to graph nodes.
Provider Agnostic
Swap between Anthropic, OpenAI, and Azure Foundry with a single line.
WebGL-powered 3D rendering with real physics simulation. Toggle between animated force-directed graphs and static card-style family trees.
Force-Directed 3D
Barnes-Hut N-body with O(n log n) performance
Tree Layout
Card-style family tree with static nodes and orthogonal connectors
CSS Themeable
Custom properties for colors, fonts, sizing
Interactive
Aggregated edge descriptions on hover with smart tooltips
// Floating graph view with animated physics
<GraphProvider layout="graph" layoutOptions={{ animated: true }}>
<InferaGraph />
</GraphProvider>
// Static family tree with card-style nodes
<GraphProvider layout="tree" layoutOptions={{ animated: false }}
nodeRender={{ style: 'card' }}>
<InferaGraph />
</GraphProvider>Stream AI responses token-by-token with native provider support. The AsyncIterable API works with any provider — Anthropic, OpenAI, or Azure Foundry.
AsyncIterable API
for-await-of streaming with LLMStreamChunk type (text/done/error).
Provider Native
Each provider implements native streaming — Anthropic events, OpenAI deltas, Azure chunks.
Backward Compatible
Default stream() falls back to complete() for providers that don't override.
// Stream AI responses in real-time
for await (const chunk of ai.queryStream('Who are the 12 tribes?')) {
if (chunk.type === 'text') {
process.stdout.write(chunk.content);
}
}
// Provider-level streaming
for await (const chunk of provider.stream(request)) {
// { type: 'text'|'done'|'error', content: string }
}Serialization, temporal navigation, and semantic clustering for advanced graph management.
Versioned Schema
Version-stamped JSON with nodes, edges, and metadata for forward compatibility.
Round-Trip Safe
toJSON() and fromJSON() preserve all data, including custom attributes.
Helpers
exportGraph() and importGraph() for string-based serialization.
// Serialize to versioned JSON
const data = store.toJSON();
// { version: 1, nodes: [...], edges: [...], metadata: {...} }
// Restore from JSON
store.fromJSON(data);
// String helpers
const json = exportGraph(store);
importGraph(store, json);Configurable Eras
Define your own eras with custom date ranges, names, and descriptions.
Time Range Queries
Filter nodes by arbitrary year range, overlapping eras, or specific year.
Era Transitions
Compute appearing, disappearing, and persisting nodes between eras.
const timeline = new TimelineEngine(store, {
eras: [
{ name: 'Ancient', startYear: -3000, endYear: -500 },
{ name: 'Classical', startYear: -500, endYear: 500 },
],
eraKey: 'era',
});
// Filter by era
const ancient = timeline.getNodesByEra('Ancient');
// Filter by year range
const nodes = timeline.getNodesByTimeRange({
start: -500, end: 500
});
// Compute transitions
const t = timeline.getTransition('Ancient', 'Classical');
// { appearing: [...], disappearing: [...], persisting: [...] }Community Detection
Louvain-inspired modularity optimization groups densely-connected nodes.
Expand/Collapse
Collapse clusters to a single representative node; expand to reveal contents.
Convex Hull
Graham scan computes visual cluster boundaries from node positions.
const clusters = new ClusterEngine(store);
// Detect communities
const detected = clusters.detectCommunities();
// Collapse/expand
clusters.collapse(detected[0].id);
const visible = clusters.getVisibleNodes();
// Cluster boundary (convex hull)
const hull = clusters.getClusterBoundary(
detected[0].id, positions
);Selection Modes
Replace (click), Add (Shift+click), Toggle (Ctrl/Cmd+click).
Drag-Box Select
Marquee selection by screen rectangle with configurable mode.
Batch Operations
Delete, move, group, and extract subgraph from selected nodes.
Canvas Overlay
Lightweight canvas rendering of all node positions at minimap scale.
Viewport Sync
Viewport rectangle updates in real-time as the main camera moves.
Click-to-Navigate
Click anywhere on the minimap to center the main view on that position.
Focus Navigation
Tab/Shift+Tab cycles through nodes; Arrow keys traverse graph edges.
Selection Keys
Enter/Space to select focused node; Escape to deselect all.
Custom Shortcuts
Register custom key bindings with modifier support (Ctrl, Shift, Alt, Meta).
ARIA Accessible
Sets tabindex, role, and aria-label on the container for screen readers.
PNG Export
Canvas toDataURL/toBlob with configurable resolution scale.
SVG Export
Generate clean SVG from node/edge positions — no Three.js dependency.
JSON Export
Leverages graph serialization with optional metadata and selection filtering.
const exporter = new ExportEngine(store);
// Export as JSON (uses serialization)
const json = exporter.exportJSON();
// Export as SVG
const svg = exporter.exportSVG(nodes, edges, {
width: 1024, height: 768
});
// Export as PNG from canvas
const dataUrl = exporter.exportPNG(canvas, {
scale: 2
});
// Export selected only
const partial = exporter.exportJSON({
selectedOnly: true,
selectedNodeIds: selection.getSelected()
});The DataAdapter interface decouples InferaGraph from your data layer. Load from static files, REST APIs, or connect directly to databases with pre-built datasource packages. The accumulating cache ensures data is fetched incrementally and never re-requested.
Framework-Agnostic
DataAdapter interface works with any backend — REST, GraphQL, WebSocket, or direct DB.
Incremental Loading
On-demand fetching with expandNode, findPath, search, and getContent.
Accumulating Cache
DataManager merges fetched data into the local GraphStore — no duplicate requests.
Static Adapter
Built-in StaticDataAdapter wraps in-memory data for simple use cases.
Server Datasources
Pre-built packages for Gremlin, Cosmos DB, and SQL (PostgreSQL, MySQL, SQLite, MSSQL).
Any Backend
Extend the Datasource base class to connect to any data source with managed lifecycle.
// Static data (simple)
<GraphProvider data={myGraphData}>
<InferaGraph />
</GraphProvider>
// Dynamic adapter (any backend)
<GraphProvider adapter={apiAdapter}>
<InferaGraph />
</GraphProvider>
// Server-side datasource
const ds = new SqlDatasource({
dialect: 'postgres',
connection: process.env.DATABASE_URL,
});
await ds.connect();
<GraphProvider adapter={ds}>
<InferaGraph />
</GraphProvider>TypeScript-first, tree-shakeable, and designed to integrate seamlessly with your stack.
Full type inference, strict mode, and generated .d.ts declarations.
Context provider, useInferaGraph hook, and a drop-in InferaGraph component.
Dual-format builds via tsup. Works everywhere — bundlers, Node, and Deno.
Register custom layouts, providers, and renderers with type-safe plugin context.
CSS custom properties for every visual element. Ship light, dark, or custom themes.
80%+ code coverage enforced. 45 test suites with 588 tests covering all features.