Before You Start
You need two things before writing any code:- A Remem API key — get one free at dev.remem.online. No credit card required.
- Python 3.10 or higher — check with
python --version.
Steps
1
Install the SDK
Install Verify the installation completed correctly:
remem-py from PyPI: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 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:
.env file and load it at runtime: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