Skip to content
OpenSmartRoute
Skillv1.0.0

supermemory

Add persistent memory to AI agents using Supermemory API -- the #1 ranked AI memory engine. Use when: building AI assistants that remember users, adding long-term memory to chatbots, creating personal

by terminalskills(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from terminalskills/skills (skills/supermemory/SKILL.md). Install upstream with npx skills add terminalskills/skills --skill supermemory. Copyright stays with the author (Apache-2.0).

Supermemory

Overview

Supermemory is the memory and context layer for AI -- ranked #1 on LongMemEval, LoCoMo, and ConvoMem benchmarks. It automatically extracts facts from conversations, maintains user profiles with ~50ms retrieval, handles temporal changes and contradictions, and delivers the right context at the right time. Supports hybrid search (RAG + memory), connectors (Google Drive, Gmail, Notion, GitHub), and multi-modal input (PDFs, images, videos, code).

Instructions

Installation

npm install supermemory
# or
pip install supermemory

Get an API key at https://console.supermemory.ai

Core Memory Operations

import Supermemory from "supermemory";

const client = new Supermemory({ apiKey: process.env.SUPERMEMORY_API_KEY });

// Add a memory
const memory = await client.memories.add({
  content: "User prefers dark mode and uses TypeScript exclusively",
  userId: "user_123",
  metadata: { source: "conversation", timestamp: new Date().toISOString() },
});

// Search memories
const results = await client.memories.search({
  query: "user preferences",
  userId: "user_123",
  limit: 5,
});

// Delete a memory
await client.memories.delete(memory.id);

User Profiles (Auto-maintained)

const profile = await client.users.getProfile("user_123");
// Returns: { stable_facts, recent_activity, preferences }

Adding Memory to AI Conversations

  1. Retrieve relevant memories before each response
  2. Include memory context in the system prompt
  3. Store new information from each conversation turn
async function chatWithMemory(userId: string, userMessage: string) {
  const memories = await client.memories.search({
    query: userMessage, userId, limit: 5,
  });

  const memoryContext = memories.results.map(m => `- ${m.content}`).join("\n");

  const response = await claude.messages.create({
    model: "claude-opus-4-5",
    max_tokens: 1024,
    system: `You know this about the user:\n${memoryContext}`,
    messages: [{ role: "user", content: userMessage }],
  });

  await client.memories.add({
    content: `User said: "${userMessage}"`,
    userId,
  });

  return response.content[0].text;
}

Python Usage

from supermemory import Supermemory

client = Supermemory(api_key="your_api_key")

client.memories.add(
    content="User is building a B2B SaaS targeting HR teams",
    user_id="user_123",
)

results = client.memories.search(query="what is the user building", user_id="user_123", limit=3)
for r in results.results:
    print(f"[{r.score:.2f}] {r.content}")

Connectors (Auto-sync External Sources)

await client.connectors.connect({
  type: "google_drive",
  userId: "user_123",
  credentials: { access_token: googleAccessToken },
});

// Search across Drive docs + memories together
const results = await client.memories.search({
  query: "project requirements",
  userId: "user_123",
  includeConnectors: true,
});

MCP Integration (Claude Desktop)

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "supermemory": {
      "command": "npx",
      "args": ["-y", "supermemory-mcp"],
      "env": { "SUPERMEMORY_API_KEY": "your_api_key" }
    }
  }
}

Examples

Example 1: Personal AI Assistant with Memory

Build a chatbot that remembers user preferences across sessions:

  1. On first conversation: user mentions they work in fintech, prefer Python, and are building a payment API
  2. client.memories.add({ content: "Works in fintech, prefers Python, building payment API", userId }) stores this
  3. Next session, user asks "help me with error handling" -- search returns their context
  4. System prompt includes: "User works in fintech, prefers Python, is building a payment API"
  5. Response is tailored: Python error handling examples specific to payment processing, not generic code
  6. Profile auto-updates: { stable_facts: ["Works in fintech", "Prefers Python"], recent_activity: ["Building payment API"] }

Example 2: Knowledge Base with Connector Sync

Sync a team's Google Drive and let anyone search across all documents plus conversation history:

  1. Connect Google Drive: client.connectors.connect({ type: "google_drive", userId: "team_shared" })
  2. Supermemory indexes all Drive documents automatically
  3. Team member asks: "What did we decide about the pricing model?"
  4. Search with includeConnectors: true returns both the pricing doc from Drive and a memory from a previous conversation where the CEO said "let us go with usage-based"
  5. Response synthesizes both sources: "The pricing doc outlines three tiers, and in your last discussion the team decided on usage-based pricing"

Guidelines

  • Always scope memories to a userId for multi-user applications
  • Use metadata to tag memories with source and timestamp for traceability
  • Search before adding to avoid duplicate memories -- Supermemory handles contradictions but duplicates waste quota
  • Retrieve 3-5 memories per query for optimal context without noise
  • User profiles are auto-maintained -- no need to manually build them
  • Free tier: 1,000 memories, 100 searches/day. Pro: $20/month for 100k memories, unlimited search
  • Keep API keys in environment variables, never hardcode them
  • Connectors sync automatically after initial setup -- no polling required

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/terminalskills-skills-supermemory/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

terminalskills-skills-supermemory.ocm.jsonjson
{
  "ocm": "1",
  "id": "terminalskills-skills-supermemory",
  "kind": "skill",
  "name": "supermemory",
  "description": "Add persistent memory to AI agents using Supermemory API -- the #1 ranked AI memory engine. Use when: building AI assistants that remember users, adding long-term memory to chatbots, creating personalized AI products, storing conversation context across sessions.",
  "publisher": "terminalskills",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "coding"
    ],
    "tags": [
      "skill-md",
      "memory",
      "ai-agents",
      "rag",
      "personalization",
      "supermemory",
      "skills-sh"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Add persistent memory to AI agents using Supermemory API -- the #1 ranked AI memory engine. Use when: building AI assistants that remember users, adding long-term memory to chatbots, creating personalized AI products, storing conversation context across sessions."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "skills.sh",
      "repository": "https://github.com/terminalskills/skills",
      "path": "skills/supermemory/SKILL.md",
      "ref": "HEAD",
      "url": "https://github.com/terminalskills/skills/blob/HEAD/skills/supermemory/SKILL.md",
      "key": "terminalskills/skills/skills/supermemory/SKILL.md"
    },
    "compatibility": "Node.js 18+ or Python 3.9+",
    "license": "Apache-2.0"
  },
  "instructions": "# Supermemory\n\n## Overview\n\nSupermemory is the memory and context layer for AI -- ranked #1 on LongMemEval, LoCoMo, and ConvoMem benchmarks. It automatically extracts facts from conversations, maintains user profiles with ~50ms retrieval, handles temporal changes and contradictions, and delivers the right context at the right time. Supports hybrid search (RAG + memory), connectors (Google Drive, Gmail, Notion, GitHub), and multi-modal input (PDFs, images, videos, code).\n\n## Instructions\n\n### Installation\n\n```bash\nnpm install supermemory\n# or\npip install supermemory\n```\n\nGet an API key at https",
  "cost": {
    "context_tokens": 1337
  }
}

Fetch it by URL: GET /api/v1/registry/terminalskills-skills-supermemory/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.

supermemory - Skill - OpenSmartRoute