graph-builder
An API-first TypeScript library that turns text sources into a queryable graph. Build it from texts, providers, or change streams — and persist, update, or replay the result.
What's in the box
Teams modelling document relationships, knowledge graphs, or multi-step reasoning over a corpus that needs to update over time without re-ingesting everything. Each capability is opt-in — use the parts that fit, leave the rest.
API-first design
Embed it inside any app — no CLI required. The entire graph lifecycle is exposed as composable functions.
Many input modes
Build from inline texts, from a custom provider, or from a change stream that yields updates over time.
Incremental updates
`fromChanges` and `updateGraph` evolve an existing graph without re-processing the whole corpus.
Built-in analysis
Identify god nodes, run path queries, and inspect link clusters with the included query helpers.
Serializable
Load and persist graphs as plain JSON — easy to ship across services, store in a DB, or diff in a PR.
Adapters included
Out-of-the-box adapters for to-markdown sources and OpenAI-compatible providers; bring your own for anything else.
How it runs
Turn a corpus into a queryable graph in two ways: build from inline texts, or stream changes through a provider. Inspect, persist, and update incrementally.
Builders
fromTexts(records)fromProvider(provider)fromChanges(prev, provider)updateGraph(prev, patch)
Adapters
- to-markdown
- OpenAI-compatible
- Custom providers
- Change streams
Query
analysis.godNodesquery.path(a, b)artifacts.reportloadGraph(json)
Quickstart
Install, configure, run. The example below is the smallest piece of code that does something useful in production.
How it compares
Against the utilities options teams most often weigh — focused on operational concerns, not feature inventories.
| Capability | graph-builder | LangChain GraphIndexCreator | Neo4j + bespoke pipeline | Llama-Index KnowledgeGraph |
|---|---|---|---|---|
| Text → graph | ● native | ● native | ● native | ● native |
| Incremental updates | ● native | ○ missing | ● native | ◐ partial |
| Path queries | ● native | ◐ partial | ● native | ◐ partial |
| Provider adapters | ● native | ◐ partial | ○ missing | ◐ partial |
| TypeScript | ● native | ◐ partial | ◐ partial | ○ missing |
| Open source | ● native | ● native | ◐ partial | ● native |