Documentation

Memonest SDK

Why AI Memory

Overview

Your users don't want a chatbot — they want a product that remembers them. Memonest gives your app a durable, searchable memory layer so your assistant can keep context across sessions without you building vector infrastructure.

Start in minutes: create an account and generate an API key. Then use the SDK to store and recall memories as part of your agent loop.

Quickstart

  1. 1Create an API key in the dashboard.
  2. 2Install the SDK:npm install @memonest/sdk
  3. 3Store memories right after the user says something worth remembering.
  4. 4Before each model call, fetch relevant memories and inject them into your prompt.
memory.ts
import MemoryClient from "@memonest/sdk"

const client = new MemoryClient({ apiKey: process.env.MEMONEST_API_KEY })

// 1) Save something durable
await client.add({
  userId: "user_123",
  content: "Prefers concise responses. Uses Go.",
})

// 2) Recall before the next model call
const { memories } = await client.find({
  userId: "user_123",
  query: "formatting preferences",
})

For end-to-end apps, browse Examples.

Authentication

The SDK sends the bearer token automatically. Set MEMONEST_API_KEY (recommended), or pass apiKey to the client constructor.

MEMONEST_API_KEY=sk_live_...
ADD

client.add()

Store a single durable memory for a user. Use this when you detect a stable preference, identity detail, or long-term goal — not every chat message.

await client.add({
  userId: "user_123",
  content: "Prefers short bullet points.",
  metadata: { source: "chat" },
})
FIND+

client.findPersonalized()

Use this when you want semantic recall and the server-maintained static personalization lines for that user in one round trip. The response shape is { static, memories }: static is a list of short strings to inject into prompts (alongside ranked memories). Same request body as find — it maps to POST /v1/memories/search-personalized.

const { static: staticLines = [], memories } = await client.findPersonalized({
  userId: "user_123",
  query: "what should I emphasize in replies?",
})
DEL

client.deleteMemory()

Delete a memory by id for compliance, cleanup, or user-controlled data removal.

await client.deleteMemory("mem_123")
AUTO

client.auto()

Let AI Memory extract memories from a chat transcript automatically. This is the fastest path to production-grade personalization: you send messages, we pick what matters and store it.

await client.auto({
  userId: "user_123",
  messages: [
    { role: "user", content: "I always want concise answers." },
    { role: "assistant", content: "Got it — I'll remember that." },
  ],
  maxMemories: 5,
})

Pro tip: use client.auto() for broad capture, then client.find() for precision recall.

Ready to ship memory?

Open the examples repo, copy the patterns, and plug AI Memory into your agent loop today.

View Examples