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

@mounaji_npm/learning-core

v0.1.2

Published

The neural weighting engine as a reusable, root-parameterized library — Hebbian/gradient learning over intents, collections and skills with recency decay, co-occurrence and feedback, plus injectable onEvent and export/import state. Extracted from mcp-moun

Readme

@mounaji_npm/learning-core

The neural weighting engine as a reusable, root-parameterized library, extracted from mcp-mounaji-rag. It learns which intents, collections and skills matter — from search frequency, feedback, recency decay and co-occurrence — and turns those weights into boost multipliers via a sigmoid.

Zero runtime dependencies (Node built-ins only).

What changed vs. the MCP's internal copy

  • Root is a constructor argument (not process.env.YOAGENT_ROOT), so many agents can each own an isolated engine — e.g. an @mounaji_npm/agentfs learning/ layer.
  • onEvent is injected instead of a hard-wired dispatchEvent.
  • Adds exportState / importState for durability (Supabase mirror) and portability (Tier S export).

File names and formats are unchanged, so it reads/writes the same intent_weights.json, collection_weights.json, etc. the MCP already uses.

Usage

import { createLearningEngine } from '@mounaji_npm/learning-core';

const engine = createLearningEngine({
  root: '/data/agents/yoagent-abc/learning',
  onEvent: (type, payload) => bus.emit(`learning.${type}`, payload), // optional
  scopeContext: { agentId: 'abc' },                                  // optional
  config: { learningRate: 0.15 },                                    // optional overrides
});

engine.processSearchEvent({
  query: 'how does billing work',
  intent: 'find_convention',
  collections: ['mcp_conventions'],
  skillsHit: ['billing-service'],
  topScore: 0.82,
  resultCount: 5,
  feedback: 'positive', // optional: 'positive' | 'negative' | null
});

engine.getIntentBoost('find_convention', 1.2); // learned + base, clamped
engine.getWeightSnapshot();                     // all weights + boosts for a UI

Compose with agentfs

import { createAgentFs } from '@mounaji_npm/agentfs';
import { createLearningEngine } from '@mounaji_npm/learning-core';

const fs = createAgentFs({ root, agentId });
const engine = createLearningEngine({ root: fs.layerPath('learning') });
// engine state now lives inside the agent's portable bundle.

Durability

const state = engine.exportState();     // plain object → persist to Supabase
engine.importState(state);              // rehydrate a fresh/ephemeral engine

API

  • createLearningEngine(opts) / new LearningEngine(opts){ root, config?, onEvent?, scopeContext? }.
  • processSearchEvent(params) — main entry point; updates all weights, records the pattern, tracks co-occurrence, emits a search event.
  • updateIntentWeight / updateCollectionWeight / updateSkillWeight.
  • getIntentBoost / getCollectionBoost / getSkillBoost / getLearnedKeywords.
  • detectIntentWithLearning(query, rules) — base + learned + stem matching.
  • learnKeywords / trackCoOccurrence / recordSearchPattern.
  • getWeightSnapshot / getSearchPatternData.
  • appendFeedback / readFeedbackLog.
  • loadConfig / saveConfig, getDefaultLearningConfig().
  • exportState() / importState(state).

Test

npm test   # node --test