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

hippocampus-md

v0.1.4

Published

Context Lifecycle Extension for Pi/OpenClaw - hippocampal memory systems for AI agents

Readme

🧠 hippocampus.md

Context Lifecycle Extension for AI Agents — Memory that decays like biology

npm version License: MIT

What is this?

Traditional AI context management treats all information equally — keeping everything until the context window overflows, then brutally summarizing. This is like a human trying to remember every word of every conversation they've ever had.

hippocampus.md implements biologically-inspired memory decay:

  • Decisions and commitments decay slowly (λ = 0.03, half-life ≈ 23 turns)
  • User intents decay moderately (λ = 0.05, half-life ≈ 14 turns)
  • Context/background decays faster (λ = 0.12, half-life ≈ 6 turns)
  • Tool results decay quickly (λ = 0.2, half-life ≈ 3.5 turns)
  • Ephemeral messages decay rapidly (λ = 0.35, half-life ≈ 2 turns)

Quick Start

# Install globally
npm install -g hippocampus-md

# Initialize (auto-detects Pi/OpenClaw/Clawdbot)
npx hippocampus-md init

# Check status
npx hippocampus-md status

# Score a memory file
npx hippocampus-md score memory/2026-02-03.md

Commands

| Command | Description | |---------|-------------| | init | Install extension (auto-detects platform) | | status | Check installation and config | | score <file> | Score a markdown memory file | | help | Show available commands |

Manual Installation

  1. Copy extension/hippocampus.ts to ~/.pi/extensions/
  2. Set your Pi config's compaction mode to "default" (not "safeguard")
{
  "compaction": {
    "mode": "default"
  }
}

Configuration

The extension creates ~/.pi/hippocampus.config.json on first run:

{
  "enabled": true,
  "debug": false,
  "logPath": "/tmp/hippocampus-debug.log",
  "decay": {
    "decision": 0.03,
    "user_intent": 0.05,
    "context": 0.12,
    "tool_result": 0.2,
    "ephemeral": 0.35
  },
  "retention": {
    "sparse": 0.25,
    "compress": 0.65
  },
  "sparseIndex": {
    "enabled": true,
    "path": "~/.pi/hippocampus-index.json"
  }
}

Decay Rates (λ)

| Message Type | λ | Half-life | Description | |-------------|---|-----------|-------------| | decision | 0.03 | ~23 turns | Architectural choices, commitments | | user_intent | 0.05 | ~14 turns | Goals, preferences, requests | | context | 0.12 | ~6 turns | Background info, environment | | tool_result | 0.2 | ~3.5 turns | API responses, file contents | | ephemeral | 0.35 | ~2 turns | Greetings, acknowledgments |

Retention Thresholds

  • score ≥ 0.65: Keep full message
  • 0.25 ≤ score < 0.65: Compress to summary
  • score < 0.25: Move to sparse index only

How It Works

  1. Classification: Each message is classified by type using heuristic rules
  2. Importance Scoring: Base importance is calculated from content signals
  3. Decay Application: Exponential decay based on message age and type
  4. Retention Decision: Score determines keep/compress/sparse action
  5. Sparse Indexing: Low-retention items stored as embeddings for later retrieval

The Math

retention_score = base_importance × e^(-λ × age)

Where:

  • base_importance: 0-1 score from content analysis
  • λ: Type-specific decay rate
  • age: Message age in turns

Compression Results

Real-world testing shows:

  • 26-48× compression ratios while maintaining coherence
  • ~98% quality with pattern completion enabled
  • ~15% of queries need sparse index re-fetch

Part of the Agent Brain Architecture

hippocampus.md is part of a larger vision for AI agent cognition:

Contributing

Issues and PRs welcome at github.com/starvex/hippocampus-md

License

MIT © Roman Godz


"The hippocampus is not a storage device, it's a retrieval system."