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

@manifesto-ai/memory

v1.3.0

Published

Manifesto Memory Layer - Memory retrieval, verification, and tracing

Readme

@manifesto-ai/memory

Memory is the retrieval layer for past World/Snapshot information in Manifesto.


What is Memory?

Memory provides a 4-Layer Architecture for searching and using past World information. It operates as an optional layer between Actors and World Protocol.

In the Manifesto architecture:

Actor ──→ MEMORY ──→ World Protocol
              │
     Retrieves past Worlds
     Traces selection decisions

What Memory Does

| Responsibility | Description | |----------------|-------------| | Store | Persist and retrieve World objects | | Verify | Pure function verification of World existence/integrity | | Select | Find relevant past Worlds based on queries | | Trace | Record selection decisions for accountability |


What Memory Does NOT Do

| NOT Responsible For | Who Is | |--------------------|--------| | Execute effects | Host | | Apply patches | Host | | Make governance decisions | World | | Compute state transitions | Core |


Installation

npm install @manifesto-ai/memory
# or
pnpm add @manifesto-ai/memory

Peer Dependencies

npm install @manifesto-ai/world  # Required peer

Quick Example

import {
  InMemoryStore,
  createExistenceVerifier,
  createSimpleSelector,
  createMemoryTrace,
  attachToProposal,
} from "@manifesto-ai/memory";
import type { ActorRef } from "@manifesto-ai/world";

// Setup
const store = new InMemoryStore();
const verifier = createExistenceVerifier();
const selector = createSimpleSelector(store, verifier);

// Index a World
store.put(world);
selector.addToIndex(world.worldId, ["keyword1", "keyword2"], world.createdAt);

// Select relevant memories
const actor: ActorRef = { actorId: "agent-1", kind: "agent" };
const result = await selector.select({
  query: "keyword1",
  atWorldId: currentWorld.worldId,
  selector: actor,
  constraints: { maxResults: 5, minConfidence: 0.7 },
});

// Create trace and attach to proposal
const trace = createMemoryTrace(
  actor,
  "keyword1",
  currentWorld.worldId,
  result.selected
);
const proposalWithMemory = attachToProposal(proposal, trace);

See GUIDE.md for the full tutorial.


Core Concepts

Memory ≠ Truth

Memory is a reference to past Worlds, not the truth itself. The referenced World is the source of truth.

Selection is Non-deterministic but Traced

Memory selection may involve LLM-based ranking or other non-deterministic processes. However, every selection MUST be recorded in a MemoryTrace for accountability.

Verifier MUST be Pure

Verifiers are pure functions with no side effects:

  • No Store access
  • No IO (network, filesystem)
  • No Date.now()
  • Same inputs always produce same outputs

API Overview

Interfaces

// Store - Persists and retrieves Worlds
interface MemoryStore {
  get(worldId: WorldId): Promise<World | null>;
  exists(worldId: WorldId): Promise<boolean>;
}

// Verifier - Pure function verification (M-8)
interface MemoryVerifier {
  prove(memory: MemoryRef, world: World): ProveResult;
  verifyProof(proof: VerificationProof): boolean;
}

// Selector - Finds relevant past Worlds
interface MemorySelector {
  select(request: SelectionRequest): Promise<SelectionResult>;
}

Trace Utilities

function createMemoryTrace(
  selector: ActorRef,
  query: string,
  atWorldId: WorldId,
  selected: SelectedMemory[]
): MemoryTrace;

function attachToProposal<P extends Proposal>(
  proposal: P,
  trace: MemoryTrace
): P;

function getFromProposal(proposal: Proposal): MemoryTrace | undefined;

// M-12: Extract proof for Authority verification
function extractProof(evidence: VerificationEvidence): VerificationProof;

Verifier Implementations

| Verifier | Complexity | Security | Use Case | |----------|------------|----------|----------| | ExistenceVerifier | Low | Low | Development/testing | | HashVerifier | Medium | Medium | General production | | MerkleVerifier | High | High | Audit compliance |

See SPEC.md for complete API reference.


Relationship with Other Packages

┌─────────────┐
│    Actor    │ ← Uses Memory to reference past Worlds
└──────┬──────┘
       │
       ▼
┌─────────────┐
│   MEMORY    │
└──────┬──────┘
       │
       ▼
┌─────────────┐
│    World    │ ← Memory depends on World types
└─────────────┘

| Relationship | Package | How | |--------------|---------|-----| | Depends on | @manifesto-ai/world | Uses WorldId, World, ActorRef, Proposal types | | Used by | Actor implementations | Actors use Memory to reference past decisions |


Module Boundaries (SPEC §9)

| Module | Store | prove() | verifyProof() | Selector | |--------|-------|---------|---------------|----------| | Actor | ✅ | ✅ | ✅ | ✅ | | Projection | ❌ | ❌ | ❌ | ❌ | | Authority | ❌ | ❌ | ✅ | ❌ | | Host | ❌ | ❌ | ❌ | ❌ | | Core | ❌ | ❌ | ❌ | ❌ |


When to Use Memory Directly

Most applications don't need Memory.

Use Memory directly when:

  • Referencing past World states for decision-making
  • Tracking decision rationale with verifiable evidence
  • Audit compliance requiring proof of past state access
  • Building AI agents that need historical context

Documentation

| Document | Purpose | |----------|---------| | GUIDE.md | Step-by-step usage guide | | SPEC.md | Complete specification | | FDR.md | Design rationale | | USAGE.md | World integration guide |


License

MIT