Skip to main content
This guide walks you through everything you need to go from zero to a memory-powered AI agent. By the end you will have installed the SDK, stored a memory, retrieved it by meaning rather than keywords, and built a working agent that remembers its users across sessions.

Before You Start

You need two things before writing any code:
  1. A Remem API keyget one free at dev.remem.online. No credit card required.
  2. Python 3.10 or higher — check with python --version.
Your API key looks like rm_live_xxxxxxxxxxxxxxxxxxxx. It is delivered to your inbox once and cannot be shown again. Copy it somewhere safe immediately. If you lose it, email support@remem.online to have a new one issued.

Steps

1

Install the SDK

Install remem-py from PyPI:
Verify the installation completed correctly:
If you see Remem installed successfully, you are ready to move on. If you see an import error, make sure you are running Python 3.10+ and that you installed into the correct virtual environment.
2

Set Your API Key

Never hardcode your API key in source code. Store it in a .env file and load it at runtime:
Then initialise the client in Python:
You can also pass the key directly during initialisation for quick local testing — but never commit that to version control:
3

Store Your First Memory

Call remember() to persist something your agent has learned about a user:
The returned UUID is this memory’s permanent identifier. You can use it later to update the memory with client.update() or remove it with client.forget(). Store it if you need fine-grained control — otherwise Remem manages the lifecycle for you.
4

Load Context at Session Start

At the beginning of every conversation — before the user says anything — call context() to pre-load what your agent already knows:
context() ranks memories by a combination of recency and importance — not by query similarity — so it surfaces what matters most about this user right now, even before you know what the conversation will be about.
5

Search Semantically

When the user says something that needs specific context, call recall() with a natural-language query:
The query used completely different words from the stored memory — “communication preferences” versus “bullet points over long paragraphs”. Remem found the match because it searches by meaning, not by keywords. The hybrid score of 0.891 reflects a strong semantic match combined with a high importance weight.
6

Inject Memory Into Your Agent

Here is the complete pattern for a memory-powered conversational agent. It loads context before every reply, builds a personalised system prompt, calls the LLM, and saves what the user shared:
On the second message, the agent already knows who Victor is — because the first message was saved as a memory and loaded back via context() at the start of the second call. No conversation history is passed between calls. The memory layer handles persistence entirely.

What’s Next

Authentication

Understand API key format, safe storage patterns, and error codes

Memory Types

Learn when to use episodic versus semantic memory

LangGraph Guide

Add persistent memory to a LangGraph agent

Error Handling

Handle authentication, rate-limit, and network errors in production