-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: fix README to reflect current project status (#1313)
Co-authored-by: cpacker <[email protected]>
- Loading branch information
1 parent
5669a9c
commit dfb4224
Showing
1 changed file
with
65 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,167 +4,92 @@ | |
|
||
<div align="center"> | ||
|
||
<strong>MemGPT allows you to build LLM agents with self-editing memory</strong> | ||
|
||
<strong>Try out our MemGPT chatbot on <a href="https://discord.gg/9GEQrxmVyE">Discord</a>!</strong> | ||
|
||
<strong>You can now run MemGPT with <a href="https://memgpt.readme.io/docs/local_llm">open/local LLMs</a> and <a href="https://memgpt.readme.io/docs/autogen">AutoGen</a>!</strong> | ||
|
||
<strong>MemGPT allows you to build LLM agents with long term memory & custom tools</strong> | ||
|
||
[![Discord](https://img.shields.io/discord/1161736243340640419?label=Discord&logo=discord&logoColor=5865F2&style=flat-square&color=5865F2)](https://discord.gg/9GEQrxmVyE) | ||
[![arxiv 2310.08560](https://img.shields.io/badge/arXiv-2310.08560-B31B1B?logo=arxiv&style=flat-square)](https://arxiv.org/abs/2310.08560) | ||
[![Documentation](https://img.shields.io/github/v/release/cpacker/MemGPT?label=Documentation&logo=readthedocs&style=flat-square)](https://memgpt.readme.io/docs) | ||
|
||
</div> | ||
|
||
<details open> | ||
<summary><h2>🤖 Create perpetual chatbots with self-editing memory!</h2></summary> | ||
<div align="center"> | ||
<br> | ||
<img src="https://research.memgpt.ai/assets/img/demo.gif" alt="MemGPT demo video" width="800"> | ||
</div> | ||
</details> | ||
|
||
<details> | ||
<summary><h2>🗃️ Chat with your data - talk to your local files or SQL database!</strong></h2></summary> | ||
<div align="center"> | ||
<img src="https://research.memgpt.ai/assets/img/doc.gif" alt="MemGPT demo video for sql search" width="800"> | ||
</div> | ||
</details> | ||
|
||
## Quick setup | ||
Join <a href="https://discord.gg/9GEQrxmVyE">Discord</a></strong> and message the MemGPT bot (in the `#memgpt` channel). Then run the following commands (messaged to "MemGPT Bot"): | ||
* `/profile` (to create your profile) | ||
* `/key` (to enter your OpenAI key) | ||
* `/create` (to create a MemGPT chatbot) | ||
|
||
Make sure your privacy settings on this server are open so that MemGPT Bot can DM you: \ | ||
MemGPT → Privacy Settings → Direct Messages set to ON | ||
<div align="center"> | ||
<img src="https://research.memgpt.ai/assets/img/discord/dm_settings.png" alt="set DMs settings on MemGPT server to be open in MemGPT so that MemGPT Bot can message you" width="400"> | ||
</div> | ||
|
||
You can see the full list of available commands when you enter `/` into the message box. | ||
<div align="center"> | ||
<img src="https://research.memgpt.ai/assets/img/discord/slash_commands.png" alt="MemGPT Bot slash commands" width="400"> | ||
</div> | ||
|
||
## What is MemGPT? | ||
Memory-GPT (or MemGPT in short) is a system that intelligently manages different memory tiers in LLMs in order to effectively provide extended context within the LLM's limited context window. For example, MemGPT knows when to push critical information to a vector database and when to retrieve it later in the chat, enabling perpetual conversations. Learn more about MemGPT in our [paper](https://arxiv.org/abs/2310.08560). | ||
MemGPT makes it easy to build and deploy stateful LLM agents with support for: | ||
* Long term memory/state management | ||
* Connections to [external data sources](https://memgpt.readme.io/docs/data_sources) (e.g. PDF files) for RAG | ||
* Defining and calling [custom tools](https://memgpt.readme.io/docs/functions) (e.g. [google search](https://github.com/cpacker/MemGPT/blob/main/examples/google_search.py)) | ||
|
||
## Running MemGPT locally | ||
## Installation & Setup | ||
Install MemGPT: | ||
```sh | ||
pip install -U pymemgpt | ||
pip install pymemgpt | ||
``` | ||
|
||
Now, you can run MemGPT and start chatting with a MemGPT agent with: | ||
```sh | ||
memgpt run | ||
To use MemGPT with OpenAI, set the enviornemnt variable `OPENAI_API_KEY` to your OpenAI key then run: | ||
``` | ||
|
||
If you're running MemGPT for the first time, you'll see two quickstart options: | ||
|
||
1. **OpenAI**: select this if you'd like to run MemGPT with OpenAI models like GPT-4 (requires an OpenAI API key) | ||
2. **MemGPT Free Endpoint**: select this if you'd like to try MemGPT on a top open LLM for free (currently variants of Mixtral 8x7b!) | ||
|
||
Neither of these options require you to have an LLM running on your own machine. If you'd like to run MemGPT with your custom LLM setup (or on OpenAI Azure), select **Other** to proceed to the advanced setup. | ||
|
||
### Advanced setup | ||
You can reconfigure MemGPT's default settings by running: | ||
```sh | ||
memgpt configure | ||
memgpt quickstart --backend openai | ||
``` | ||
|
||
### In-chat commands | ||
You can run the following commands in the MemGPT CLI prompt while chatting with an agent: | ||
* `/exit`: Exit the CLI | ||
* `/attach`: Attach a loaded data source to the agent | ||
* `/save`: Save a checkpoint of the current agent/conversation state | ||
* `/dump`: View the current message log (see the contents of main context) | ||
* `/dump <count>`: View the last <count> messages (all if <count> is omitted) | ||
* `/memory`: Print the current contents of agent memory | ||
* `/pop`: Undo the last message in the conversation | ||
* `/pop <count>`: Undo the last messages in the conversation. It defaults to 3, which usually is one turn around in the conversation | ||
* `/retry`: Pops the last answer and tries to get another one | ||
* `/rethink <text>`: Will replace the inner dialog of the last assistant message with the `<text>` to help shaping the conversation | ||
* `/rewrite`: Will replace the last assistant answer with the given text to correct or force the answer | ||
* `/heartbeat`: Send a heartbeat system message to the agent | ||
* `/memorywarning`: Send a memory warning system message to the agent | ||
|
||
Once you exit the CLI with `/exit`, you can resume chatting with the same agent by specifying the agent name in `memgpt run --agent <NAME>`. | ||
|
||
## Documentation | ||
See full documentation at: https://memgpt.readme.io | ||
|
||
## Installing from source | ||
To install MemGPT from source, start by cloning the repo: | ||
```sh | ||
git clone [email protected]:cpacker/MemGPT.git | ||
To use MemGPT with a free hosted endpoint, you run run: | ||
``` | ||
|
||
Then navigate to the main `MemGPT` directory, and do: | ||
```sh | ||
pip install -e . | ||
``` | ||
|
||
Now, you should be able to run `memgpt` from the command-line using the downloaded source code. | ||
|
||
If you are having dependency issues using `pip install -e .`, we recommend you install the package using Poetry (see below). Installing MemGPT from source using Poetry will ensure that you are using exact package versions that have been tested for the production build. | ||
|
||
<details> | ||
<summary> | ||
<strong>Installing from source (using Poetry)</strong> | ||
</summary> | ||
|
||
First, install Poetry using [the official instructions here](https://python-poetry.org/docs/#installing-with-the-official-installer). | ||
|
||
Then, you can install MemGPT from source with: | ||
```sh | ||
git clone [email protected]:cpacker/MemGPT.git | ||
poetry shell | ||
poetry install | ||
``` | ||
</details> | ||
|
||
## Python integration (for developers) | ||
|
||
The fastest way to integrate MemGPT with your own Python projects is through the MemGPT client: | ||
```python | ||
from memgpt import create_client | ||
|
||
# Connect to the server as a user | ||
client = create_client() | ||
|
||
# Create an agent | ||
agent_info = client.create_agent( | ||
name="my_agent", | ||
persona="You are a friendly agent.", | ||
human="Bob is a friendly human." | ||
) | ||
|
||
# Send a message to the agent | ||
messages = client.user_message(agent_id=agent_info.id, message="Hello, agent!") | ||
memgpt quickstart --backend memgpt | ||
``` | ||
For more advanced configuration options or to use a different [LLM backend](https://memgpt.readme.io/docs/endpoints) or [local LLMs](https://memgpt.readme.io/docs/local_llm), 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](https://memgpt.readme.io/docs/quickstart) 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](https://memgpt.readme.io/docs/quickstart). | ||
|
||
## Quickstart (Server) | ||
You can use MemGPT to depoy agents as a *service*. The service requires authentication with a MemGPT admin password, which can be set with running `export MEMGPT_SERVER_PASS=password`. You can start a MemGPT service in two ways: | ||
|
||
**Option 1 (Recommended)**: Run with docker compose | ||
1. Clone the repo: `git clone [email protected]:cpacker/MemGPT.git` | ||
2. Run `docker compose up` | ||
3. 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](https://memgpt.readme.io/docs/admin-client) or [REST API](https://memgpt.readme.io/reference/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. | ||
|
||
|
||
## 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 | ⌛ (in-progress) | ❌ | | ||
| 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](https://discord.gg/9GEQrxmVyE), as well as on [this spreadsheet](https://docs.google.com/spreadsheets/d/1fH-FdaO8BltTMa4kXiNCxmBCQ46PRBVp3Vn6WbPgsFs/edit?usp=sharing). | ||
|
||
## What open LLMs work well with MemGPT? | ||
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](https://discord.gg/9GEQrxmVyE), as well as on [this spreadsheet](https://docs.google.com/spreadsheets/d/1fH-FdaO8BltTMa4kXiNCxmBCQ46PRBVp3Vn6WbPgsFs/edit?usp=sharing). | ||
|
||
### Benchmarking an LLM on MemGPT (`memgpt benchmark` command) | ||
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](https://forms.gle/XiBGKEEPFFLNSR348), which will be used to update the spreadsheet. | ||
## Documentation | ||
See full documentation at: https://memgpt.readme.io | ||
|
||
## Support | ||
For issues and feature requests, please [open a GitHub issue](https://github.com/cpacker/MemGPT/issues) or message us on our `#support` channel on [Discord](https://discord.gg/9GEQrxmVyE). | ||
|
||
## Datasets | ||
Datasets used in our [paper](https://arxiv.org/abs/2310.08560) can be downloaded at [Hugging Face](https://huggingface.co/MemGPT). | ||
|
||
## Legal notices | ||
By using MemGPT and related MemGPT services (such as the MemGPT endpoint or hosted service), you agree to our [privacy policy](PRIVACY.md) and [terms of service](TERMS.md). | ||
|
||
## Roadmap | ||
You can view (and comment on!) the MemGPT developer roadmap on GitHub: https://github.com/cpacker/MemGPT/issues/1200. | ||
You can view (and comment on!) the MemGPT developer roadmap on GitHub: https://github.com/cpacker/MemGPT/issues/1200. | ||
|
||
## Benchmarking | ||
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](https://forms.gle/XiBGKEEPFFLNSR348), which will be used to update the spreadsheet. | ||
|