open-index/open-npm huggingface dataset:
npm package: @retain-so/sdk
Description: Official Retain SDK for Node.js
Latest version: 0.1.0

# Retain Node.js SDK

Official Retain SDK for Node.js.

**See full documentation:** [retain.so/docs](https://retain.so/docs)

## Install

```bash
npm install @retain-so/sdk
# or
yarn add @retain-so/sdk
# or
pnpm add @retain-so/sdk
```

## Setup

Get your project’s **write key** from the [Retain dashboard](https://retain.so/dashboard/settings).

```ts
import { Retain } from "@retain-so/sdk";

const retain = new Retain("rk-XXXXX");
```

## Usage

### Identify a user

```ts
retain.identify({
  userId: "user_123",
  email: "jane@example.com",
  properties: {
    name: "Jane Doe",
    avatar: "https://example.com/avatar.png",
  },
});
```

### Identify a user with an account

Associate the user with a company or organization they belong to:

```ts
retain.identify({
  userId: "user_123",
  email: "jane@example.com",
  account: {
    id: "acc_789",
    name: "Acme Inc",
    avatar: "https://example.com/avatar.png",
  },
});
```

### Track an event

```ts
retain.track({
  userId: "user_123",
  event: "Order Completed",
  properties: {
    amount: 99,
  },
});
```

## License

MIT License
npm package: @retaindb/mcp-server
Description: Model Context Protocol server for RetainDB Context API - Connect Claude Desktop to your knowledge base
Author: RetainDB
Latest version: 3.3.0

# @retaindb/mcp-server

Context, memory, and grounded retrieval for coding agents — works with Claude Code, Claude Desktop, Cursor, VS Code, Windsurf, Cline, Continue, and any MCP-compatible client.

## Install

```bash
npm i -g @retaindb/mcp-server
```

## Setup

```bash
export RETAINDB_API_KEY="rdb_..."
```

Project defaults automatically — no `RETAINDB_PROJECT` needed unless you want a specific one.

### Claude Code

```json
{
  "mcpServers": {
    "retaindb": {
      "command": "retaindb-mcp",
      "env": { "RETAINDB_API_KEY": "rdb_..." }
    }
  }
}
```

### Claude Desktop

Same config, added to `~/Library/Application Support/Claude/claude_desktop_config.json`.

## Tools

| Tool | Purpose |
|------|---------|
| `context` | **Start here.** Retrieves memories, indexed sources, and local codebase in one call. Pass `messages` to auto-store the conversation so the next session continues where this one left off. |
| `remember` | Store an explicit fact, preference, or instruction. |
| `forget` | Delete a memory by ID. |
| `compress` | Store old conversation turns as memories, return a trimmed message array when context window fills up. |
| `index` | Connect a source: `github` · `web` · `pdf` · `local` · `slack` · `video` |
| `search` | Semantic search over indexed sources + local codebase. |
| `grep` | Regex/text search local files. |
| `read` | Read a local file with optional line range. |

## Automatic memory across sessions

```
Session 1: context(query, session_id="run-1", messages=[...])
  → ingests conversation in background

Session 2: context(query, session_id="run-2")
  → returns memories from session 1 — agent picks up where it left off
```

No configuration. No manual `remember` calls for conversation history. It just works.

## Connectors

| Type | Required params |
|------|----------------|
| `github` | `owner`, `repo` |
| `web` | `url` |
| `pdf` | `url` or `path` |
| `local` | `path` |
| `slack` | `channel_ids`, `token` |
| `video` | `url` |