Skip to content
@RetainDB

RetainDB

Persistent memory and context infrastructure for AI agents. SOTA on LongMemEval.

RetainDB

Persistent memory infrastructure for AI agents.

RetainDB lets AI agents remember users across sessions, devices, and deployments — with semantic retrieval, not just chat history. SOTA on LongMemEval (88% preference recall).


Get started in 30 seconds

import { withRetainDB } from "@retaindb/sdk/ai-sdk";
import { openai } from "@ai-sdk/openai";
import { streamText } from "ai";

const model = withRetainDB(openai("gpt-4o-mini"), { userId });
const result = streamText({ model, messages });
// ↑ memories retrieved before, stored after — automatically

Docs · npm · Benchmark


Starter templates

Template Stack
retaindb-nextjs-starter Next.js · Vercel AI SDK · OpenAI
retaindb-express-starter Express.js · Vercel AI SDK · OpenAI
retaindb-python-starter FastAPI · OpenAI
retaindb-langchain-starter LangChain · LangGraph · OpenAI

How it works

User message
    │
    ├─► POST /v1/context/query  →  relevant memories injected into system prompt
    │
    ├─► Your LLM  →  generates reply
    │
    └─► POST /v1/learn  →  stores the turn for future sessions

Two API calls. Works with any LLM, any framework.


Free tier — 10K memory ops/month · retaindb.com

Popular repositories Loading

  1. RetainDB RetainDB Public

    Open source memory and context infrastructure for ai systems

    TypeScript 27 2

  2. hermes hermes Public

    Forked from NousResearch/hermes-agent

    The agent that grows with you

    Python 2

  3. retaindb-nextjs-starter retaindb-nextjs-starter Public

    Next.js + Vercel AI SDK + RetainDB persistent memory starter. Deploy to Vercel in one click.

    TypeScript

  4. retaindb-python-starter retaindb-python-starter Public

    FastAPI + OpenAI + RetainDB persistent memory starter for Python.

    Python

  5. retaindb-langchain-starter retaindb-langchain-starter Public

    LangChain + LangGraph + RetainDB persistent memory starter for Python.

    Python

  6. retaindb-express-starter retaindb-express-starter Public

    Express.js + Vercel AI SDK + RetainDB persistent memory starter.

    TypeScript

Repositories

Showing 7 of 7 repositories

People

This organization has no public members. You must be a member to see who’s a part of this organization.

Top languages

Loading…

Most used topics

Loading…