MemGPT makes it easy to build and deploy stateful LLM agents with support for:
- Long term memory/state management
- Connections to external data sources (e.g. PDF files) for RAG
- Defining and calling custom tools (e.g. google search)
You can also use MemGPT to depoy agents as a service. You can use a MemGPT server to run a multi-user, multi-agent application on top of supported LLM providers.
![image](https://private-user-images.githubusercontent.com/8505980/327882408-1096eb91-139a-4bc5-b908-fa585462da09.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM2OTEyNzcsIm5iZiI6MTcyMzY5MDk3NywicGF0aCI6Ii84NTA1OTgwLzMyNzg4MjQwOC0xMDk2ZWI5MS0xMzlhLTRiYzUtYjkwOC1mYTU4NTQ2MmRhMDkucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgxNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MTVUMDMwMjU3WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NWY5ZDRhZWFkZGJjYTM5ZThiMTQxNTM1ZWEyOTdmZTFlNzE1OTc2YTY5ZmZlZWI3YmJiMzQ0MjAxYjRkMGQ4MCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.NB27Z3pFdeiqVu_zTRnCSfs72VsQ3ATIbZf3J86Nkik)
Install MemGPT:
pip install -U pymemgpt
To use MemGPT with OpenAI, set the environment variable OPENAI_API_KEY
to your OpenAI key then run:
memgpt quickstart --backend openai
To use MemGPT with a free hosted endpoint, you run run:
memgpt quickstart --backend memgpt
For more advanced configuration options or to use a different LLM backend or local LLMs, run memgpt configure
.
You can create and chat with a MemGPT agent by running memgpt run
in your CLI. The run
command supports the following optional flags (see the CLI documentation for the full list of flags):
--agent
: (str) Name of agent to create or to resume chatting with.--first
: (str) Allow user to sent the first message.--debug
: (bool) Show debug logs (default=False)--no-verify
: (bool) Bypass message verification (default=False)--yes
/-y
: (bool) Skip confirmation prompt and use defaults (default=False)
You can view the list of available in-chat commands (e.g. /memory
, /exit
) in the CLI documentation.
MemGPT provides a developer portal that enables you to easily create, edit, monitor, and chat with your MemGPT agents. The easiest way to use the dev portal is to install MemGPT via docker (see instructions below).
![image](https://private-user-images.githubusercontent.com/5475622/327883017-071117c5-46a7-4953-bc9d-d74880e66258.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM2OTEyNzcsIm5iZiI6MTcyMzY5MDk3NywicGF0aCI6Ii81NDc1NjIyLzMyNzg4MzAxNy0wNzExMTdjNS00NmE3LTQ5NTMtYmM5ZC1kNzQ4ODBlNjYyNTgucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgxNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MTVUMDMwMjU3WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MWRiODhjZmQwZGQ3MjMzYzY2NzgyMzY4YmIzZDdlZDUwNmRjNGFkNWMwZDEzNGMxZjM5ZjM4YzViOWNmMjRiMCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.buijKiDF69sXmW59m49UIYncLn99e9Yw4JFj_p9ClPI)
Option 1 (Recommended): Run with docker compose
- Install docker on your system
- Clone the repo:
git clone [email protected]:cpacker/MemGPT.git
- Run
docker compose up
- Go to
memgpt.localhost
in the browser to view the developer portal
Option 2: Run with the CLI:
- Run
memgpt server
- Go to
localhost:8283
in the browser to view the developer portal
Once the server is running, you can use the Python client or REST API to connect to memgpt.localhost
(if you're running with docker compose) or localhost:8283
(if you're running with the CLI) to create users, agents, and more. The service requires authentication with a MemGPT admin password, which can be set with running export MEMGPT_SERVER_PASS=password
.
MemGPT is designed to be model and provider agnostic. The following LLM and embedding endpoints are supported:
Provider | LLM Endpoint | Embedding Endpoint |
---|---|---|
OpenAI | โ | โ |
Azure OpenAI | โ | โ |
Google AI (Gemini) | โ | โ |
Anthropic (Claude) | โ | โ |
Groq | โ (alpha release) | โ |
Cohere API | โ | โ |
vLLM | โ | โ |
Ollama | โ | โ |
LM Studio | โ | โ |
koboldcpp | โ | โ |
oobabooga web UI | โ | โ |
llama.cpp | โ | โ |
HuggingFace TEI | โ | โ |
When using MemGPT with open LLMs (such as those downloaded from HuggingFace), the performance of MemGPT will be highly dependent on the LLM's function calling ability. You can find a list of LLMs/models that are known to work well with MemGPT on the #model-chat channel on Discord, as well as on this spreadsheet.
See full documentation at: https://memgpt.readme.io
For issues and feature requests, please open a GitHub issue or message us on our #support
channel on Discord.
By using MemGPT and related MemGPT services (such as the MemGPT endpoint or hosted service), you agree to our privacy policy and terms of service.
You can view (and comment on!) the MemGPT developer roadmap on GitHub: cpacker#1200.
To evaluate the performance of a model on MemGPT, simply configure the appropriate model settings using memgpt configure
, and then initiate the benchmark via memgpt benchmark
. The duration will vary depending on your hardware. This will run through a predefined set of prompts through multiple iterations to test the function calling capabilities of a model. You can help track what LLMs work well with MemGPT by contributing your benchmark results via this form, which will be used to update the spreadsheet.