Coder Social home page Coder Social logo

memgpt's Introduction

MemGPT logo

Discord arXiv 2310.08560

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

Try out our MemGPT chatbot on Discord!
MemGPT demo video

Chat with your data ๐Ÿ—ƒ๏ธ - try talking to the LlamaIndex API docs!

MemGPT demo video for llamaindex api docs search

ChatGPT (GPT-4) when asked the same question:

GPT-4 when asked about llamaindex api docs
(Question from run-llama/llama_index#7756)

Quick setup

Install dependencies:

pip install -r requirements.txt

Add your OpenAI API key to your environment:

export OPENAI_API_KEY=YOUR_API_KEY

What is MemGPT?

MemoryGPT (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.

Try MemGPT in your CLI

To run MemGPT for as a conversation agent in CLI mode, simply run main.py:

python3 main.py

To create a new starter user or starter persona (that MemGPT gets initialized with), create a new .txt file in /memgpt/humans/examples or /memgpt/personas/examples, then use the --persona or --human flag when running main.py. For example:

# assuming you created a new file /memgpt/humans/examples/me.txt
python main.py --human me.txt

main.py flags

--persona
  load a specific persona file
--human
  load a specific human file
--first
  allows you to send the first message in the chat (by default, MemGPT will send the first message)
--debug
  enables debugging output
--archival_storage_faiss_path=<ARCHIVAL_STORAGE_FAISS_PATH>
  load in document database (backed by FAISS index)

Interactive CLI commands

While using MemGPT via the CLI you can run various commands:

/exit
  exit the CLI
/save
  save a checkpoint of the current agent/conversation state
/load
  load a saved checkpoint
/dump
  view the current message log (see the contents of main context)
/memory
  print the current contents of agent memory
/pop
  undo the last message in the conversation
/heartbeat
  send a heartbeat system message to the agent
/memorywarning
  send a memory warning system message to the agent

Support

  • By default MemGPT will use gpt-4, so your API key will require gpt-4 API access.

If you have any further questions, or have anything to share, we are excited to hear your feedback!

Datasets

Datasets used in our paper can be downloaded at HuggingFace.

memgpt's People

Contributors

cpacker avatar shishirpatil avatar vivi 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.