npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ai-gui/plugin-graph

v0.49.0

Published

Knowledge graphs and ontologies for AIGUI — entities, typed relations, classes with domain/range checks, drawn as 2D SVG or a three.js model.

Readme

@ai-gui/plugin-graph

Knowledge graphs and ontologies for AIGUI. The model writes entities and typed relations — and, when the domain has a schema, the classes and properties they should obey. The plugin draws the graph in 2D or 3D and marks every relation that breaks the ontology.

Install

pnpm add @ai-gui/plugin-graph

The 2D figure is SVG and needs nothing beyond @ai-gui/core. The 3D view uses three, which is a dependency of this package but is imported only when a 3D graph is actually drawn; a page whose answers stay in 2D never downloads it. Pass three: false to hide the 3D view altogether.

Usage

import { graph } from "@ai-gui/plugin-graph"
import { buildSystemPrompt } from "@ai-gui/core"

<AIRenderer plugins={[graph()]} />

// The model has no prior for this block, so the spec is what makes it usable at all.
const system = buildSystemPrompt({ registry, plugins: [graph()], locale: "zh-CN" })

The model then emits:

Acme 的组织关系如下;注意 Bob 的汇报线写成了"任职于"一个人,图里会标出来。

```graph
{
  "classes": [
    { "id": "Person", "name": "人" },
    { "id": "Organization", "name": "组织" }
  ],
  "properties": [
    { "id": "worksAt", "name": "任职于", "domain": "Person", "range": "Organization" }
  ],
  "entities": [
    { "id": "alice", "name": "Alice", "type": "Person", "attrs": { "title": "CTO" } },
    { "id": "bob", "name": "Bob", "type": "Person" },
    { "id": "acme", "name": "Acme", "type": "Organization" }
  ],
  "relations": [
    { "from": "alice", "to": "acme", "type": "worksAt" },
    { "from": "bob", "to": "alice", "type": "worksAt" }
  ],
  "focus": "alice"
}
```

Why the protocol looks like this

Two flat layers, RDFS words. classes with subClassOf, properties with domain and range, entities with a type, relations with from/to/type. A model already knows these words and writes flat lists correctly far more often than nested triples. Either layer may be missing: a plain entity graph has no classes; a concept model has no entities.

Checked, not just drawn. Every relation is tested against its property's domain and range, with subClassOf honoured, so a Dog satisfies a domain of Animal. A relation that fails is drawn red and dashed, and listed under the figure with what was expected and what was found. This is the one piece of reasoning in the plugin, and it is the one that catches the mistake a model actually makes.

Lenient on references. A class or property that is used but never declared is added implicitly — a streaming model that declared four classes and used five has not written nonsense. Only a relation whose end is not an entity is refused, because an edge to nothing cannot be drawn.

Deterministic layout. A hand-written spring–electrical layout in two or three dimensions, seeded by a hash of the node ids. The same block draws the same picture twice running; nothing calls Math.random. The 2D figure is laid out to completion before it is drawn and is complete as a still; the 3D model settles in front of the reader.

One block, four pictures. The toolbar flips between 2D | 3D and 实例 | 本体 (instances | ontology). The ontology view draws the class hierarchy in rows with the properties as arrows between classes; the instance view is the force layout. view and layer in the block choose where it opens.

Supported

| | | | --- | --- | | Ontology | classes (id, name, subClassOf, color, description), properties (id, name, domain, range, color, description) | | Instances | entities (id, name, type, value, attrs, description), relations (from, to, type, name) | | Top level | view (2d | 3d), layer (instances | ontology), focus, caption, rotate | | Interaction | hover highlights a node and its neighbours with a tooltip of its class, facts and edges; wheel zooms, drag pans, double-click resets; in 3D, drag turns the model | | Limits (options) | maxEntities 500, maxRelations 2000, maxClasses 64, maxProperties 64, maxSourceBytes 256 KiB | | Options | height (420), labelBudget (20), interactive (static SVG when false), three (hide 3D when false), onEntityClick |

Not in this version: subPropertyOf, inverse or symmetric properties, cardinality, and RDF/Turtle input. Flows, sequences and state machines belong in @ai-gui/plugin-mermaid; a graph inside a data wall is the graph3d panel of @ai-gui/plugin-bigscreen.