Releases: letta-ai/letta
v0.4.1
This release includes many bugfixes, as well as support for detaching data sources from agents and addition of additional tool providers.
⚒️ Support for Composio, LangChain, and CrewAI tools
We've improve support for external tool providers - you can use external tools (Composio, LangChain, and CrewAI) with:
pip install 'letta[external-tools]'
- Support composio tools (example)
- Add tool-use examples for Langchain tools and CrewAI tools
What's Changed
- fix: patch recall error by @cpacker in #1749
- fix: patch validation error on
/messages
endpoint by @cpacker in #1750 - feat: add locust for testing user/connection scaling by @sarahwooders in #1742
- ci: disable assistants api workflow by @cpacker in #1752
- fix: server memory leak by @cpacker in #1751
- fix: hotfix for server test by @cpacker in #1753
- fix: cleanup base agent typing on step(), from PR #1700 by @cpacker in #1754
- feat: add support for
user_id
in header by @cpacker in #1755 - refactor: clean up
agent.step()
by @cpacker in #1756 - fix: fix DB session management to avoid connection overflow error by @sarahwooders in #1758
- feat: add organization endpoints and schemas by @sarahwooders in #1762
- fix: various fixes to get create agent REST API to work by @cpacker in #1763
- feat: add
DEFAULT_USER_ID
andDEFAULT_ORG_ID
for local usage by @sarahwooders in #1768 - chore: migrate package name to
letta
by @sarahwooders in #1775 - chore: Update README.md by @cpacker in #1778
- chore: Update README.md by @cpacker in #1779
- fix: fixed bug when existing agent state is loaded via cli by @ShaliniR8 in #1783
- fix: various fixes for workflow tests by @sarahwooders in #1788
- fix: deprecate local embedding tests by @sarahwooders in #1789
- docs: patch readme by @cpacker in #1790
- feat: allow jobs to be filtered by
source_id
by @sarahwooders in #1786 - feat: support detaching sources from agents by @sarahwooders in #1791
- docs: patch link by @cpacker in #1797
- fix: use JSON schema name instead of tool name for loading from env by @sarahwooders in #1798
- fix: patch typos in notebooks by @cpacker in #1803
- fix: remove usage of
anon_clientid
and migrate toDEFAULT_USER
by @sarahwooders in #1805 - fix: Enable importing LangChain tools with arguments by @mattzh72 in #1807
- feat: don't require tags to be specified for tool creation by @sarahwooders in #1806
- fix: minor patch to tool linking with JSON schema and
Tool.name
do not match by @sarahwooders in #1802 - docs: update main README by @cpacker in #1804
- feat: add defaults to compose and
.env.example
by @sarahwooders in #1792 - chore: update static files by @4shub in #1811
- docs: Finish writing example for LangChain tooling by @mattzh72 in #1810
- chore: remove dead function loading code by @sarahwooders in #1795
- fix: Check that content is not None before setting to internal_monologue by @mattzh72 in #1813
- feat: Adapt crewAI to also accept parameterized tools and add example by @mattzh72 in #1817
- fix: remove function overrides for
Block
object by @sarahwooders in #1816 - feat: add health check route by @4shub in #1822
- feat: Add integration with Composio tools by @mattzh72 in #1820
- fix: Fix small benchmark bugs by @mattzh72 in #1826
- chore: bump version 0.4.1 by @sarahwooders in #1809
New Contributors
- @ShaliniR8 made their first contribution in #1783
Full Changelog: 0.4.0...0.4.1
0.3.25
🐜 Bugfix release
- fix: exit CLI on empty read for human or persona
- fix: fix overflow error for existing memory fields with clipping
What's Changed
- fix: patch error on memory overflow by @sarahwooders in #1669
Full Changelog: 0.3.24...0.3.25
v0.3.24
Add new alpha revision of dev portal
What's Changed
- chore: bump version 0.3.24 by @sarahwooders in #1657
- feat: update portal to latest alpha by @cpacker in #1658
Full Changelog: 0.3.23...0.3.24
0.3.23
🦗 Bugfix release
What's Changed
- chore: remove deprecated
main.yml
file by @sarahwooders in #1604 - feat: Fix CLI agent delete functionality & allow importation of file for system prompt - attempt #2 by @madgrizzle in #1607
- fix: syntax warning on startup by @zacatac in #1612
- feat: add index to avoid performance degradation by @a67793581 in #1606
- feat: add example notebooks by @sarahwooders in #1625
- fix: patch unbound variable on streaming tokens by @cpacker in #1630
- feat: create an admin return all agents route by @4shub in #1620
- fix: add correct dependencies and missing variable by @goetzrobin in #1638
- fix: patches to the API for non-streaming OAI proxy backends by @cpacker in #1653
- chore: bump version by @sarahwooders in #1651
- fix: fix tool creation to accept dev portal POST request by @sarahwooders in #1656
New Contributors
- @a67793581 made their first contribution in #1606
- @4shub made their first contribution in #1620
Full Changelog: 0.3.22...0.3.23
v0.3.22
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 Clientmemgpt 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
- @vysona-scott made their first contribution in #1592
- @jward92 made their first contribution in #1596
Full Changelog: 0.3.21...0.3.22
v0.3.21
🐞 Bugfix release + allow providing system prompt to agent creation API (thanks to @Vandracon!)
What's Changed
- feat: disable parallel tool calling by @sarahwooders in #1570
- fix: check for tool call in message object by @sarahwooders in #1573
- fix: sort order by @sarahwooders in #1574
- feat: changes create agent API to accept optional system value. by @Vandracon in #1575
- fix: bump version 0.3.21 by @sarahwooders in #1576
New Contributors
- @Vandracon made their first contribution in #1575
Full Changelog: 0.3.20...0.3.21
v0.3.20
💪 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
- fix: fix bug in migration script memory for 0.3.18 by @sarahwooders in #1548
- fix: create source by @sarahwooders in #1553
- feat: patch missing inner thoughts on new openai models by @cpacker in #1562
- fix: fix CLI commands by migrating to Python client by @sarahwooders in #1563
- feat: add character limits for persona/human to /config response by @goetzrobin in #1546
- chore: bump version 0.3.20 by @sarahwooders in #1568
Full Changelog: 0.3.19...0.3.20
v0.3.19
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
- chore: bump version to 0.3.18 by @sarahwooders in #1483
- fix: fix main.yml test by @sarahwooders in #1484
- feat: move tool functions to user by @sarahwooders in #1487
- feat: migration script for 0.3.17 by @sarahwooders in #1489
- feat: refactor
CoreMemory
to support generalized memory fields and memory editing functions by @sarahwooders in #1479 - fix: use timestamp passed by request for user message created date by @goetzrobin in #1503
- fix: patch type error by @cpacker in #1506
- fix: dos2unix text files by @cpacker in #1507
- chore:
.gitattributes
by @cpacker in #1511 - fix: bug fixing for #1455 - not able to serialize json for Azure by @ljhskyso in #1495
- chore: update dev portal by @cpacker in #1514
- fix: remove duplicate
send_message
functions by @sarahwooders in #1519 - fix: use params in get_all_users(GET) endpoint by @yuleisheng in #1518
- fix: update docs to say 'stream_steps = True' by @yuleisheng in #1531
- fix: Fixed issue #1523 by @Vinayak21574 in #1526
- fix: fix example scripts by @sarahwooders in #1536
- fix: add memory tools from dev portal by @sarahwooders in #1540
- feat: migration script for version 0.3.18 by @sarahwooders in #1541
- chore: bump version 0.3.19 by @sarahwooders in #1542
New Contributors
- @ljhskyso made their first contribution in #1495
- @yuleisheng made their first contribution in #1518
- @Vinayak21574 made their first contribution in #1526
Full Changelog: 0.3.18...0.3.19
v0.3.18
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
- feat: Qdrant storage connector by @Anush008 in #1023
- fix: remove server locking on agents by @sarahwooders in #1442
- fix: various fixes to python client and add tutorial notebooks by @sarahwooders in #1377
- feat: cursor pagination of get_all_users in /admin/users route by @ajanitshimanga in #1441
- fix: allow concurrent processing for
async def send_message
function by @sarahwooders in #1445 - fix: update
rdme-openapi.yml
to correct Python + poetry version by @sarahwooders in #1446 - feat: Migrating CLI to run on MemGPT Client for
memgpt [list/add/delete]
(#1428) by @sarahwooders in #1449 - fix: update
Dockerfile
to Python 3.12 by @sarahwooders in #1456 - fix: debug logs in server (#1452) by @sarahwooders in #1457
- feat: add tools from the Python client by @sarahwooders in #1463
- fix: simple_summary_wrapper function_call KeyError by @djkazic in #1265
- fix: add
ensure_ascii
to missingjson.dumps
calls by @cpacker in #1466 - feat: add more tool calling support to
LocalClient
by @sarahwooders in #1465 - fix: fix ugly dev tool print in cli by @cpacker in #1469
- fix: patch
/pop
,/retry
, and/rethink
by @cpacker in #1471 - fix: check tool call type by @sarahwooders in #1451
- fix: drop print from #1465 by @cpacker in #1472
- feat: dev portal fixes for server changes by @sarahwooders in #1474
- fix: more server patches for dev portal by @sarahwooders in #1475
- feat: add token streaming to the MemGPT API by @cpacker in #1280
- feat: include usage statistics in message response by @sarahwooders in #1482
New Contributors
- @Anush008 made their first contribution in #1023
- @ajanitshimanga made their first contribution in #1441
- @djkazic made their first contribution in #1265
Full Changelog: 0.3.17...0.3.18
v0.3.17
🦙 You can now use MemGPT with the Ollama embeddings endpoint!
What's Changed
- fix: Append encoding='utf-8' to open by @bear0330 in #1423
- fix: #1532 upload sources file error "I/O operation on closed file" by @scenaristeur in #1425
- fix: add back
memgpt/configs
folder by @sarahwooders in #1431 - feat: split up endpoint tests and remove OpenAI dependency for main pytest tests by @sarahwooders in #1432
- feat: Ollama embeddings api + Ollama tests by @KrishnaM251 @sarahwooders in #1433
- docs: update compat checklist by @cpacker in #1434
- chore: bump version 0.3.17 by @sarahwooders in #1435
New Contributors
- @bear0330 made their first contribution in #1423
- @KrishnaM251 made their first contribution in #1433
Full Changelog: 0.3.16...0.3.17