Skip to content
Letta Platform Letta Platform Letta Docs
Sign up

Create Conversation

conversations.create(ConversationCreateParams**kwargs) -> Conversation
post/v1/conversations/

Create a new conversation for an agent.

ParametersExpand Collapse
agent_id: str

The agent ID to create a conversation for

isolated_block_labels: Optional[SequenceNotStr[str]]

List of block labels that should be isolated (conversation-specific) rather than shared across conversations. New blocks will be created as copies of the agent's blocks with these labels.

summary: Optional[str]

A summary of the conversation.

ReturnsExpand Collapse
class Conversation:

Represents a conversation on an agent for concurrent messaging.

id: str

The unique identifier of the conversation.

agent_id: str

The ID of the agent this conversation belongs to.

created_at: Optional[datetime]

The timestamp when the object was created.

formatdate-time
created_by_id: Optional[str]

The id of the user that made this object.

in_context_message_ids: Optional[List[str]]

The IDs of in-context messages for the conversation.

isolated_block_ids: Optional[List[str]]

IDs of blocks that are isolated (specific to this conversation, overriding agent defaults).

last_updated_by_id: Optional[str]

The id of the user that made this object.

summary: Optional[str]

A summary of the conversation.

updated_at: Optional[datetime]

The timestamp when the object was last updated.

formatdate-time
Create Conversation
import os
from letta_client import Letta

client = Letta(
    api_key=os.environ.get("LETTA_API_KEY"),  # This is the default and can be omitted
)
conversation = client.conversations.create(
    agent_id="agent_id",
)
print(conversation.id)
{
  "id": "id",
  "agent_id": "agent_id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "created_by_id": "created_by_id",
  "in_context_message_ids": [
    "string"
  ],
  "isolated_block_ids": [
    "string"
  ],
  "last_updated_by_id": "last_updated_by_id",
  "summary": "summary",
  "updated_at": "2019-12-27T18:11:19.117Z"
}
Returns Examples
{
  "id": "id",
  "agent_id": "agent_id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "created_by_id": "created_by_id",
  "in_context_message_ids": [
    "string"
  ],
  "isolated_block_ids": [
    "string"
  ],
  "last_updated_by_id": "last_updated_by_id",
  "summary": "summary",
  "updated_at": "2019-12-27T18:11:19.117Z"
}