open-index/open-npm huggingface dataset:
npm package: @mnemoai/client
Description: Mnemo Cloud client — store and recall AI agent memories via API
Latest version: 0.1.2

# @mnemoai/client

Official client for [Mnemo Cloud](https://m-nemo.ai) — long-term memory for AI agents.

## Install

```bash
npm install @mnemoai/client
```

## Quick Start

```javascript
import { createCloudMnemo } from "@mnemoai/client";

const mnemo = createCloudMnemo({ apiKey: "mn_your_key" });

// Store a memory
const { id } = await mnemo.store({
  text: "User is a software engineer who prefers TypeScript",
  category: "fact",
  importance: 0.9,
});

// Recall memories by semantic search
const memories = await mnemo.recall("what does the user do?", { limit: 5 });
memories.forEach(m => console.log(m.text, m.score));

// Delete a memory
await mnemo.delete(id);

// Check usage
const stats = await mnemo.stats();
console.log(stats.totalEntries, "memories stored");
```

## API

### `createCloudMnemo(config)`

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `apiKey` | string | Yes | API key from [Mnemo Cloud](https://api.m-nemo.ai/signup) |
| `endpoint` | string | No | Custom endpoint (default: `https://api.m-nemo.ai`) |

### `mnemo.store(entry)`

Store a memory. Returns `{ id: string }`.

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `text` | string | required | The text to remember |
| `category` | string | `"fact"` | `fact`, `preference`, `decision`, `entity`, `other` |
| `importance` | number | `0.7` | Importance score (0.0–1.0) |
| `scope` | string | `"global"` | Scope for multi-agent isolation |

### `mnemo.recall(query, options?)`

Recall memories by semantic search. Returns array of `{ text, score, category, importance, timestamp }`.

| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `limit` | number | `5` | Max results |
| `category` | string | — | Filter by category |
| `scopeFilter` | string[] | — | Filter by scopes |

### `mnemo.delete(id)`

Delete a memory by ID. Returns `boolean`.

### `mnemo.stats()`

Returns `{ totalEntries, scopeCounts, categoryCounts, plan }`.

## Requirements

- Node.js 18+ (uses native `fetch`)
- [Mnemo Cloud API key](https://api.m-nemo.ai/signup)

## Links

- [Mnemo Cloud docs](https://m-nemo.ai)
- [Full API reference](https://github.com/Methux/mnemo/blob/main/docs/pro.md)
- [GitHub](https://github.com/Methux/mnemo)
npm package: @mnemoai/server
Description: Mnemo REST API server — expose memory store/recall/delete over HTTP
Author: Mnemo Contributors
Latest version: 0.1.0

# @mnemoai/server

Mnemo REST API server. Zero dependencies beyond `@mnemoai/core`.

## Quick Start

```bash
npx @mnemoai/server
```

Or with configuration:

```bash
OPENAI_API_KEY=sk-... MNEMO_PORT=8080 npx @mnemoai/server
```

## Endpoints

| Method | Path | Body | Description |
|--------|------|------|-------------|
| `POST` | `/store` | `{ text, category?, importance?, scope? }` | Store a memory |
| `POST` | `/recall` | `{ query, limit?, scopeFilter?, category? }` | Recall memories |
| `DELETE` | `/memories/:id` | — | Delete a memory |
| `GET` | `/stats` | — | Get statistics |
| `GET` | `/health` | — | Health check |

## Examples

```bash
# Store
curl -X POST http://localhost:18100/store \
  -H "Content-Type: application/json" \
  -d '{"text": "User prefers dark mode", "category": "preference"}'

# Recall
curl -X POST http://localhost:18100/recall \
  -H "Content-Type: application/json" \
  -d '{"query": "UI preferences", "limit": 5}'

# Stats
curl http://localhost:18100/stats

# Delete
curl -X DELETE http://localhost:18100/memories/mem_abc123
```

## Environment Variables

| Variable | Default | Description |
|----------|---------|-------------|
| `MNEMO_PORT` | `18100` | Server port |
| `MNEMO_DB_PATH` | `./mnemo-data` | Database directory |
| `OPENAI_API_KEY` | — | Embedding API key |
| `MNEMO_EMBEDDING_MODEL` | `text-embedding-3-small` | Embedding model |
| `MNEMO_EMBEDDING_DIMENSIONS` | `1536` | Vector dimensions |
| `MNEMO_EMBEDDING_BASE_URL` | OpenAI | Embedding API URL |
| `MNEMO_STORAGE_BACKEND` | `lancedb` | Storage backend |
| `MNEMO_STORAGE_CONFIG` | — | JSON string for backend config |

## Using with Ollama ($0)

```bash
MNEMO_EMBEDDING_BASE_URL=http://localhost:11434/v1 \
MNEMO_EMBEDDING_MODEL=nomic-embed-text \
MNEMO_EMBEDDING_DIMENSIONS=768 \
npx @mnemoai/server
```
npm package: @mnemoai/vercel-ai
Description: Mnemo memory tools for the Vercel AI SDK
Author: Mnemo Contributors
Latest version: 0.1.0

# @mnemoai/vercel-ai

Mnemo memory tools for the [Vercel AI SDK](https://ai-sdk.dev). Give your AI agents long-term memory in 3 lines.

## Installation

```bash
npm install @mnemoai/core @mnemoai/vercel-ai ai zod
```

## Quick Start

```typescript
import { openai } from '@ai-sdk/openai';
import { generateText } from 'ai';
import { createMnemo } from '@mnemoai/core';
import { createMnemoTools } from '@mnemoai/vercel-ai';

// Create memory instance
const mnemo = await createMnemo({
  embedding: {
    provider: 'openai-compatible',
    apiKey: process.env.OPENAI_API_KEY,
    model: 'text-embedding-3-small',
    dimensions: 1536,
  },
  dbPath: './agent-memory',
});

// Create AI SDK tools
const tools = createMnemoTools(mnemo);

// Use with any AI SDK function
const { text } = await generateText({
  model: openai('gpt-4o'),
  tools,
  prompt: 'Remember that I prefer TypeScript over JavaScript',
});
```

The AI will automatically use `memoryStore` to save the preference, and `memoryRecall` in future conversations to retrieve it.

## Tools

### `memoryStore`
Stores information in long-term memory. The AI uses this when users share preferences, facts, or decisions.

### `memoryRecall`
Searches memory for relevant information. The AI uses this to recall what it knows about the user.

### `memoryDelete`
Deletes a memory by ID. The AI uses this when asked to forget something.

## Options

```typescript
const tools = createMnemoTools(mnemo, {
  recallLimit: 10,          // max results per recall (default: 5)
  defaultScope: 'user:123', // scope for multi-user isolation (default: 'global')
});
```

## Links

- [Mnemo Documentation](https://docs.m-nemo.ai)
- [GitHub](https://github.com/Methux/mnemo)
- [npm: @mnemoai/core](https://www.npmjs.com/package/@mnemoai/core)