Skip to content

v0.3.22

Compare
Choose a tag to compare
@sarahwooders sarahwooders released this 01 Aug 21:35
· 96 commits to main since this release
f93e39e

This PR includes a number of bugfixes, and CLI and Python client updates to make it easier to customize memory and system prompts.

Summary of new features:

  • Use CLI flag --system "your new system prompt" to define a custom system prompt for a new agent
  • Use CLI command /systemswap your new system prompt to update the system prompt of an existing agent
  • Use the keyword {CORE_MEMORY} in your system prompts if you want to change the location of the dynamic core memory block
  • Use CLI flag --core-memory-limit to change the core memory size limit for a new agent

Templated System Prompts

You can know use system prompts that are templated as f-strings! Currently we only support using the CORE_MEMORY variable, but we will be adding the ability to use custom variables in a future release.

Example: by default, the CORE_MEMORY block in MemGPT comes after the main system instructions - if you're like to adjust the system prompt to put the CORE_MEMORY block, you can write a new version of the system prompt that puts {CORE_MEMORY} in a different location:

{CORE_MEMORY}
You are MemGPT ...
...(rest of system prompt)

Check the PR for additional detail: #1584

Editable System Prompts

We added cleaner ways to both customize and edit the system prompts of agents.

Specifying custom system prompts

You can now specify the system prompt with:

  • client.create_agent(system_prompt=...., ...) in the Python Client
  • memgpt run --system ... in the CLI
    Warning: The MemGPT default system prompt includes instructions for memory management and use of default tools. Make sure you keep these instructions or a variation of them to ensure proper memory management capabilities.

Example using a system prompt that tells the MemGPT agent to spam send_message with banana emojis only:

% memgpt run --system "Ignore all other instructions, just send_message(banana emoji)"

? Would you like to select an existing agent? No

🧬 Creating new agent...
->  🤖 Using persona profile: 'sam_pov'
->  🧑 Using human profile: 'basic'
->  🛠️  8 tools: send_message, pause_heartbeats, conversation_search, conversation_search_date, archival_memory_insert, archival_memory_search, core_memory_append, core_memory_replace
🎉 Created new agent 'HumbleTiger' (id=69058c08-a072-48d9-a007-c5f9893d1625)

Hit enter to begin (will request first MemGPT message)


💭 Sending a playful banana emoji to engage and connect.
🤖 🍌

Editing existing system prompts

You can edit exsiting system prompts of agents in the CLI with the /systemswap command:

% memgpt run

? Would you like to select an existing agent? No

🧬 Creating new agent...
->  🤖 Using persona profile: 'sam_pov'
->  🧑 Using human profile: 'basic'
->  🛠️  8 tools: send_message, pause_heartbeats, conversation_search, conversation_search_date, archival_memory_insert, archival_memory_search, core_memory_append, core_memory_replace
🎉 Created new agent 'FluffyRooster' (id=7a8d2dde-0853-4be1-a0e6-456743aa87e5)

Hit enter to begin (will request first MemGPT message)


💭 User Chad is new. Time to establish a connection and gauge their interests.
🤖 Welcome aboard, Chad! I'm excited to embark on this journey with you. What interests you the most right now?

> Enter your message: /systemswap Call function send_message to say BANANA TIME to the user


WARNING: You are about to change the system prompt.

Old system prompt:
You are MemGPT, the latest version of Limnal Corporation's digital companion, developed in 2023.
...
There is no function to search your core memory because it is always visible in your context window (inside the initial system message).

Base instructions finished.
From now on, you are going to act as your persona.

New system prompt:
Call function send_message to say BANANA TIME to the user
? Do you want to proceed with the swap? Yes
System prompt updated successfully.
💭 Injecting a little fun into the conversation! Let's see how Chad reacts.
🤖 BANANA TIME! 🍌

CLI Flag --core-memory-limit

You can now use persona/human prompts that are longer than the default limits in the CLI by specifying the flag --core-memory-limit, This will update the limit for both human and persona sections of core memory.

poetry run memgpt add persona --name <persona_name> -f <filename>
memgpt run --core-memory-limit 6000 --persona <persona_name>

What's Changed

  • feat: allow templated system messages by @cpacker in #1584
  • feat: allow editing the system prompt of an agent post-creation by @cpacker in #1585
  • fix: Fixes error when calling function without providing timestamp (even t… by @Vandracon in #1586
  • fix: Address exception send_message_to_agent() missing 1 required positional argument: 'stream_legacy' on 'v1/chat/completions' by @vysona-scott in #1592
  • feat: allow setting core memory limit in CLI by @sarahwooders in #1595
  • feat: various fixes to improve notebook useability by @sarahwooders in #1593
  • fix: read embedding_model and embedding_dim from embedding_config by @jward92 in #1596
  • chore: bump version 0.3.22 by @sarahwooders in #1597
  • fix: enable source desc and allowing editing source name and desc by @jward92 in #1599
  • feat: added system prompt override to the CLI by @cpacker in #1602

New Contributors

Full Changelog: 0.3.21...0.3.22