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

@darksol/remem-v2

v0.2.0

Published

ReMEM v2 core: scoped memory planning, recall, extraction, graph expansion, and bounded context assembly for agents

Readme

ReMEM v2

Built by DARKSOL

npm version License: MIT Node Tests

The stripped-down ReMEM core: scoped memory planning, recall, extraction, graph expansion, and bounded context assembly for agents.

ReMEM v2 is the clean rebuild lane.

Instead of one giant memory class doing everything, this package focuses on the actual product center:

  • intake before storage
  • extraction before prompt bloat
  • graph-aware recursive recall
  • scoped execution for tenant/session-aware memory work
  • bounded context assembly
  • composable repositories and pipelines

Install

npm install @darksol/remem-v2

Quick Start

import { randomUUID } from 'node:crypto';
import {
  buildBoundedContextPacket,
  computeSmartRecallV2,
  createMemoryPipeline,
  executeRecallPlan,
  executeExtractionRequest,
  expandGraphRecall,
  planRecall,
  type Extractor,
  type IntakePolicy,
  type MemoryRepository,
  type SmartRecallCollectors,
} from '@darksol/remem-v2';

const repository: MemoryRepository = {
  async store(record) {
    return {
      id: randomUUID(),
      ...record,
      createdAt: Date.now(),
      updatedAt: Date.now(),
    };
  },
  async createLink(link) {
    return { id: randomUUID(), ...link, createdAt: Date.now() };
  },
  async findRecent() {
    return [];
  },
  async search() {
    return [];
  },
  async getLinksFor() {
    return [];
  },
};

const intakePolicy: IntakePolicy = {
  async evaluate(candidate) {
    return {
      accepted: candidate.content.length > 24,
      kind: 'fact',
      score: 0.72,
      threshold: 0.58,
      reason: 'Sufficient signal for storage',
      layerHint: 'semantic',
    };
  },
};

const extractor: Extractor = {
  async extract(request) {
    return {
      query: request.query,
      summary: 'No extraction sources wired yet.',
      items: [],
      links: [],
      usedChars: 0,
      truncated: false,
    };
  },
};

const pipeline = createMemoryPipeline({ repository, intakePolicy, extractor });

await pipeline.ingest({
  content: 'We decided to rebuild ReMEM around intake and extraction.',
  topics: ['roadmap', 'memory'],
  source: 'operator',
});

const collectors: SmartRecallCollectors = {
  async query(query) {
    return { query, results: [], totalAvailable: 0, tookMs: 0 };
  },
  async graph(query) {
    return { query, results: [], totalAvailable: 0, tookMs: 0, linksTraversed: 0 };
  },
  procedural() {
    return [];
  },
  async recent() {
    return [];
  },
  proceduralToQueryResult(match) {
    return match.entry;
  },
};

const recall = await computeSmartRecallV2('What matters right now?', {
  profile: 'agent-safe',
  limit: 8,
}, collectors);

const plan = planRecall({
  query: 'What matters right now?',
  profile: 'agent-safe',
  topics: ['memory', 'roadmap'],
  scope: {
    namespace: ['tenant', 'memory'],
    tenantId: 'tenant-core',
    sessionId: 'session-1',
  },
});

const packet = buildBoundedContextPacket(
  [
    {
      key: 'summary',
      title: 'Summary',
      body: 'ReMEM v2 keeps intake, recall, and context assembly as explicit seams.',
      required: true,
      priority: 10,
    },
    {
      key: 'results',
      title: 'Recall Results',
      body: recall.results.map((item) => `- ${item.content}`).join('\n'),
      priority: 7,
      metadata: { laneCount: recall.results.length },
    },
  ],
  {
    query: 'What matters right now?',
    maxChars: 320,
    includeSectionMetadata: true,
  }
);

console.log(packet.text);
console.log(plan.lanePlans);

const graphExpansion = expandGraphRecall(recall.results, recall.results, [], {
  hops: 1,
  limit: 4,
  minScore: 0.2,
});

console.log(graphExpansion.paths);

const executed = await executeRecallPlan(plan, collectors);
console.log(executed.packet.text);

const extracted = await executeExtractionRequest({
  query: 'Summarize active memory',
  profile: 'agent-safe',
  scope: {
    namespace: ['tenant', 'memory'],
    tenantId: 'tenant-core',
    sessionId: 'session-1',
  },
  includeMetadata: true,
}, collectors);

console.log(extracted.extraction.summary);

What This Package Is

This package is the v2 engine seam, not the whole legacy surface.

Good fit:

  • building a custom agent memory engine
  • implementing durable intake/extraction flows
  • running tenant- or session-aware recall and extraction work
  • swapping repositories without rewriting orchestration
  • treating graph recall as a first-class memory primitive

Not the goal:

  • shipping setup wizards
  • bundling HTTP servers
  • carrying every legacy ReMEM concern forever

Status

0.2.0 is the current release cut.

It already gives you:

  • memory contracts
  • ingestion pipelines
  • recall planning
  • smart recall fusion
  • recall plan execution
  • scoped execution contracts
  • extraction execution over the same planner/runtime spine
  • bounded context packet assembly
  • graph expansion helpers
  • packed artifact verification

Next up:

  • direct reuse as the engine under @darksol/remem

Built with teeth.