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

@qmilab/lodestar-memory-firewall-mem0

v0.3.0

Published

mem0 import adapter — bring mem0 records through the Lodestar Memory Firewall as external_document evidence at unverified/restricted, never silently promoted. Part of Lodestar, the trust layer for AI agents.

Readme

@qmilab/lodestar-memory-firewall-mem0

Adapter that imports memories from mem0 into the Lodestar memory firewall.

v0.2 scope (Batch 2 deliverable)

  • importMemories(raw, options) is implemented end-to-end: validates the mem0 export schema, constructs one Claim + one EvidenceSet per record, and adopts each as a Belief at truth_status: unverified / retrieval_status: restricted. Returns a structured result with per-record rejection reasons.
  • exportMemories() and syncMemories() throw — full semantics need adapter-specific design work that exceeds this batch's budget.

Usage

import {
  InMemoryBeliefStore,
  InMemoryClaimStore,
  InMemoryEvidenceStore,
  MemoryFirewall,
} from "@qmilab/lodestar-memory-firewall"
import { Mem0Adapter } from "@qmilab/lodestar-memory-firewall-mem0"

const claims = new InMemoryClaimStore()
const beliefs = new InMemoryBeliefStore()
const evidence = new InMemoryEvidenceStore()
const firewall = new MemoryFirewall(claims, beliefs, evidence, async () => {})

const adapter = new Mem0Adapter(firewall, evidence)

const result = await adapter.importMemories(
  {
    source: "mem0",
    memories: [
      { id: "m1", memory: "User prefers small, focused PRs.", user_id: "u1" },
    ],
  },
  {
    scope: { level: "project", identifier: "my-project" },
    sensitivity: "internal",
    source_actor_id: "human-nandan",
    trust_baseline: 0.5,
  },
)

console.log(result)
// { adapter: "mem0", imported_count: 1, ..., belief_ids: [...] }

Why imports cannot self-promote

mem0 records are external documents from the firewall's point of view. The Round 5 invariant says external_document evidence cannot promote silently through auto_observation — adopting them at truth_status: supported would defeat the no-self-promotion rule that protects against MemoryGraft-class attacks. The adapter therefore lands every import at unverified/restricted, and a reflection pass or human action must explicitly promote them before they enter normal retrieval.

What is not in scope

  • Real mem0 SDK integration (HTTP calls, vector search, etc.). The adapter operates on an exported JSON structure, not against a live mem0 instance.
  • Bidirectional sync (writing Lodestar beliefs back into mem0).
  • Schema evolution. The export shape is captured against the v0 upstream format; future mem0 versions will need a separate adapter pack.