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

@iflow-mcp/phillipclapham-flowscript

v1.1.3

Published

Decision intelligence for AI agents. Typed semantic queries over structured reasoning.

Readme


FlowScript is a reasoning memory system for AI agents. It gives your agents typed, queryable memory — six semantic queries that no vector store can answer — backed by a hash-chained audit trail.

This repo contains the TypeScript SDK, the FlowScript notation spec, and the web editor at flowscript.org.

Looking for the MCP server? Most developers want flowscript-agents — the Python package with MCP server, nine framework adapters, auto-extraction, and session memory.


Quick Start

npm install flowscript-core
import { Memory } from 'flowscript-core';

const mem = Memory.loadOrCreate('./agent-memory.json');

// Build reasoning directly — typed nodes with explicit relationships
const q = mem.question("Which database for agent memory?");
mem.alternative(q, "Redis").decide({ rationale: "speed critical" });
mem.alternative(q, "SQLite").block({ reason: "no concurrent writes" });
mem.tension(mem.thought("sub-ms reads"), mem.thought("$200/mo cluster"), "performance vs cost");

// Six typed queries over the reasoning graph
mem.query.tensions();            // tradeoffs with named axes
mem.query.blocked();             // what's stuck + downstream impact
mem.query.why(nodeId);           // causal chain backward from any decision
mem.query.whatIf(nodeId);        // what breaks if this changes
mem.query.alternatives(nodeId);  // what was considered + decided
mem.query.counterfactual(nodeId); // what would need to change

// 15 agent tools in OpenAI function calling format
const tools = mem.asTools();

// Human-readable serialization
console.log(mem.toFlowScript());

// Session lifecycle — prune dormant nodes to audit trail
mem.sessionWrap();
mem.save('./agent-memory.json');

Sub-millisecond graph traversal. No embeddings required, no LLM calls, no network dependency. And when memories contradict, FlowScript doesn't delete — it creates a queryable tension.


What FlowScript Does

  • Six reasoning querieswhy(), tensions(), blocked(), alternatives(), whatIf(), counterfactual(). Graph traversals, not LLM calls. Deterministic and reproducible.
  • Typed nodes — thoughts, questions, decisions, alternatives, blockers. With explicit relationships: causes, tensions, blocks.
  • Temporal intelligence — nodes track creation time, last touched, touch frequency. Session wraps prune dormant knowledge to the audit trail while promoting recurring patterns.
  • Hash-chained audit trail — every mutation logged with SHA-256 chain integrity. Tamper-evident, queryable, verifiable.
  • Token budgeting — four serialization strategies (recent, relevant, balanced, full) to fit memory into any context window.
  • Human-readable format.fs FlowScript notation that PMs can read in code review.

The Ecosystem

| Package | What it is | Install | |:--------|:-----------|:--------| | flowscript-agents | Python SDK — MCP server, 9 framework adapters, auto-extraction, session memory | pip install flowscript-agents | | flowscript-core | TypeScript SDK — Memory class, query engine, 15 agent tools, built-in MCP server | npm install flowscript-core | | flowscript-cloud | Compliance witnessing — independent chain verification + attestations (BSL 1.1) | api.flowscript.org | | flowscript.org | Web editor — CodeMirror 6 with FlowScript syntax highlighting + D3 reasoning graph visualization | — |


The Notation

FlowScript is a 21-marker semantic notation that both humans and AI can read and write. It sits between natural language (ambiguous, verbose) and formal logic (precise, unreadable).

{database_decision:
  ? which_database_for_sessions | Redis vs PostgreSQL
  + Redis: sub-ms reads, proven at scale
  + PostgreSQL: rich queries, $15/month, ACID
  >< performance vs cost
  [decided(rationale: "budget constraint eliminated Redis", on: "2026-03-30")]
  ! migration_blocked(reason: "data export tool needed", since: "2026-03-28")
}

The notation is optional — the TypeScript and Python APIs handle everything programmatically. The notation exists for human-readable serialization, code review, and direct authoring by power users.

Every marker has computational semantics. ? creates a question node. + creates alternatives. >< creates a tension. ! creates a blocker. The parser turns this into the same IR that the query engine traverses.

Full spec: spec/ directory in this repo (757 lines, v2.1).


Web Editor

The web editor at flowscript.org provides:

  • CodeMirror 6 with custom FlowScript language mode and syntax highlighting
  • D3 force-directed graph visualization of reasoning nodes and relationships
  • Live query panel — run tensions(), blocked(), why() against your graph in the browser
  • WCAG AA accessible, responsive design

Source code in web/.


Links