Skip to main content

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.
  • Graph Database (choose one):
    • Neo4j: 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.
    • NebulaGraph Enterprise: An alternative to Neo4j with native vector support. See the NebulaGraph Integration Guide for setup instructions.

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.
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 venv as follows:
A. Run the following command in your terminal:
Choose the package that is correct for your needs. If you want to install the Client, use pip install memmachine-client and if you want to use Server, use pip install memmachine-server. Examples below assume server. Should you wish to install client, use the same command, but replace “server” with “client”
  • If you are using MemMachine in a CPU-only environment, use:
  • If you have an NVIDIA GPU and want to leverage it, use:
B. Next, install dependencies from NLTK through the following MemMachine command:
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 File - `cfg.yml`

MemMachine uses a single configuration file, cfg.yml, to define its resources and behavior. This file should be placed in the directory where you run the MemMachine server.Alternatively, you can use the Configure Wizard to assist in configuring MemMachine for your environment and to provide the necessary information.Below are examples for CPU-only and GPU-enabled setups.
You can download a sample file or copy the content below.
Replace <YOUR_OPENAI_API_KEY> and database passwords with your actual credentials.
For GPU setups, you might use local models for embeddings or reranking.
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.