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

@yun520-1/heartflow

v0.16.0

Published

HeartFlow - AI Psychological Perception System

Readme

HeartFlow v0.16.0

AI Psychological Perception System — A minimal, production-ready psychology engine for AI agents.

HeartFlow perceives: intent, emotion, needs, defenses from user input.
HeartFlow remembers: CORE (identity), LEARNED (knowledge), EPHEMERAL (working).
HeartFlow evolves: through Reflexion-style self-reflection.


Quick Start

const { createHeartFlow } = require('./src/core/heartflow.js');

const hf = createHeartFlow();
hf.start();

// Analyze psychology
const psych = hf.analyzePsychology('I am frustrated with this bug');
console.log(psych.intent);     // { category: 'troubleshooting', confidence: 0.67 }
console.log(psych.emotion);   // { category: 'negative', intensity: 'high', signals: [...] }

// Classify input
const cls = hf.classify('How do I fix it?');
console.log(cls.category);     // 'information_seeking'

// Memory
hf.remember('lesson:file-error', 'Check file permissions', 'learned');
hf.remember('temp:context', 'current task', 'ephemeral');
console.log(hf.getMemoryStats());

// Dream consolidation
hf.dreamNow();

// Health check
hf.healthCheck().then(h => console.log(h.started)); // true

hf.stop();

Install

npm install @yun520-1/heartflow

Public API

| Method | Returns | Description | |--------|---------|-------------| | start() | void | Initialize engine | | stop() | void | Graceful shutdown | | healthCheck() | {started, uptime_ms, version, stats} | Engine health | | analyzePsychology(text) | {intent, emotion, needs, defenses, confidence} | Perceive psychology | | classify(text) | {category, emotion, confidence} | Broad category | | getMemoryStats() | {core, learned, ephemeral, ...} | Memory statistics | | getMindSpace() | {rules, workingEntries} | Active mental state | | dreamNow() | {consolidation, duration_ms, dream_complete} | Run consolidation cycle | | remember(key, value, tier) | {success, key, tier} | Store memory | | search(query) | [{key, tier, ...}] | Search all tiers | | recordOutcome(params) | {outcome, reflection, lessonStored} | Record for self-evolution | | retrieveLessons(task) | string[] | Get relevant past lessons |

Memory Tiers

| Tier | Behavior | Use Case | |------|----------|----------| | CORE | Immutable, never deleted | Identity rules, core values | | LEARNED | Persisted, accessed frequently | Accumulated knowledge | | EPHEMERAL | Session-scoped, auto-expiry | Working context |

Architecture

HeartFlow (core/heartflow.js)
├── MeaningfulMemory  (memory/meaningful-memory.js)
│   └── Three-tier memory: CORE / LEARNED / EPHEMERAL
├── PsychologyEngine (psychology/engine.js)
│   └── Intent / Emotion / Needs / Defenses perception
├── SelfEvolution    (evolution/loop.js)
│   └── Reflexion loop: record → reflect → retrieve
└── DreamEngine     (dream/engine.js)
    └── Consolidation: EPHEMERAL → LEARNED + pruning

Total: ~3300 lines of JavaScript. Zero npm dependencies.

Version

v0.16.0 — 2026-05-17