Message Modification API

We’ve added a new API endpoint that allows you to modify existing messages in an agent’s conversation history. This feature is particularly useful for editing message history to refine agent behavior without starting a new conversation.

1from letta_client import Letta, UpdateSystemMessage
2client = Letta(
3 token="YOUR_API_KEY",
4)
5client.agents.messages.modify(
6 agent_id="AGENT_ID",
7 message_id="MESSAGE_ID",
8 request=UpdateSystemMessage(
9 content="The agent should prioritize brevity in responses.",
10 ),
11)