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

activegraph

v0.1.0

Published

Event-sourced reactive graph runtime for auditable, forkable agentic systems

Readme

ActiveGraph

Event-sourced reactive graph runtime for auditable, forkable agentic systems.

ActiveGraph turns the execution of an AI agent into a structured, inspectable, replayable record. Every LLM call, tool invocation, and decision flows through an append-only event log that projects into a live graph — with full causal lineage.

Install

npm install activegraph

# Optional peer dependencies (installed as needed):
npm install better-sqlite3        # faster SQLite persistence (JSONL works with zero native deps)
npm install @anthropic-ai/sdk     # Anthropic provider
npm install openai                # OpenAI provider

Requires Node.js >= 20.

Two ways to use it

1. Observability — capture an existing agent (zero code changes)

The LLM API call is the universal chokepoint. Point any agent at the local proxy and every request/response becomes an event:

activegraph wrap --persist ./trace.jsonl -- claude "fix the bug"
# → Captured 12 LLM calls, 5 tool calls, 45000 tokens, ~$0.18
activegraph inspect ./trace.jsonl

Or in code:

import { ActiveGraphProxy } from 'activegraph/adapters';

const proxy = new ActiveGraphProxy({ persistTo: './trace.jsonl' });
const { url } = await proxy.start();
process.env.ANTHROPIC_BASE_URL = url; // the only change
// ...run your agent...
await proxy.stop();
console.log(proxy.costSummary());

2. Framework — build an event-driven agent

import { Graph, Runtime, behavior, clearRegistry } from 'activegraph';

clearRegistry();
behavior({ name: 'planner', on: ['goal.created'] })((event, graph) => {
  graph.addObject('task', { title: 'Research', status: 'open' });
});

const runtime = new Runtime(new Graph(), { budget: { maxEvents: 200 } });
await runtime.runGoal('Evaluate this startup idea');
await runtime.printTrace();

Once captured, everything works

  • Trace — human-readable causal event log
  • Resume — recover a crashed run from its log (EventLog.resume)
  • Fork & Diff — branch at any point, compare outcomes
  • Cost tracking — token usage and spend per call

Adoption levels

| Level | Method | Code changes | | --- | --- | --- | | 1 | activegraph wrap CLI | none | | 2 | ActiveGraphProxy + env var | none | | 3 | wrapLLMClient | wrap your client once | | 4 | createCallbacks (LangChain, Vercel AI SDK) | hook callbacks | | 5 | createAgentTracer | explicit spans | | 6 | Runtime + behavior | full framework |

Documentation

Full docs are in docs/ (a fumadocs site). Run locally:

cd docs
npm install
npm run dev

License

Apache-2.0