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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@u0z/zero-graph

v0.0.1

Published

ZeroGraph TypeScript: 100-line minimalist LLM framework. Let Agents build Agents!

Readme

ZeroGraph TypeScript

License: MIT npm version TypeScript

ZeroGraph TypeScript is a minimalist LLM framework designed for AI Agent programming

ZeroGraph is a TypeScript implementation of PocketFlow (Python), designed to collectively advance the development of agent-oriented LLM programming framework technologies and concepts.

  • Lightweight: Just 100 lines. Zero bloat, zero dependencies, zero vendor lock-in.
  • Expressive: Everything you love—(Multi-)Agents, Workflow, RAG, and more.
  • TypeScript Native: Full type safety and excellent IDE support.
  • Agentic Coding: Let AI Agents (e.g., Cursor AI) build Agents—10x productivity boost!

Installation

npm install @u0z/zero-graph

Or with yarn:

yarn add @u0z/zero-graph

Quick Start

import { Node, Flow } from '@u0z/zero-graph';

// Define a simple node
class GreetingNode extends Node {
  prep(shared: any): string {
    return shared.name || 'World';
  }

  exec(name: string): string {
    return `Hello, ${name}!`;
  }

  post(shared: any, prepRes: string, execRes: string): void {
    shared.greeting = execRes;
  }
}

// Create and run a flow
const flow = new Flow(new GreetingNode());
const shared = { name: 'TypeScript' };

flow.run(shared);
console.log(shared.greeting); // "Hello, TypeScript!"

Core Concepts

Node

The basic building block that handles simple tasks:

class MyNode extends Node {
  prep(shared: any): any {
    // Prepare data from shared store
    return shared.input;
  }

  exec(prepResult: any): any {
    // Execute the main logic
    return processData(prepResult);
  }

  post(shared: any, prepRes: any, execRes: any): string {
    // Store result and return next action
    shared.result = execRes;
    return 'default';
  }
}

Flow

Orchestrates multiple nodes through actions:

const nodeA = new NodeA();
const nodeB = new NodeB();
const nodeC = new NodeC();

// Connect nodes with actions
nodeA.next(nodeB, 'success');
nodeA.next(nodeC, 'error');

const flow = new Flow(nodeA);
flow.run(shared);

Batch Processing

Process multiple items efficiently:

class BatchProcessor extends BatchNode {
  exec(item: any): any {
    return processItem(item);
  }
}

const batchFlow = new BatchFlow(new BatchProcessor());

Async Support

Handle asynchronous operations:

class AsyncProcessor extends AsyncNode {
  async execAsync(input: any): Promise<any> {
    return await apiCall(input);
  }
}

const asyncFlow = new AsyncFlow(new AsyncProcessor());
await asyncFlow.runAsync(shared);

Examples

Check out the examples directory for comprehensive usage examples:

Documentation

Why ZeroGraph TypeScript?

Current LLM frameworks are bloated... You only need 100 lines for LLM Framework!

| | Lines | Size | TypeScript | | ------------- | :-------: | :-------: | :------------: | | LangChain | 405K | +166MB | ❌ | | CrewAI | 18K | +173MB | ❌ | | LangGraph | 37K | +51MB | ❌ | | ZeroGraph | 100 | +56KB | |

Contributing

We welcome contributions! Please see our Contributing Guide for details.

License

MIT License - see LICENSE file for details.

Links