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

@jonathangu/openclawbrain

v0.3.8

Published

Compatibility OpenClawBrain package for older OpenClaw plugin installs; canonical front door is @openclawbrain/openclaw.

Readme

OpenClawBrain

A graph-brain memory layer for OpenClaw agents that keeps useful context bounded.

OpenClawBrain organizes memories and tool-call history into a graph, retrieves a small useful slice before the prompt is built, and learns from outcomes in the background. The live path serves promoted packs only, so latency stays predictable and the hot path does not call a live LLM on every traversal hop. Publicly, the story is performance first, cost second, mechanism third: better agent performance is the win, lower cost is plausible, and bounded useful memory plus background learning are the mechanism. Checked replay is already better than no_brain on real traces, but the replay set is still small and mixed, so direct spend savings and learned_route dominance are not proven. If the memory layer is unavailable, the agent keeps running.

Status: actively developed. See CHANGELOG.md for current package versions and release history.

Documentation · Claims boundary · Changelog · Contributing · npm: plugin · npm: CLI

Start Here

| Audience | Start here | What you get | | --- | --- | --- | | Evaluator | How it works | A fast read on what OpenClawBrain is and how it behaves | | Operator | Install and verify | The one-command front door and the next docs to read | | Contributor | For contributors | Architecture docs, setup, and contribution boundaries |

How it works

  1. Store. OpenClawBrain keeps conversation history and explicit user corrections as durable memory.
  2. Retrieve. Before OpenClaw builds a prompt, the installed extension compiles a bounded slice of context from the currently promoted pack.
  3. Learn. After the response path completes, the learning pipeline exports turns, builds a candidate pack, and only serves it after promotion.
  4. Trace. Operator surfaces record why the serve path chose the current pack and whether learned routing is active.

What makes it different:

  • Useful context stays bounded on the live path, and learning stays off that path so latency stays predictable.
  • The runtime serves promoted packs, not partially written state.
  • Explicit user corrections can outrank stale recap material when they conflict.
  • The extension fails open. When the memory layer is unavailable, the agent still answers.

Mental model: learner, teacher, and route_fn

If you only remember one explanation, use this one:

  • Learner = the background OpenClawBrain pipeline. It watches exported events, binds feedback to prior decisions, builds candidate packs, and updates the learned routing policy.
  • Teacher = the optional local model that produces extra supervision artifacts off the hot path.
  • route_fn = the learned policy artifact the live runtime uses to decide which bounded graph blocks to inject before prompt build.

In one pass:

  1. OpenClaw turns produce interactions plus explicit feedback such as corrections, teachings, approvals, and suppressions.
  2. OpenClawBrain normalizes those into event exports and serve-time route traces.
  3. The learner builds a candidate pack with graph blocks, embeddings, structural metadata, and a learned route_fn.
  4. Background learning attaches supervision from human feedback, harvested labels, and teacher artifacts, then updates the routing policy.
  5. Only promoted packs serve on the live path. The runtime injects a small useful slice of context, and the hot path stays bounded instead of calling a live LLM on every traversal hop. It fails open if nothing safe or useful is available.

That is why OpenClawBrain is more than retrieval: it does not just find similar past text. It learns which context helps, keeps that learning off the hot path, and only serves immutable promoted packs.

Install and verify

Prerequisites:

  • A working OpenClaw installation
  • Node.js 20+
  • npm

The public operator front door is one command pinned to one OpenClaw home:

openclawbrain install --openclaw-home ~/.openclaw
openclaw gateway restart
openclawbrain status --openclaw-home ~/.openclaw --detailed

install is the public front door for the selected home. It writes or repairs the hook for that home and pins the activation root the runtime serves from. status --detailed is the quick verification surface.

Activation and teacher wiring are separate checks. Seeing BRAIN LOADED or an attached home means the runtime hook is wired correctly for that OpenClaw home. It does not by itself prove that an optional teacher model is configured. Teacher wiring lives on its own config path (brainTeacherEnabled, brainTeacherProvider, brainTeacherModel) and should be verified through status fields such as teacherConfigured, teacherProvider, teacherModel, and teacherConfigError.

When you need durable operator evidence today, run the proof surface for the same home:

openclawbrain proof --openclaw-home ~/.openclaw

The intended canonical lane is the same install command with optional --proof. Until that lands cleanly across every operator surface, proof stays a separate follow-up command. proof writes summary.md, steps.json, verdict.json, raw step logs, and proof pointers under one bundle directory.

Manual native-package lane (not the public default):

openclaw plugins install @openclawbrain/openclaw
openclawbrain install --openclaw-home ~/.openclaw

openclaw plugins update openclawbrain
openclawbrain install --openclaw-home ~/.openclaw

Use that manual lane only for explicit compatibility or maintainer work on the native package layer. The public operator story stays on openclawbrain install.

A healthy install or repair should report the profile as attached. After the first promoted pack is available, detailed status should also report serveState=serving_active_pack. If you are using an optional teacher model, the same detailed status should also show teacherConfigured=true, the expected provider/model, and teacherConfigError=null.

Next docs:

Scope and boundaries

OpenClawBrain is a memory layer for OpenClaw. It does not own the gateway.

It does:

  • Provide one operator front door for install and repair on a selected OpenClaw home
  • Store sessions and explicit corrections as durable memory
  • Build candidate packs in the background and promote them when ready
  • Keep the live path on promoted packs so useful context stays bounded and latency stays predictable
  • Expose status, rollback, detach, uninstall, and learning inspection commands
  • Fail open when memory compilation cannot safely add context

It does not:

  • Start, stop, or reconfigure the OpenClaw gateway for you
  • Edit LaunchAgent files or gateway environment files
  • Claim same-gateway multi-profile attachment as a proven public lane
  • Claim shared-root concurrent write safety

Documentation

Start with the index at docs/README.md.

Key docs:

For contributors

If you want to work on the repo, start here:

Repo setup and validation:

npm install
npm test
npm run release:verify

If you change the public story, update the README, docs index, changelog, and claims boundary in the same pass.