Building persistent LLM agents with long-term memory 📚🦙
Go to file
2024-05-25 16:18:56 -07:00
.github fix: update docker test (#1354) 2024-05-07 10:09:42 -07:00
.persist fix: Clean up and simplify docker entrypoint (#1235) (#1259) 2024-04-18 22:39:11 -07:00
configs fix: fix summarizer for tool_calls (#1350) 2024-05-06 22:18:12 -07:00
db fix: various breaking bugs with local LLM implementation and postgres docker. (#1355) 2024-05-12 11:53:46 -07:00
docs docs: Update python_client.md (#1413) 2024-05-25 15:18:22 -07:00
examples fix: get_keys_response is a list not a dict (#1412) 2024-05-25 15:19:30 -07:00
memgpt fix: patch #1401 (#1406) 2024-05-22 20:27:19 -07:00
paper_experiments chore: run autoflake + isort (#1279) 2024-04-20 11:40:22 -07:00
scripts feat: add workflow to build + test docker container (#1278) 2024-04-21 17:58:09 -07:00
tests feat: add more tool functionality for python client (#1361) 2024-05-13 12:05:32 -07:00
.dockerignore ci: update workflows (add autoflake and isort) (#1300) 2024-04-27 11:54:34 -07:00
.env.example ci: update workflows (add autoflake and isort) (#1300) 2024-04-27 11:54:34 -07:00
.gitignore ci: update workflows (add autoflake and isort) (#1300) 2024-04-27 11:54:34 -07:00
.pre-commit-config.yaml feat: update portal (#1306) 2024-04-27 22:28:08 -07:00
compose.yaml feat: add workflow to build + test docker container (#1278) 2024-04-21 17:58:09 -07:00
CONTRIBUTING.md ci: update workflows (add autoflake and isort) (#1300) 2024-04-27 11:54:34 -07:00
dev-compose.yaml fix: patch embedding_model null issue in tests (#1305) 2024-04-27 21:33:00 -07:00
development.compose.yml ci: update workflows (add autoflake and isort) (#1300) 2024-04-27 11:54:34 -07:00
Dockerfile fix: Clean up and simplify docker entrypoint (#1235) (#1259) 2024-04-18 22:39:11 -07:00
init.sql feat: client tests for docker compose server (#1189) 2024-03-26 18:58:00 -07:00
LICENSE Update LICENSE 2023-12-13 21:53:03 -08:00
main.py chore: run autoflake + isort (#1279) 2024-04-20 11:40:22 -07:00
nginx.conf ci: update workflows (add autoflake and isort) (#1300) 2024-04-27 11:54:34 -07:00
poetry.lock ci: update workflows (add autoflake and isort) (#1300) 2024-04-27 11:54:34 -07:00
PRIVACY.md chore: Update policies (#686) 2024-04-02 10:53:03 -07:00
pyproject.toml chore: bump version (#1390) 2024-05-16 15:55:05 -07:00
README.md docs: update quickstart-server instructions (#1409) 2024-05-25 16:18:56 -07:00
TERMS.md ci: update workflows (add autoflake and isort) (#1300) 2024-04-27 11:54:34 -07:00

MemGPT logo

MemGPT allows you to build LLM agents with long term memory & custom tools

Discord Twitter Follow arxiv 2310.08560 Documentation

MemGPT makes it easy to build and deploy stateful LLM agents with support for:

You can also use MemGPT to deploy 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

Installation & Setup

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.

Quickstart (CLI)

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.

Dev portal (alpha build)

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

Quickstart (Server)

Option 1 (Recommended): Run with docker compose

  1. Install docker on your system
  2. Clone the repo: git clone https://github.com/cpacker/MemGPT.git
  3. Copy-paste .env.example to .env and optionally modify
  4. Run docker compose up
  5. Go to memgpt.localhost in the browser to view the developer portal

Option 2: Run with the CLI:

  1. Run memgpt server
  2. 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; it is the value of MEMGPT_SERVER_PASS in .env.

Supported Endpoints & Backends

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.

How to Get Involved

  • Contribute to the Project: Interested in contributing? Start by reading our Contribution Guidelines.
  • Ask a Question: Join our community on Discord and direct your questions to the #support channel.
  • Report Issues or Suggest Features: Have an issue or a feature request? Please submit them through our GitHub Issues page.
  • Explore the Roadmap: Curious about future developments? View and comment on our project roadmap.
  • Benchmark the Performance: Want to benchmark the performance of a model on MemGPT? Follow our Benchmarking Guidance.
  • Join Community Events: Stay updated with the MemGPT event calendar or follow our Twitter account.

Benchmarking Guidance

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.

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.