Prerequisites
- Node.js 18 or higher
- (Optional) OpenAI API key stored in your environment when you want to customize providers
Install and run your first memory
1
Install the SDK
2
Initialize the client
3
Add a memory
4
Search memories
By default the Node SDK uses local-friendly settings (OpenAI
gpt-4.1-nano-2025-04-14, text-embedding-3-small, in-memory vector store, and SQLite history). Swap components by passing a config as shown below.Configure for production
Manage memories (optional)
Use a custom history store
The Node SDK supports Supabase (or other providers) when you need serverless-friendly history storage.Configuration parameters
Mem0 offers granular configuration across vector stores, LLMs, embedders, and history stores.Vector store
Vector store
| Parameter | Description | Default |
|---|---|---|
provider | Vector store provider (e.g., "memory") | "memory" |
host | Host address | "localhost" |
port | Port number | undefined |
LLM
LLM
| Parameter | Description | Provider |
|---|---|---|
provider | LLM provider (e.g., "openai", "anthropic") | All |
model | Model to use | All |
temperature | Temperature value | All |
apiKey | API key | All |
maxTokens | Max tokens to generate | All |
topP | Probability threshold | All |
topK | Token count to keep | All |
openaiBaseUrl | Base URL override | OpenAI |
Graph store
Graph store
| Parameter | Description | Default |
|---|---|---|
provider | Graph store provider (e.g., "neo4j") | "neo4j" |
url | Connection URL | process.env.NEO4J_URL |
username | Username | process.env.NEO4J_USERNAME |
password | Password | process.env.NEO4J_PASSWORD |
Embedder
Embedder
| Parameter | Description | Default |
|---|---|---|
provider | Embedding provider | "openai" |
model | Embedding model | "text-embedding-3-small" |
apiKey | API key | undefined |
General
General
| Parameter | Description | Default |
|---|---|---|
historyDbPath | Path to history database | "{mem0_dir}/history.db" |
version | API version | "v1.0" |
customPrompt | Custom processing prompt | undefined |
History store
History store
| Parameter | Description | Default |
|---|---|---|
provider | History provider | "sqlite" |
config | Provider configuration | undefined |
disableHistory | Disable history store | false |
Complete config example
Complete config example
What’s next?
Explore Memory Operations
Review CRUD patterns, filters, and advanced retrieval across the OSS stack.
Customize Configuration
Swap in your preferred LLM, vector store, and history provider for production use.
Automate Node Workflows
See a full Node-based workflow that layers Mem0 memories onto tool-calling agents.