Quickstart
Memoria gives your AI agent a memory that survives across sessions. This page walks through getting from zero to your first stored fact and your first recall in under five minutes.
1. Create an account
Go to memoria.premex.se and sign in with email or Google. A default brain is created for you automatically — think of a brain as an isolated workspace; everything you store is scoped to it.
2. Get an API key
In the dashboard, open Brains → default → Keys and create a new key labelled e.g. local-dev. The full secret is shown once — copy it now. Keys look like:
mem_live_4f9c…ab21
Treat it like a password: never check it into git, rotate if leaked.
3. Install the SDK (optional)
npm install @premex/memoria
# or
pnpm add @premex/memoria
You can also call the REST API directly with curl — see REST API.
4. Store your first memory
import { MemoriaClient } from '@premex/memoria';
const memoria = new MemoriaClient({ apiKey: process.env.MEMORIA_API_KEY! });
await memoria.remember({
content: 'Stefan is a Senior Engineer at Premex. He joined in 2023.',
});
What happens server-side:
- Memoria extracts entities (
Stefan,Premex) and a fact (Stefan worksAt Premex). - Each entity is resolved against existing ones in your brain via name embeddings.
- The fact gets two timestamps — when it became true in the world (
tValid) and when Memoria learned it (tIngested). - Contradictions are checked. If you later say "Stefan left Premex in 2025", the older fact is marked superseded — but not deleted.
The whole pipeline is one HTTP call. The response returns immediately once the episode is persisted; extraction completes in the background.
5. Recall it
const result = await memoria.recall({
query: 'Where does Stefan work?',
});
console.log(result.context);
// → "Stefan is a Senior Engineer at Premex…"
Recall fans out three signals in parallel:
- Dense vector similarity over learned embeddings
- Sparse BM25 keyword search
- Graph Personalized PageRank seeded from entities in the query
Results are fused by reciprocal-rank fusion, re-ranked by a cross-encoder, and packed into a context string ready to drop into your agent's prompt. Sub-second p50.
6. Time-travel
Every fact carries event time. Ask the world as it was on a specific date:
await memoria.recall({
query: 'Where does Stefan work?',
asOf: '2024-06-01',
});
Next steps
- Brains — workspaces and isolation
- Recall — the retrieval pipeline in detail
- MCP server — connect Memoria from Claude Code
- CLI — one-line setup for Claude Code, including Claude Code on the web
- REST API — all endpoints and shapes