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

pug-brain-openclaw

v2.27.5

Published

PugBrain plugin for OpenClaw — brain-inspired persistent memory for AI agents

Readme

PugBrain OpenClaw Plugin

Brain-inspired persistent memory for AI agents in OpenClaw.

Overview

This plugin integrates PugBrain with OpenClaw, providing persistent memory capabilities for AI agents. PugBrain uses a neural network-inspired architecture with neurons, synapses, and fibers to store and retrieve memories contextually.

Prerequisites

  • Python 3.10+ with pug-brain installed:

    pip install pug-brain
  • OpenClaw installed and configured

Installation

Option 1: Install from npm

npm install pug-brain-openclaw

Option 2: Install from source

cd integrations/openclaw-plugin
npm install
npm run build

Configuration

1. Enable the Plugin

Add to your openclaw.json:

{
  "plugins": {
    "slots": {
      "memory": "pug-brain"
    }
  }
}

This replaces the default memory provider with PugBrain.

2. Configure Plugin Settings

{
  "plugins": {
    "slots": {
      "memory": "pug-brain"
    },
    "pug-brain": {
      "pythonPath": "python",
      "brain": "default",
      "autoContext": true,
      "autoCapture": true,
      "contextDepth": 1,
      "maxContextTokens": 500,
      "timeout": 30000
    }
  }
}

Configuration Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | pythonPath | string | "python" | Path to Python executable with pug-brain installed | | brain | string | "default" | Brain name to use for this workspace | | autoContext | boolean | true | Auto-inject relevant memories before each agent run | | autoCapture | boolean | true | Auto-extract and store memories after each agent run | | contextDepth | integer | 1 | Recall depth: 0=instant, 1=context, 2=habit, 3=deep | | maxContextTokens | integer | 500 | Maximum tokens for auto-context injection | | timeout | integer | 30000 | MCP request timeout in milliseconds |

Context Depth Levels

| Level | Mode | Description | |-------|------|-------------| | 0 | Instant | Quick lookup of recent memories | | 1 | Context | Contextual recall based on current task | | 2 | Habit | Include habit patterns and workflows | | 3 | Deep | Full graph traversal for comprehensive recall |

Available Tools

The plugin exposes these memory tools to OpenClaw agents:

| Tool | Description | |------|-------------| | pugbrain_remember | Store a new memory with type, priority, and tags | | pugbrain_recall | Search and retrieve relevant memories | | pugbrain_context | Get context-aware memory suggestions | | pugbrain_todo | Manage task-related memories | | pugbrain_auto | Automatic memory processing | | pugbrain_suggest | Get AI-powered memory suggestions | | pugbrain_session | Session-based memory management | | pugbrain_stats | View brain statistics | | pugbrain_health | Check brain health and connectivity | | pugbrain_forget | Remove outdated or incorrect memories | | pugbrain_edit | Modify existing memories |

Memory Types

PugBrain supports various memory types for different purposes:

  • fact - Factual information
  • decision - Choices made and rationale
  • error - Bugs, issues, and fixes
  • insight - Patterns and discoveries
  • preference - User preferences
  • workflow - Process documentation
  • instruction - Standing instructions

Usage Examples

Store a Decision

// Agent automatically captures this after task completion
{
  type: "decision",
  content: "Chose PostgreSQL over MongoDB because ACID needed for payments",
  priority: 7,
  tags: ["database", "payments", "architecture"]
}

Recall Context

// Before starting a task, agent retrieves relevant context
pugbrain_recall({
  query: "authentication implementation",
  limit: 5
})

Track Workflows

pugbrain_remember({
  type: "workflow",
  content: "Deploy process: build → test → push → verify",
  priority: 6,
  tags: ["deploy", "ci-cd"]
})

Multiple Brains

Each workspace can use a different brain for isolated memory:

{
  "plugins": {
    "pug-brain": {
      "brain": "project-alpha"
    }
  }
}

Brains are automatically created when first accessed.

Development

Build

npm run build

Test

npm test

Type Check

npm run typecheck

Architecture

src/
  index.ts       - Plugin entry point and OpenClaw integration
  mcp-client.ts  - MCP protocol client for communicating with pug-brain
  tools.ts       - Tool definitions and implementations
  types.ts       - TypeScript type definitions

Troubleshooting

"Python not found"

Ensure pythonPath points to a Python installation with pug-brain:

python -c "import neural_memory; print(neural_memory.__version__)"

"MCP connection timeout"

Increase the timeout setting:

{
  "plugins": {
    "pug-brain": {
      "timeout": 60000
    }
  }
}

"Brain not found"

Brains are created automatically. Check the brain name matches:

pug list  # List all available brains

License

MIT

Links