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

@577-industries/agent-memory

v1.0.0

Published

Bio-inspired memory for AI agents with logarithmic reinforcement, exponential decay, and composite recall scoring

Downloads

106

Readme

@577-industries/agent-memory

npm version License: Apache 2.0

Bio-inspired memory for AI agents with 5 memory types, logarithmic reinforcement, exponential decay, and composite recall scoring. Mimics biological memory consolidation. Zero runtime dependencies.

Implements the core algorithm described in the "Autonomous Memory Evolution" patent (December 2025) by 577 Industries.

How It Works

  Input ──► Store ──► [Duplicate?] ──yes──► Reinforce
                          │                    │
                          no             confidence +=
                          │              0.1/ln(count+2)
                          ▼
                    New Memory (0.5)

  Recall ──► Score = similarity × 0.7 + confidence × 0.3 ──► Ranked Results

  Decay  ──► confidence *= 0.95 (per 30d unreinforced) ──► delete if < 0.1

Quick Start

npm install @577-industries/agent-memory
import { MemoryStore } from "@577-industries/agent-memory";

const store = new MemoryStore({ agentId: "my-agent" });

// Store memories (auto-deduplicates)
await store.store("pattern", "Users ask about pricing first");
await store.store("preference", "Prefers bullet-point summaries");

// Reinforce when pattern repeats
await store.store("pattern", "Users ask about pricing first");
// → { reinforced: true } — confidence increases logarithmically

// Recall top memories
const memories = await store.recall(undefined, 5);

// Format for LLM system prompt
const prompt = store.format(memories);
// → "## Agent Memory\n- [pattern] Users ask about..."

// Simulate time passing and decay
store.advanceTime(35); // 35 days
store.decay(); // → { decayed: N, deleted: M }

Memory Types

| Type | Purpose | |------|---------| | pattern | Recurring workflow or behavior | | preference | User preference or style | | baseline | Metric or normal value | | entity | Key entity or relationship | | insight | Strategic observation |

API Reference

MemoryStore

| Method | Description | |--------|-------------| | new MemoryStore(config) | Create a store with optional embedding provider | | store(type, content) | Store or reinforce a memory | | recall(query?, limit?) | Recall ranked memories | | reinforce(id) | Manually reinforce a memory | | decay() | Run a decay cycle | | format(memories?) | Format for LLM prompt injection | | getAll() | Get all stored memories | | advanceTime(days) | Simulate time passing |

Pluggable Embeddings

interface EmbeddingProvider {
  embed(text: string): Promise<number[]>;
}

Without an embedding provider, the store falls back to substring matching for deduplication and confidence-only ranking for recall.

Standalone Functions

| Function | Description | |----------|-------------| | computeReinforcement(confidence, count) | Logarithmic reinforcement formula | | applyDecay(memories, config) | Exponential decay with cleanup | | scoreMemories(memories, embedding?, options?) | Composite recall scoring | | cosineSimilarity(a, b) | Vector cosine similarity | | formatMemoriesForPrompt(memories) | Format for LLM injection |

Architecture

Three bio-inspired mechanisms:

  1. Reinforcementconfidence += 0.1 / ln(count + 2) — logarithmic growth with diminishing returns
  2. Decayconfidence *= 0.95 per 30-day unreinforced cycle — exponential fade
  3. Recallscore = similarity × 0.7 + confidence × 0.3 — composite ranking

Based on the "Autonomous Memory Evolution" patent by 577 Industries.


Extracted from FORGE OS by 577 Industries.