GithubHelp home page GithubHelp logo

oderwat / memgpt Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cpacker/memgpt

0.0 1.0 0.0 1.51 MB

Teaching LLMs memory management for unbounded context ๐Ÿ“š๐Ÿฆ™

Home Page: https://memgpt.ai

License: Apache License 2.0

Python 98.76% Jupyter Notebook 1.24%

memgpt's Introduction

MemGPT logo

Try out our MemGPT chatbot on Discord!

โญ NEW: You can now run MemGPT with local LLMs and AutoGen! โญ

Discord arXiv 2310.08560

๐Ÿค– Create perpetual chatbots with self-editing memory!


MemGPT demo video

๐Ÿ—ƒ๏ธ Chat with your data - talk to your local files or SQL database!

MemGPT demo video for sql search

Quick setup

Join Discord 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

set DMs settings on MemGPT server to be open in MemGPT so that MemGPT Bot can message you

You can see the full list of available commands when you enter / into the message box.

MemGPT Bot slash commands

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.

Running MemGPT locally

Install MemGPT:

pip install pymemgpt

Add your OpenAI API key to your environment:

export OPENAI_API_KEY=YOUR_API_KEY # on Linux/Mac
set OPENAI_API_KEY=YOUR_API_KEY # on Windows
$Env:OPENAI_API_KEY = "YOUR_API_KEY" # on Windows (PowerShell)

Configure default setting for MemGPT by running:

memgpt configure

Now, you can run MemGPT with:

memgpt run

You can run the following commands in the MemGPT CLI prompt:

  • /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 messages (all if 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 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.readthedocs.io/

Installing from source

To install MemGPT from source, start by cloning the repo:

git clone [email protected]:cpacker/MemGPT.git

Then navigate to the main MemGPT directory, and do:

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.

Installing from source (using Poetry)

First, install Poetry using the official instructions here.

Then, you can install MemGPT from source with:

git clone [email protected]:cpacker/MemGPT.git
poetry shell
poetry install

Support

For issues and feature requests, please open a GitHub issue or message us on our #support channel on Discord

Datasets

Datasets used in our paper can be downloaded at Hugging Face.

๐Ÿš€ Project Roadmap

  • Release MemGPT Discord bot demo (perpetual chatbot)
  • Add additional workflows (load SQL/text into MemGPT external context)
  • Integration tests
  • Integrate with AutoGen (discussion)
  • Add official gpt-3.5-turbo support (discussion)
  • CLI UI improvements (issue)
  • Add support for other LLM backends (issue, discussion)
  • Release MemGPT family of open models (eg finetuned Mistral) (discussion)

memgpt's People

Contributors

0armaan025 avatar almontasser avatar anjaleeps avatar bllchmbrs avatar bobkerns avatar borewik avatar cpacker avatar daneah avatar danx0r avatar dividor avatar eltociear avatar goetzrobin avatar hkabig avatar mr-sk avatar msz-mgs avatar nuaimat avatar oderwat avatar qzgao avatar rabbabansh avatar raisindetre avatar rudra-ji avatar sarahwooders avatar shishirpatil avatar shresthasurav avatar tractorjuice avatar v-kamelowy avatar vivi avatar web3wes avatar wrmedford avatar yubozhao avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.