MemGPT

Create LLM agents with long-term memory and custom tools πŸ“šπŸ¦™

APACHE-2.0 License

Downloads
28K
Stars
10.3K

Bot releases are hidden (Show)

MemGPT - v0.3.20 Latest Release

Published by sarahwooders 3 months ago

πŸ’ͺ Performance improvements for gpt-4o and gpt-4o-mini

Improved compatibility with gpt-4o and gpt-4o-mini models: We updated the prompt format for weaker models so that the inner thoughts of the agents are properly generated (previously, these models could only generate None for inner thoughts).

πŸ› Bugfixes for the CLI

Fixed issues with creating, listing and deleting humans and personas.

What's Changed

Full Changelog: https://github.com/cpacker/MemGPT/compare/0.3.19...0.3.20

MemGPT - v0.3.19

Published by sarahwooders 3 months ago

Support for custom memory classes

MemGPT now supports customizeable memory classes by extending the BaseMemory class. This allows developers to both define custom memory fields (instead of just human/persona) as well as custom memory editing functions (rather than core_memory_[append/replace]. Note that custom memory editing functions will need to have properly formatted docstrings so that the function can be added as a custom tool to the agent.

Default ChatMemory class

Agents will default to using the ChatMemory class, which has the original human/memory fields and memory editing functions in MemGPT:

from memgpt.memory import BaseMemory

class ChatMemory(BaseMemory):

    def __init__(self, persona: str, human: str, limit: int = 2000):
        self.memory = {
            "persona": MemoryModule(name="persona", value=persona, limit=limit),
            "human": MemoryModule(name="human", value=human, limit=limit),
        }

    def core_memory_append(self, name: str, content: str) -> Optional[str]:
        """
        Append to the contents of core memory.

        Args:
            name (str): Section of the memory to be edited (persona or human).
            content (str): Content to write to the memory. All unicode (including emojis) are supported.

        Returns:
            Optional[str]: None is always returned as this function does not produce a response.
        """
        self.memory[name].value += "\n" + content
        return None

    def core_memory_replace(self, name: str, old_content: str, new_content: str) -> Optional[str]:
        """
        Replace the contents of core memory. To delete memories, use an empty string for new_content.

        Args:
            name (str): Section of the memory to be edited (persona or human).
            old_content (str): String to replace. Must be an exact match.
            new_content (str): Content to write to the memory. All unicode (including emojis) are supported.

        Returns:
            Optional[str]: None is always returned as this function does not produce a response.
        """
        self.memory[name].value = self.memory[name].value.replace(old_content, new_content)
        return None

Improve agent creation interface

Custom tools and memory classes can now both be specified in the agent creation API:

from memgpt.memory import ChatMemory

# create agent with default tools/memory 
basic_agent = client.create_agent()

# create agent with custom tools and memory
tool = client.create_tool(...)
memory = CustomMemory(human="I am Sarah", persona="I am Sam", organization="MemGPT")
custom_agent = client.create_agent(
    name="my_agent", memory=memory, tools=[tool.name]
)

The memory editing bools from the extended BaseMemory class are automatically added as tools to the agent to use.

Deprecation of Presets

Since specification of tools, memory, and the system prompt is now moving into the agent creation interface, we are no longer supporting presets as a mechanism to create agents.

Migration Script

We provide a migration script for migrating agents from v0.3.18 to this version (due to changes in the AgentState schema).

What's Changed

New Contributors

Full Changelog: https://github.com/cpacker/MemGPT/compare/0.3.18...0.3.19

MemGPT - v0.3.18

Published by sarahwooders 4 months ago

This release introduces tool creation from inside Python scripts, returning usage statistics, and many bug fixes.

πŸ”§ Tool creation in the Python Client

We added support for directly creating tools in Python:


def print_tool(message: str):
    """ 
    Args: 
        message (str): The message to print.
        
    Returns:
        str: The message that was printed.
        
    """
    print(message)
    return message

tool = client.create_tool(print_tool, tags=["extras"])
agent_state = client.create_agent(tools=[tool.name]))

πŸ“Š Usage Statistics

Sending a message to an agent now also returns usage statistics for computing cost metrics:

class MemGPTUsageStatistics(BaseModel):
    completion_tokens: int
    prompt_tokens: int
    total_tokens: int
    step_count: int

What's Changed

New Contributors

Full Changelog: https://github.com/cpacker/MemGPT/compare/0.3.17...0.3.18

MemGPT - v0.3.17

Published by sarahwooders 5 months ago

πŸ¦™ You can now use MemGPT with the Ollama embeddings endpoint!

What's Changed

New Contributors

Full Changelog: https://github.com/cpacker/MemGPT/compare/0.3.16...0.3.17

MemGPT - v0.3.16

Published by cpacker 5 months ago

🧿 Milvus integration: you can now use Milvus to back the MemGPT vector database! For more information, see: https://memgpt.readme.io/docs/storage#milvus

What's Changed

New Contributors

Full Changelog: https://github.com/cpacker/MemGPT/compare/0.3.15...0.3.16

MemGPT - v0.3.15

Published by sarahwooders 5 months ago

πŸ¦™ Llama 3 support and bugfixes

What's Changed

New Contributors

Full Changelog: https://github.com/cpacker/MemGPT/compare/0.3.14...0.3.15

MemGPT - v0.3.14

Published by cpacker 6 months ago

🐜 Bug-fix release

What's Changed

Full Changelog: https://github.com/cpacker/MemGPT/compare/0.3.13...0.3.14

MemGPT - v0.3.13

Published by sarahwooders 6 months ago

πŸ–₯️ MemGPT Dev Portal (alpha build)

Please note the dev portal is in alpha and this is not an official release!

This adds support for viewing the dev portal when the MemGPT service is running. You can view the dev portal on memgpt.localhost (if running with docker) or localhost:8283 (if running with memgpt server).

Make sure you install MemGPT with pip install pymemgpt and run memgpt quickstart [--backend openai] or memgpt configure before running the server.

There are two options to deploy the server:

Option 1: Run with docker compose

  1. Install and run docker
  2. Clone the repo: git clone [email protected]:cpacker/MemGPT.git
  3. Run docker compose up
  4. 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

What's Changed

Full Changelog: https://github.com/cpacker/MemGPT/compare/0.3.12...0.3.13

MemGPT - 0.3.12

Published by sarahwooders 6 months ago

🐳 Cleaned up workflow for creating a MemGPT service with docker compose up:

  • Reverse proxy added so you can open the dev portal at http://memgpt.localhost
  • Docker development with docker compose -f dev-compose.yaml up --build (built from local code)
  • Postgres data mounted to .pgdata folder
  • OpenAI keys passed to server via environment variables (in compose.yaml)

πŸͺ² Bugfixes for Groq API and server

What's Changed

New Contributors

Full Changelog: https://github.com/cpacker/MemGPT/compare/0.3.11...0.3.12

MemGPT - 0.3.11

Published by cpacker 6 months ago

🚰 We now support streaming in the CLI when using OpenAI (+ OpenAI proxy) endpoints! You can turn on streaming mode with memgpt run --stream

screencast

What's Changed

New Contributors

Full Changelog: https://github.com/cpacker/MemGPT/compare/0.3.10...0.3.11

MemGPT - 0.3.10

Published by sarahwooders 6 months ago

0.3.10

We added support for Anthropic, Cohere, and Groq!
image

What's Changed

Full Changelog: https://github.com/cpacker/MemGPT/compare/0.3.9...0.3.10

MemGPT - 0.3.9

Published by sarahwooders 6 months ago

This PR add Google AI Gemini Pro support for MemGPT, as well as Python 3.12 support.

Using MemGPT with Gemini

Setting up Gemini with MemGPT configure:

> memgpt configure
Loading config from /Users/loaner/.memgpt/config
? Select LLM inference provider: google_ai
? Enter your Google AI (Gemini) API key (see https://aistudio.google.com/app/a
pikey): *********
? Enter your Google AI (Gemini) service endpoint (see https://ai.google.dev/api/rest): generativelanguage
? Select default model: gemini-pro
Got context window 30720 for model gemini-pro (from Google API)
? Select your model's context window (see https://cloud.google.com/vertex-ai/generative-ai/docs/learn/model-versioning#gemini-model-versions): 30720
? Select embedding provider: openai
? Select default preset: memgpt_chat
? Select default persona: sam_pov
? Select default human: basic
? Select storage backend for archival data: chroma
? Select chroma backend: persistent
? Select storage backend for recall data: sqlite
πŸ“– Saving config to /Users/loaner/.memgpt/config

What's Changed

Full Changelog: https://github.com/cpacker/MemGPT/compare/0.3.8...0.3.9

MemGPT - 0.3.8

Published by sarahwooders 7 months ago

This release introduces initial support for running a MemGPT server with Docker Compose, and bugfixes for storing embeddings and message timestamps.

What's Changed

New Contributors

Full Changelog: https://github.com/cpacker/MemGPT/compare/0.3.7...0.3.8

MemGPT - 0.3.7

Published by cpacker 7 months ago

πŸ¦‚ Bugfix release

What's Changed

New Contributors

Full Changelog: https://github.com/cpacker/MemGPT/compare/0.3.6...0.3.7

MemGPT - 0.3.6

Published by cpacker 7 months ago

🐜 bugfix release

What's Changed

Full Changelog: https://github.com/cpacker/MemGPT/compare/0.3.5...0.3.6

MemGPT - 0.3.5

Published by cpacker 8 months ago

πŸ¦— Bugfix release

What's Changed

New Contributors

Full Changelog: https://github.com/cpacker/MemGPT/compare/0.3.4...0.3.5

MemGPT - 0.3.4

Published by sarahwooders 8 months ago

🐝 Bugfix release

What's Changed

New Contributors

Full Changelog: https://github.com/cpacker/MemGPT/compare/0.3.3...0.3.4

MemGPT - 0.3.3

Published by sarahwooders 8 months ago

Minor bugfix release

What's Changed

Full Changelog: https://github.com/cpacker/MemGPT/compare/0.3.2...0.3.3

MemGPT - 0.3.2

Published by sarahwooders 8 months ago

🐞 Bugfix release

What's Changed

Full Changelog: https://github.com/cpacker/MemGPT/compare/0.3.1...0.3.2

MemGPT - 0.3.1

Published by sarahwooders 8 months ago

πŸ› Bugfix release

🚧 What's Changed

πŸ‘‹ New Contributors

✍️ Full Changelog: https://github.com/cpacker/MemGPT/compare/0.3...0.3.1