MemMachine Installation Guide
This guide will walk you through the process of installing MemMachine. We’ll start with the prerequisites you need to get set up, followed by two different installation methods.1
Gather Your Prerequisites
Before you install the MemMachine software itself, you’ll need to set up a few things. Be sure to note down any passwords or keys you create, as you’ll need them later.
A. Core Software
- Python 3.12+: MemMachine requires Python version 3.12 or newer.
- PostgreSQL: You will need a local PostgreSQL instance with the
pgvector
extension. You can find installation instructions on the official PostgreSQL Downloads page. Once installed, create a new database and a user with full privileges for that database. - Neo4j: A Neo4j database is required. You can find installation instructions on the official Neo4j Documentation page. After installation, start the Neo4j server and set a password for the default
neo4j
user.
B. Accounts and Keys
- OpenAI API Key: You will need an OpenAI account to use MemMachine. You can sign up on the OpenAI Platform. You’ll need to generate and copy your API Key for a later step.
MemMachine itself is free to install, but please be aware that using the software consumes tokens from your OpenAI account.
2
Choose Your Installation Method
You can install MemMachine using a Python package manager or by cloning the source code from our GitHub repository.
Option 1: Install with Pip
Option 1: Install with Pip
This is the recommended method for most users who want to add MemMachine to an existing Python environment.To create a python environment(if it does not already exist), you can use A. Run the following command in your terminal:B. Next, install dependencies from NLTK through the following MemMachine command:
venv
as follows:- If you are using MemMachine in a CPU-only environment, use:
- If you have an NVIDIA GPU and want to leverage it, use:
Option 2: Install from Source (GitHub)
Option 2: Install from Source (GitHub)
This method is for users who want to contribute to the project or run from the latest source code.First, clone the repository and navigate into the project directory:Second, Ensure you have a python environment set up. You can use
venv
, conda
, or any other environment manager of your choice.Next, use the uv
tool to install all dependencies. If you don’t have uv
, you’ll need to install it first. If you wish to run with an NVIDIA GPU, you will need to install dependencies for GPU by using the
uv pip install ".[gpu]"
command.3
Create Your Configuration Files
MemMachine uses two files for configuration: a
.env
file for your database and API credentials and a config.yml
file for the application’s behavior.A. Create the `.env` file
A. Create the `.env` file
Create a file named Below is an example of what the
.env
in the root of your project and add the following content.You can download this file from our GitHub repository as a template using the following curl command:.env
file should look like:Replace the placeholders (e.g.,
YOUR_NEO4J_PASSWORD
) with your actual values.B. Create the `config.yml` file
B. Create the `config.yml` file
Create a file named Below is an example of what the
config.yml
in the same directory. This file configures the various models and storage options for MemMachine.You can download this file from our GitHub repository as a template using the following curl command:config.yml
file should look like.> if you are using a CPU only installation, be sure to comment out cross-encoder lines (46, 51-53) with a ’#’ or remove those lines from your file, as you will not be able to use the cross-encoder reranker in that environment.
Remember to replace the placeholders for your OpenAI API key and Neo4j password in this file as well.
4
Run MemMachine
You’re ready to go! Run these commands from the directory where you’ve installed MemMachine.First, you need to sync the profile schema. This is a one-time command that must be run before the very first time you start the server.Now you can start the MemMachine server. If you have run MemMachine before, you can skip the sync step and go straight to this command:You should now have the MemMachine server running.
If you are using Docker to run your databases, ensure they are started and accessible before you try to start MemMachine.