Skip to content
Back to skills

Tanstack Ai Memory Mem0

ASecurity

Use when wiring mem0() from @tanstack/ai-memory/mem0 — a hosted memory adapter that talks to a mem0 server over plain HTTP (no SDK peer). Requires a running mem0 server.

  • 3,166 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 2, 2026
ai-agentsapi

Works with

  • api

Security analysis

A100/100

Scanned September 12, 2026

npx -y skills add TanStack/ai --skill tanstack-ai-memory-mem0 --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Tanstack Ai Memory Mem0?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Tanstack Ai Memory Mem0
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tanstack-tanstack-ai-memory-mem0/badge)](https://www.skillsdirectory.com/skills/tanstack-tanstack-ai-memory-mem0)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: tanstack-ai-memory-mem0
description: Use when wiring mem0() from @tanstack/ai-memory/mem0 — a hosted memory adapter that talks to a mem0 server over plain HTTP (no SDK peer). Requires a running mem0 server.
---

# mem0 Memory Adapter

Hosted `recall`/`save` adapter backed by a mem0 server. mem0 owns extraction and ranking
server-side. Talks to the server over plain HTTP — **no SDK peer dependency**.

## Setup

```ts
import { memoryMiddleware } from '@tanstack/ai-memory'
import { mem0 } from '@tanstack/ai-memory/mem0'

// Build per request from the server-validated session — never from req.body.
function memoryFor(session: { userId: string; threadId: string }) {
  const memory = mem0({ user: session.userId }) // baseUrl defaults to MEM0_URL

  return memoryMiddleware({
    adapter: memory,
    scope: { threadId: session.threadId, userId: session.userId },
  })
}
```

Requires a running mem0 server (self-hosted or hosted). Point it via `baseUrl` (or
`MEM0_URL`); pass `apiKey` (or `MEM0_ADMIN_API_KEY`) when secured.

## Options

- `user` — mem0 `user_id` (falls back to `scope.userId`, then `'demo-user'`).
- `baseUrl` — mem0 server URL (default `MEM0_URL` or `http://localhost:8000`).
- `apiKey` — bearer token (default `MEM0_ADMIN_API_KEY`).
- `rerank` (default `true`), `threshold` (default `0.1`) — search tuning.

**Scope fields:** requests send `user_id` and `run_id` (`scope.threadId`). `tenantId`
and `namespace` are not sent — encode multi-tenant isolation into `user` if needed.

`save` posts the `{ user, assistant }` turn to `/memories`; `recall` queries `/search`
and renders the results into the system prompt. mem0 exposes no LLM tools.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.