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

@sharedmemory/sdk

v2.4.0

Published

SDK for SharedMemory — persistent memory layer for AI agents

Readme

@sharedmemory/sdk

TypeScript client for the SharedMemory API — persistent memory for AI agents.

Installation

npm install @sharedmemory/sdk

Requires Node.js 18+.

Usage

import { SharedMemory } from '@sharedmemory/sdk';

const memory = new SharedMemory({
  apiKey: 'sm_live_...',
  volumeId: 'your-volume-id',
});

// Write
const result = await memory.remember('John is the CTO of Acme Corp');

// Batch write
await memory.rememberMany([
  { content: 'Jane is VP of Engineering' },
  { content: 'Acme Corp uses React and Node.js' },
]);

// Query (raw search)
const recall = await memory.query('Who is John?');

// Chat (RAG + LLM answer) — the default way to interact
const answer = await memory.chat('What does John do at Acme?');
console.log(answer.answer, answer.sources, answer.citations);

// Get / Update / Delete
const mem = await memory.get('memory-id');
await memory.update('memory-id', 'Updated content');
await memory.delete('memory-id');

// Graph
const entity = await memory.getEntity('John');
const results = await memory.searchEntities('React');
const graph = await memory.getGraph();

// Context assembly
const context = await memory.getContext({ volumeId: 'your-volume-id' });

// Agent management
const agent = await memory.agents.create({
  orgId: 'org-id',
  projectId: 'project-id',
  name: 'my-agent',
});
const agents = await memory.agents.list({ orgId: 'org-id' });

// Real-time
const sub = memory.subscribe({
  onMemory: (event) => console.log(event),
  onActivity: (event) => console.log(event),
  onPresence: (event) => console.log(event),
});
sub.close();

Configuration

| Option | Type | Default | Description | |--------|------|---------|-------------| | apiKey | string | — | Required. API key (sm_live_...) | | baseUrl | string | https://api.sharedmemory.ai | API endpoint | | volumeId | string | default | Default volume for all operations | | agentName | string | sdk-agent | Agent name for attribution | | timeout | number | 30000 | Request timeout (ms) | | userId | string | — | Scope memories to a specific user | | agentId | string | — | Scope memories to a specific agent | | appId | string | — | App identifier for scoping | | sessionId | string | — | Default session ID |

Methods

Memory

| Method | Description | |--------|-------------| | remember(content, opts?) | Store a memory | | query(query, opts?) | Query memories and graph facts (raw search) | | chat(query, opts?) | Ask a question — LLM answers using your memories | | get(memoryId) | Get a memory by ID | | update(memoryId, content) | Update a memory | | delete(memoryId) | Delete a memory | | rememberMany(items, opts?) | Store multiple memories in batch | | deleteMany(memoryIds, opts?) | Delete multiple memories in batch | | updateMany(updates, opts?) | Update multiple memories in batch | | feedback(memoryId, feedback) | Submit feedback ({ feedback: 'POSITIVE' \| 'NEGATIVE', feedback_reason?: string }) | | history(memoryId) | Get memory audit trail |

Graph

| Method | Description | |--------|-------------| | getEntity(name, opts?) | Get entity details and relationships | | searchEntities(query, opts?) | Search entities by name | | getGraph(opts?) | Retrieve the full knowledge graph |

Context

| Method | Description | |--------|-------------| | getContext(opts?) | Get relevant context for LLM prompting |

Volumes

| Method | Description | |--------|-------------| | listVolumes() | List accessible volumes |

Agents (memory.agents.*)

| Method | Description | |--------|-------------| | agents.create(opts) | Create a new agent and get an API key | | agents.list(opts) | List agents in an organization | | agents.get(agentId) | Get agent details | | agents.update(agentId, opts) | Update agent name, description, or prompt | | agents.delete(agentId) | Deactivate an agent and revoke its key | | agents.rotateKey(agentId) | Rotate an agent's API key |

Organizations (memory.orgs.*)

| Method | Description | |--------|-------------| | orgs.list() | List organizations | | orgs.get(orgId) | Get organization details | | orgs.members(orgId) | List organization members | | orgs.applyPromo(orgId, code) | Apply a promo code |

Real-time

| Method | Description | |--------|-------------| | subscribe(opts) | Real-time updates via WebSocket |

Webhooks

| Method | Description | |--------|-------------| | webhookSubscribe(opts) | Register a webhook for memory events | | webhookUnsubscribe(opts) | Remove a webhook subscription |

Sessions

| Method | Description | |--------|-------------| | startSession(sessionId, opts?) | Start a conversation session | | endSession(sessionId, opts?) | End a session (auto-summarize) | | getSession(sessionId) | Get session details | | listSessions(opts?) | List sessions |

Export / Import

| Method | Description | |--------|-------------| | exportMemories(opts?) | Export all memories | | importMemories(memories, opts?) | Bulk import memories |

Extraction

| Method | Description | |--------|-------------| | extract(text, schemaId, opts?) | Extract structured data from text | | createExtractionSchema(schema) | Create a new extraction schema | | listExtractionSchemas(opts?) | List extraction schemas |

Documentation

https://docs.sharedmemory.ai/sdks/typescript-sdk

License

MIT