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

@reactive-agents/memory

v0.10.6

Published

Memory system for Reactive Agents — Working, Semantic, Episodic, and Procedural memory backed by bun:sqlite

Readme

@reactive-agents/memory

Version: 0.10.3 — memory system for Reactive Agents.

Four memory tiers — Working, Semantic, Episodic, Procedural — backed by bun:sqlite with FTS5 full-text search (Tier 1) and optional sqlite-vec KNN vectors (Tier 2). Plus an ExperienceStore for cross-agent learning, a background MemoryConsolidator (decay + summarization), a Zettelkasten link index, and the SessionStore that powers gateway chat mode.

Installation

bun add @reactive-agents/memory

Requires Bun — uses bun:sqlite natively. Tier 2 also requires the sqlite-vec extension, which bun:sqlite loads at runtime.

Memory tiers

| Service | Purpose | Backend | |---|---|---| | WorkingMemoryService | Short-term in-session items, LRU-evicted | SQLite (in-memory or file) | | SemanticMemoryService | Long-term knowledge, FTS5 + optional vec | SQLite + FTS5 | | EpisodicMemoryService | Conversation / session history (turns, snapshots) | SQLite | | ProceduralMemoryService | Learned workflows / step sequences | SQLite |

Cross-cutting:

  • ExperienceStore — per-(agent, model) records of tool patterns, error recoveries, success signals; consumed by the calibration system.
  • MemoryConsolidatorService — background decay + summarization; rolls older episodic turns into compact summaries.
  • ZettelkastenService — bidirectional links between memory entries.
  • SessionStoreService — persistent (platform, sender) chat sessions (used by gateway chat mode).
  • SkillStoreService / DebriefStoreService / PlanStoreService — auxiliary stores for the kernel and skill system.
  • AgentMemoryFromMemoryService — port adapter that satisfies the narrow AgentMemory Tag in @reactive-agents/core from a MemoryService provider.

Two retrieval tiers

  • Tier 1 — FTS5. Fast, deterministic keyword search; no embeddings required. Best for short, key-term queries. Verbose natural-language queries should be decomposed first.
  • Tier 2 — vector search. sqlite-vec KNN; requires an embedding provider (OpenAI, Anthropic-compatible, or Ollama).

Quick example

import { ReactiveAgents } from "@reactive-agents/runtime";

const agent = await ReactiveAgents.create()
  .withName("my-agent")
  .withProvider("anthropic")
  .withModel("claude-sonnet-4-20250514")
  .withMemory("1") // "1" = FTS5; "2" = vector embeddings
  .build();

const r1 = await agent.run("Remember that my favorite color is blue.");
const r2 = await agent.run("What's my favorite color?"); // recalls 'blue'

For finer control, withMemory({ tier, dbPath, working, semantic, episodic, procedural }) exposes per-service options.

Direct service usage

import { Effect, Layer } from "effect";
import {
  MemoryServiceLive,
  SemanticMemoryService,
  ExperienceStoreLive,
  createMemoryLayer,
} from "@reactive-agents/memory";

const layer = createMemoryLayer({ tier: "1", dbPath: "./memory.db" });

await Effect.runPromise(
  Effect.gen(function* () {
    const sem = yield* SemanticMemoryService;
    yield* sem.store({ content: "RAFT is a consensus algorithm...", tags: ["distsys"] });
    return yield* sem.search({ query: "consensus", limit: 5 });
  }).pipe(Effect.provide(layer)),
);

Environment variables (Tier 2 only)

EMBEDDING_PROVIDER=openai          # openai | anthropic | ollama | custom
EMBEDDING_MODEL=text-embedding-3-small
OPENAI_API_KEY=sk-...

Gateway chat session persistence

When .withGateway() and .withChannels() are combined in chat mode, the runtime uses SessionStoreService from this package to persist (platform, senderId) conversations across process restarts. Each session is windowed (40 turns / 8 KiB), compacted daily, and pruned by TTL.

Experience store (cross-agent learning)

import { ExperienceStore } from "@reactive-agents/memory";

const exp = yield* ExperienceStore;
yield* exp.record({
  agentId: "researcher",
  modelId: "claude-sonnet-4-20250514",
  toolName: "web-search",
  outcome: "success",
  /* ... */
});

const summary = yield* exp.queryByModel("claude-sonnet-4-20250514");

ExperienceSummary materialization feeds the calibration system in @reactive-agents/llm-provider.

Documentation

License

MIT