🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@clude/sdk

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@clude/sdk

Persistent memory SDK for AI agents — Stanford Generative Agents architecture on Supabase + pgvector

latest
Source
npmnpm
Version
3.4.0
Version published
Maintainers
1
Created
Source

Clude

npm version License: MIT

Cognitive memory for AI agents. Not just storage — synthesis.

Clude gives any agent persistent, typed memory with hybrid retrieval (vector + keyword + tags + importance), differential decay, a bond-typed memory graph, and autonomous consolidation. TypeScript declarations included.

  • Local-first: SQLite + local embeddings. Zero API keys, zero network, full semantic search offline.
  • Hosted: one API key, no infrastructure — npx @clude/sdk register
  • Benchmarked: 85.0% on LongMemEval-S, reproducible — the harness, per-question outputs, and judge model ship in the repo. 1.96% hallucination on HaluMem.
  • Portable: export/import memories as JSON, Markdown, ChatGPT, Claude, or Gemini packs.

Works with Claude Code, Claude Desktop, Cursor, and any MCP-compatible runtime.

Need a small footprint? npm install @clude/sdk --omit=optional skips the local embedding runtime (~85% smaller install); local mode then uses keyword search and clude status tells you so.

Quick start

npx @clude/sdk setup   # register + config + MCP install, ~30 seconds

Works headless too: with no TTY it completes in local-only mode (set CLUDE_SETUP_EMAIL to register in CI).

Or use the SDK directly:

import { Cortex } from '@clude/sdk';

const brain = new Cortex({
  hosted: { apiKey: process.env.CORTEX_API_KEY! },
});

await brain.init();

await brain.store({
  type: 'episodic',
  content: 'User asked about pricing and seemed frustrated.',
  summary: 'Frustrated user asking about pricing',
  tags: ['pricing', 'user-concern'],
  importance: 0.7,
  source: 'my-agent',
});

const memories = await brain.recall({ query: 'what do users think about pricing', limit: 5 });
const context = brain.formatContext(memories);  // markdown, ready for your system prompt

Storage modes

ModeConfigStorage
HostedCORTEX_API_KEYclude.io, isolated per API key
Self-hostedSUPABASE_URL + SUPABASE_SERVICE_KEYyour Supabase (PostgreSQL + pgvector)
Local (default)none~/.clude/brain.db — SQLite + local embeddings, fully offline
Local (JSON)CLUDE_LOCAL=true or --local~/.clude/memories.json, portable single file

Self-hosted unlocks the full cognitive layer: dream cycles (consolidation, reflection, contradiction resolution), the entity graph, and memory packs.

MCP integration

{
  "mcpServers": {
    "clude-memory": {
      "command": "npx",
      "args": ["@clude/sdk", "mcp-serve"],
      "env": { "CORTEX_API_KEY": "clk_..." }
    }
  }
}

Or npx @clude/sdk setup to install automatically. Your agent gets 8 tools: recall_memories, store_memory, batch_store_memories, list_memories, update_memory, delete_memory, get_memory_stats, find_clinamen (anomaly retrieval). A remote Streamable-HTTP connector is also available at https://clude.io/api/mcp (npx @clude/sdk connect).

CLI

npx @clude/sdk setup          # Guided setup: register + config + MCP install
npx @clude/sdk status         # Mode, storage, MCP detection, memory stats
npx @clude/sdk register       # Get a hosted API key
npx @clude/sdk mcp-install    # Install MCP config for your IDE
npx @clude/sdk mcp-serve      # Run as a stdio MCP server
npx @clude/sdk connect        # Connect Claude Desktop / claude.ai via remote MCP
npx @clude/sdk export         # Export memories (json/md/chatgpt/gemini/memorypack)
npx @clude/sdk import         # Import from ChatGPT export, markdown, JSON
npx @clude/sdk doctor         # Diagnostics

Memory model

Five typed stores with differential decay — accessed memories are reinforced, unaccessed ones fade:

TypeDecay/dayUse for
episodic7%events, conversations
semantic2%facts, knowledge, insights
procedural3%workflows, what works
self_model1%identity, preferences
introspective2%reflections, journals

Retrieval is hybrid-scored (recency + relevance + importance + vector similarity, weighted by decay) with entity-aware expansion and bond-typed graph traversal. Co-retrieved memories strengthen their links (Hebbian reinforcement).

Docs

Built on research from Stanford Generative Agents, MemGPT/Letta, and CoALA. The same engine powers @Cludebot, an autonomous agent running publicly 24/7 — a live demonstration of the memory system.

License

MIT

Keywords

ai-agent

FAQs

Package last updated on 14 Jul 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts