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

pi-memory-strata

v0.1.0

Published

Four-layer stratified memory architecture for long-horizon AI agent projects. Auto-distillation, memory decay, and Obsidian vault integration.

Readme

Memory Strata — 四层分层记忆架构

Four-layer stratified memory architecture for long-horizon AI agent projects. Solves critical fact forgetting, memory bloat, and knowledge sedimentation failures.


Architecture

L1  System Injection   MEMORY.md — key points + anchors        (auto-loaded every session)
L2  Project Core       project-core.md — stable facts + ADR     (rarely changes)
L3  Dev Status         dev-status.md — progress/params/issues     (updates with progress)
L4  Daily Journal      YYYY-MM-DD.md — session log              (per-session)

Three Mechanisms

1. Auto-Distillation (Episodic → Semantic)

  • L4→L3: milestone completed, or referenced across ≥2 sessions
  • L3→L2: stable ≥1 month + confirmed fact + likely needed in future
  • L2→L1: useful beyond this project (user preferences, general lessons)

2. Memory Strength Decay (last_used)

  • Tag entries with [last_used: YYYY-MM-DD]
  • 14 days unused → ⚡ rarely used

  • 30 days unused → auto-archive

3. Zettelkasten Link Enhancement

  • Bidirectional [[...]] links between L2↔L3
  • Check link integrity with the distillation script

Quick Start

1. Initialize a project

npx pi-memory-strata init-project <project-name>

2. Run daily maintenance (or schedule with cron)

npx pi-memory-strata maintain --vault /path/to/vault

3. Check memory health

npx pi-memory-strata check --vault /path/to/vault

Installation

As Pi Extension

pi install npm:pi-memory-strata

As npm package

npm install -g pi-memory-strata

Direct usage (no install)

npx pi-memory-strata <command>

Programmatic API

import { MemoryStrata } from 'pi-memory-strata';

const strata = new MemoryStrata({
  vaultPath: '/path/to/obsidian-vault',
  autoArchiveDays: 30,
  staleWarningDays: 14,
});

// Run distillation check
const check = await strata.check();
console.log(check.ok);

// Run daily maintenance
const report = await strata.maintain();
console.log(report.health);

// Initialize new project
strata.initProject('my-project');

Vault Structure

obsidian-vault/
├── 00-brain/
│   └── MEMORY.md              # L1: System injection
├── 10-journal/
│   ├── maintenance/           # Daily maintenance reports
│   ├── summary/               # Auto-generated daily summaries
│   └── 2026-01-01.md        # L4: Daily logs
├── 20-projects/
│   └── my-project/
│       ├── dev-status.md    # L3: Development status
│       └── project-core.md  # L2: Project core archive
├── 30-knowledge/
├── 60-learnings/
│   └── archive/             # Auto-archived entries
├── scripts/
│   ├── memory_distill_check.py
│   └── daily_memory_maintenance.py
└── templates/
    ├── 01-status.md
    └── 02-core.md

Daily Maintenance (Automated)

Schedule daily maintenance with cron or systemd:

# Every day at 09:30
30 9 * * * npx pi-memory-strata maintain

Maintenance performs:

  1. Journal coverage check — verify last 7 days have logs
  2. Dev status freshness — warn if >7 days without update
  3. Core archive freshness — warn if >30 days without update
  4. Memory decay — identify entries with stale last_used
  5. Anchor integrity — verify memory anchors exist
  6. Bidirectional links — check L2↔L3 link completeness
  7. Auto-archive — move >30d stale entries to 60-learnings/archive/
  8. Daily summary — generate previous day's summary

Academic Context

| Concept | Source | This Package | |---------|--------|-------------| | Write-Manage-Read loop | arXiv:2603.07670 | W(journal) + M(distill/decay) + R(search) | | Episodic→Semantic promotion | A-MEM (NeurIPS 2025) | L4→L3→L2 distillation | | Memory strength decay | MemoryBank (2024) | last_used + 30-day archive | | Zettelkasten linking | A-MEM | Obsidian [[...]] bidirectional links | | Atomic facts | AtomMem (2026) | Memory anchors with consequence tags |

License

MIT