Skip to main content
Memori provides a powerful command-line interface (CLI) for managing your account, checking quota usage, and managing database clusters.

Overview

The Memori CLI is accessed through Python’s module execution:
python -m memori
Running this command without arguments displays the available options:
 __  __                           _ 
|  \/  | ___ _ __ ___   ___  _ __(_)
| |\/| |/ _ \ '_ ` _ \ / _ \| '__| |
| |  | |  __/ | | | | | (_) | |  | |
|_|  |_|\___|_| |_| |_|\___/|_|  |_|
                  perfectam memoriam
                       memorilabs.ai
                            v3.2.1

Option         Description                                  Params
------         -----------                                  ------
quota          Check your quota                                  N
setup          Execute suggested setup steps                     N
sign-up        Sign up for an API key                            Y
cockroachdb    Manager a CockroachDB cluster                     Y

usage: python -m memori <option> [params]

Available Commands

quota

Check your current quota and memory usage for Memori Advanced Augmentation. Usage:
python -m memori quota
Example Output:
+ Maximum # of Memories: 100,000
+ Current # of Memories: 1,234

+ You are currently using 1.23% of your quota.
When to Use:
  • Monitor your memory consumption
  • Check remaining capacity before large operations
  • Verify quota limits for your account
If you’re rate-limited by IP address, sign up for an API key to get increased limits. Memori Advanced Augmentation is always free for developers!

sign-up

Sign up for Memori Advanced Augmentation to get an API key and increased quota limits. Usage:
python -m memori sign-up <email_address>
Parameters:
  • email_address - Your email address for account creation
Example:
python -m memori sign-up [email protected]
Example Output:
You're all set! We sent you an email.
Error Handling: If you provide an invalid email:
python -m memori sign-up invalid-email
Output:
The email you provided "invalid-email" is not valid.
1

Sign up for an account

Run the sign-up command with your email address:
python -m memori sign-up [email protected]
2

Check your email

You’ll receive an email with your API key and instructions.
3

Set your API key

Add the API key to your environment:
export MEMORI_API_KEY=your_api_key_here
4

Verify your setup

Check your quota to confirm:
python -m memori quota

setup

Execute suggested setup steps, including downloading the embedding model. Usage:
python -m memori setup
What it Does:
  • Downloads and caches the all-mpnet-base-v2 embedding model
  • Ensures all required models are available locally
  • Prepares the environment for offline usage
Example Output:
+ Installing model all-mpnet-base-v2
+     this may take a moment; output to follow:
+     -----
Downloading model files...
Model downloaded successfully.
+     -----
The first-time setup downloads approximately 400MB of model files. Ensure you have a stable internet connection and sufficient disk space.

cockroachdb

Manage CockroachDB clusters for Memori BYODB deployments. Usage:
python -m memori cockroachdb cluster <start | claim | delete>
Sub-commands:

start

Create a new managed CockroachDB cluster.
python -m memori cockroachdb cluster start
Before we begin, we want you to know that security and privacy are
very important to us. Once we create this cluster for you we can
never access it again unless you provide us with your connection
string and we cannot help you recover your credentials if you lose
them.

This process may take a minute or longer, please be patient.

Proceed [Y/n] Y

+ [Step 1] Starting new cluster: done
+ [Step 2] Waiting for cluster to come online: done
+ [Step 3] Creating the Memori schema:

+ --- YOUR COCKROACHDB CLUSTER IS READY! ---

+ Please save your connection string:
+     postgresql://user:password@host:26257/defaultdb?sslmode=verify-full

+ To use your cluster, set the following environment variable:
+     MEMORI_COCKROACHDB_CONNECTION_STRING=postgresql://user:password@host:26257/defaultdb?sslmode=verify-full

+ You have to claim this database in 7 days or it will be deleted!
+     https://app.memorilabs.ai/claim/cluster-uuid

+ You're all set!
1

Start cluster creation

python -m memori cockroachdb cluster start
2

Save your connection string

The connection string is displayed only once. Save it securely!
3

Set environment variable

export MEMORI_COCKROACHDB_CONNECTION_STRING="your_connection_string"
4

Claim your cluster

Visit the claim URL within 7 days to permanently claim your cluster.
Important Security Notes:
  • The connection string is shown only once during creation
  • Memori Labs cannot recover lost credentials
  • Store your connection string in a secure password manager
  • The cluster will be deleted if not claimed within 7 days

claim

Get the claim URL for your CockroachDB cluster.
python -m memori cockroachdb cluster claim
Example Output:
+ You can claim the CockroachDB cluster by using this URL:
+     https://app.memorilabs.ai/claim/your-cluster-uuid

delete

Delete your CockroachDB cluster permanently.
python -m memori cockroachdb cluster delete
Example Output:
+ The CockroachDB cluster has been deleted.
This operation is irreversible. All data in the cluster will be permanently deleted.

Environment Variables

The CLI respects these environment variables:
VariableDescriptionDefault
MEMORI_API_KEYYour Memori API keyNone
MEMORI_EMBEDDINGS_MODELEmbedding model to useall-MiniLM-L6-v2
MEMORI_COCKROACHDB_CONNECTION_STRINGCockroachDB connection stringNone
MEMORI_TEST_MODEEnable test modeNone

Common Workflows

Initial Setup

1

Install Memori

pip install memori
2

Run setup

python -m memori setup
3

Sign up for API key

python -m memori sign-up [email protected]
4

Set API key

export MEMORI_API_KEY=your_api_key
5

Verify quota

python -m memori quota

CockroachDB Cluster Setup

1

Install CockroachDB support

pip install memori[cockroachdb]
2

Create cluster

python -m memori cockroachdb cluster start
3

Save connection string

Copy the connection string from the output and store it securely.
4

Configure environment

export MEMORI_COCKROACHDB_CONNECTION_STRING="your_connection_string"
5

Claim cluster

Visit the claim URL within 7 days.

Troubleshooting

Command Not Found

Problem: Python cannot find the Memori module.Solution:
# Verify installation
pip list | grep memori

# Reinstall if necessary
pip install --force-reinstall memori

# Use the correct Python interpreter
python3 -m memori

Quota Command Fails

Problem: Cannot reach Memori API or authentication fails.Solution:
# Check your internet connection
curl https://api.memorilabs.ai/health

# Verify API key is set
echo $MEMORI_API_KEY

# Try without API key (IP-based rate limiting)
unset MEMORI_API_KEY
python -m memori quota

CockroachDB Cluster Fails to Start

Problem: Cluster takes too long or fails during creation.Solution:
  1. Wait for completion (can take 2+ minutes)
  2. Check network connectivity
  3. Verify psycopg is installed:
    pip install memori[cockroachdb]
    
  4. Try again with better network connection
  5. Contact support if issue persists

Advanced Usage

Custom Embedding Models

You can configure a custom embedding model via environment variable:
export MEMORI_EMBEDDINGS_MODEL="all-mpnet-base-v2"
python -m memori setup
Supported models from sentence-transformers:
  • all-MiniLM-L6-v2 (default, fast)
  • all-mpnet-base-v2 (more accurate)
  • Any compatible sentence-transformers model

Automation and CI/CD

The CLI can be integrated into automation pipelines:
#!/bin/bash
# setup-memori.sh

set -e

# Install Memori
pip install memori

# Run setup
python -m memori setup

# Configure from CI environment
export MEMORI_API_KEY=${CI_MEMORI_API_KEY}

# Verify setup
python -m memori quota || echo "Warning: Quota check failed"
For CI/CD environments, store your MEMORI_API_KEY in secure environment variables or secrets management systems.

Next Steps

Quota Management

Learn how to monitor and optimize your quota usage

Performance Tuning

Optimize Memori for your workload

Troubleshooting

Common issues and solutions

API Reference

Complete API documentation

Build docs developers (and LLMs) love