Skip to content

Getting Started

Graph Builder is for teams that want a queryable graph from existing text without adopting a framework-heavy orchestration layer.

Install

sh
npm install @cognipeer/graph-builder

Requirements:

  • Node.js 18.17+
  • Text records, a provider, or a local directory to ingest
  • A decision about whether semantic enrichment should stay off or be explicitly enabled

Choose your input path

PathUse whenEntry point
Text arrayYou already have records in memorygraphBuilder.fromTexts(...)
Custom providerContent lives behind a DB, API, or service boundarygraphBuilder.fromProvider(...)
Local pathYou want to scan files directly in NodegraphBuilder("./docs")

First graph

ts
import { graphBuilder } from "@cognipeer/graph-builder";

const result = await graphBuilder.fromTexts([
  {
    id: "docs/overview.md",
    title: "Overview",
    path: "docs/overview.md",
    text: "# Overview\n\nSee [Guide](guide.md)."
  },
  {
    id: "docs/guide.md",
    title: "Guide",
    path: "docs/guide.md",
    text: "# Guide\n\nThis document explains the flow."
  }
]);

What to inspect after the run

  • result.graph.stats for counts and community totals.
  • result.query.path(...) to verify cross-document links are usable.
  • result.artifacts.report for a human-readable summary.
  • result.diagnostics for timings, warnings, and model usage.
  1. Read Core Concepts.
  2. Read Providers if your content is not already an in-memory array.
  3. Read Semantic Enrichment only if deterministic extraction is not enough.

Studio · Pulse · Console · Agent SDK and more — the Cognipeer documentation hub