[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-letta-letta-conversations-api":3,"mdc--33zo10-key":35,"related-org-letta-letta-conversations-api":1685,"related-repo-letta-letta-conversations-api":1846},{"slug":4,"name":5,"fn":6,"description":7,"org":8,"tags":13,"stars":24,"repoUrl":25,"updatedAt":26,"license":27,"forks":28,"topics":29,"repo":30,"sourceUrl":33,"mdContent":34},"letta-conversations-api","Letta Conversations API","manage isolated agent conversation threads","Guide for using the Letta Conversations API to manage isolated message threads on agents. Use when building multi-user chat applications, session management, or any scenario requiring separate conversation contexts on a single agent.",{"slug":9,"name":10,"logoUrl":11,"githubOrg":12},"letta","Letta","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fletta.png","letta-ai",[14,18,21],{"name":15,"slug":16,"type":17},"Sessions","sessions","tag",{"name":19,"slug":20,"type":17},"Agents","agents",{"name":22,"slug":23,"type":17},"API Development","api-development",127,"https:\u002F\u002Fgithub.com\u002Fletta-ai\u002Fskills","2026-07-13T06:25:24.277437",null,20,[],{"repoUrl":25,"stars":24,"forks":28,"topics":31,"description":32},[],"A shared repository for skills. Intended to be used with Letta Code, Claude Code, Codex CLI, and other agents that support skills.","https:\u002F\u002Fgithub.com\u002Fletta-ai\u002Fskills\u002Ftree\u002FHEAD\u002Fletta\u002Fconversations","---\nname: Letta Conversations API\ndescription: Guide for using the Letta Conversations API to manage isolated message threads on agents. Use when building multi-user chat applications, session management, or any scenario requiring separate conversation contexts on a single agent.\n---\n\n# Letta Conversations API\n\nThe Conversations API allows multiple isolated message threads on a single agent. Each conversation maintains its own message history while sharing the agent's memory blocks and tools.\n\n## When to Use This Skill\n\n- Building multi-user chat applications (each user gets their own conversation)\n- Implementing session management with separate contexts\n- A\u002FB testing agent responses across isolated conversations\n- Any scenario where you need multiple independent chat threads with one agent\n\n## Key Concepts\n\n| Concept | Description |\n|---------|-------------|\n| **Conversation** | An isolated message thread on an agent (`conv-xxx` ID) |\n| **Isolation** | Each conversation has separate message history |\n| **Shared State** | Memory blocks and tools are shared across conversations |\n| **In-Context Messages** | Messages currently in the conversation's context window |\n\n## Python SDK Usage\n\n### Setup\n\n```python\nfrom letta_client import Letta\n\nclient = Letta(base_url=\"https:\u002F\u002Fapi.letta.com\", api_key=\"your-key\")\n```\n\n### Create a Conversation\n\n```python\nconversation = client.conversations.create(agent_id=\"agent-xxx\")\n# conversation.id -> \"conv-xxx\"\n```\n\n### Send Messages (Streaming)\n\n```python\nstream = client.conversations.messages.create(\n    conversation_id=conversation.id,\n    messages=[{\"role\": \"user\", \"content\": \"Hello!\"}],\n)\n\nfor msg in stream:\n    if hasattr(msg, \"message_type\") and msg.message_type == \"assistant_message\":\n        print(msg.content)\n```\n\n### List Messages in a Conversation\n\n```python\nmessages = client.conversations.messages.list(\n    conversation_id=conversation.id,\n    limit=50,  # Optional: default 100\n    after=\"message-xxx\",  # Optional: cursor for pagination\n    before=\"message-yyy\",  # Optional: cursor for pagination\n)\n```\n\n### List All Conversations for an Agent\n\n```python\nconversations = client.conversations.list(\n    agent_id=\"agent-xxx\",\n    limit=50,  # Optional\n    after=\"conv-xxx\",  # Optional: cursor for pagination\n)\n```\n\n### Retrieve a Specific Conversation\n\n```python\nconv = client.conversations.retrieve(conversation_id=\"conv-xxx\")\n# conv.in_context_message_ids -> list of message IDs in context window\n```\n\n## REST API Endpoints\n\n| Method | Endpoint | Description |\n|--------|----------|-------------|\n| `POST` | `\u002Fv1\u002Fconversations?agent_id=xxx` | Create a conversation |\n| `GET` | `\u002Fv1\u002Fconversations?agent_id=xxx` | List conversations |\n| `GET` | `\u002Fv1\u002Fconversations\u002F{conversation_id}` | Get a conversation |\n| `GET` | `\u002Fv1\u002Fconversations\u002F{conversation_id}\u002Fmessages` | List messages |\n| `POST` | `\u002Fv1\u002Fconversations\u002F{conversation_id}\u002Fmessages` | Send message (streams response) |\n| `POST` | `\u002Fv1\u002Fconversations\u002F{conversation_id}\u002Fstream` | Resume a background stream |\n\n### REST Example: Create and Send Message\n\n```bash\n# Create conversation\ncurl -X POST \"https:\u002F\u002Fapi.letta.com\u002Fv1\u002Fconversations?agent_id=agent-xxx\" \\\n  -H \"Authorization: Bearer $LETTA_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\"\n\n# Send message (streaming response)\ncurl -X POST \"https:\u002F\u002Fapi.letta.com\u002Fv1\u002Fconversations\u002Fconv-xxx\u002Fmessages\" \\\n  -H \"Authorization: Bearer $LETTA_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -H \"Accept: text\u002Fevent-stream\" \\\n  -d '{\"messages\": [{\"role\": \"user\", \"content\": \"Hello!\"}]}'\n```\n\n## Conversation Schema\n\n```python\nclass Conversation:\n    id: str                      # \"conv-xxx\"\n    agent_id: str                # Associated agent ID\n    created_at: datetime         # Creation timestamp\n    summary: Optional[str]       # Optional conversation summary\n    in_context_message_ids: List[str]  # Message IDs in context window\n```\n\n## Common Patterns\n\n### Multi-User Chat Application\n\n```python\n# Each user gets their own conversation\nuser_conversations = {}\n\ndef get_or_create_conversation(user_id: str, agent_id: str) -> str:\n    if user_id not in user_conversations:\n        conv = client.conversations.create(agent_id=agent_id)\n        user_conversations[user_id] = conv.id\n    return user_conversations[user_id]\n\ndef send_user_message(user_id: str, agent_id: str, message: str):\n    conv_id = get_or_create_conversation(user_id, agent_id)\n    return client.conversations.messages.create(\n        conversation_id=conv_id,\n        messages=[{\"role\": \"user\", \"content\": message}],\n    )\n```\n\n### Paginating Through Message History\n\n```python\ndef get_all_messages(conversation_id: str):\n    all_messages = []\n    after = None\n    \n    while True:\n        batch = client.conversations.messages.list(\n            conversation_id=conversation_id,\n            limit=100,\n            after=after,\n        )\n        if not batch:\n            break\n        all_messages.extend(batch)\n        after = batch[-1].id\n    \n    return all_messages\n```\n\n## Important Notes\n\n1. **Streaming by default**: The `messages.create` endpoint always streams responses\n2. **Shared memory**: Memory block updates in one conversation are visible in all conversations for that agent\n3. **Message isolation**: Conversation message history is completely isolated between conversations\n4. **Pagination**: Use `after`\u002F`before` cursors for efficient pagination, not offsets\n\n## Example Scripts\n\nThis skill includes two example scripts in the `scripts\u002F` directory:\n\n1. **`conversations_demo.py`** - Comprehensive demo showing all API features\n   - Basic conversation flow\n   - Conversation isolation testing\n   - Listing and retrieving conversations\n   - Pagination examples\n   - Shared memory demonstration\n\n2. **`conversations_cli.py`** - Interactive TUI for managing conversations\n   - Create\u002Fswitch between conversations\n   - Send messages with streaming responses\n   - View message history\n   - Switch between agents\n\n### Running the Examples\n\n```bash\n# Run the demo script\nLETTA_API_KEY=your-key uv run letta\u002Fconversations\u002Fscripts\u002Fconversations_demo.py\n\n# Run the interactive CLI\nLETTA_API_KEY=your-key uv run letta\u002Fconversations\u002Fscripts\u002Fconversations_cli.py\n\n# CLI with specific agent\nLETTA_API_KEY=your-key uv run letta\u002Fconversations\u002Fscripts\u002Fconversations_cli.py --agent agent-xxx\n```\n\n## SDK Gotchas\n\n- Paginated responses use `.items` to access the list: `client.agents.list().items`\n- Auth parameter is `api_key`, not `token`: `Letta(base_url=..., api_key=...)`\n- Message streams must be consumed (iterate or `list()`) to complete the request\n",{"data":36,"body":37},{"name":5,"description":7},{"type":38,"children":39},"root",[40,47,53,60,85,91,193,199,206,247,253,276,282,357,363,416,422,468,474,497,503,679,685,943,949,1004,1010,1016,1145,1151,1286,1292,1360,1366,1379,1461,1467,1611,1617,1679],{"type":41,"tag":42,"props":43,"children":44},"element","h1",{"id":4},[45],{"type":46,"value":5},"text",{"type":41,"tag":48,"props":49,"children":50},"p",{},[51],{"type":46,"value":52},"The Conversations API allows multiple isolated message threads on a single agent. Each conversation maintains its own message history while sharing the agent's memory blocks and tools.",{"type":41,"tag":54,"props":55,"children":57},"h2",{"id":56},"when-to-use-this-skill",[58],{"type":46,"value":59},"When to Use This Skill",{"type":41,"tag":61,"props":62,"children":63},"ul",{},[64,70,75,80],{"type":41,"tag":65,"props":66,"children":67},"li",{},[68],{"type":46,"value":69},"Building multi-user chat applications (each user gets their own conversation)",{"type":41,"tag":65,"props":71,"children":72},{},[73],{"type":46,"value":74},"Implementing session management with separate contexts",{"type":41,"tag":65,"props":76,"children":77},{},[78],{"type":46,"value":79},"A\u002FB testing agent responses across isolated conversations",{"type":41,"tag":65,"props":81,"children":82},{},[83],{"type":46,"value":84},"Any scenario where you need multiple independent chat threads with one agent",{"type":41,"tag":54,"props":86,"children":88},{"id":87},"key-concepts",[89],{"type":46,"value":90},"Key Concepts",{"type":41,"tag":92,"props":93,"children":94},"table",{},[95,114],{"type":41,"tag":96,"props":97,"children":98},"thead",{},[99],{"type":41,"tag":100,"props":101,"children":102},"tr",{},[103,109],{"type":41,"tag":104,"props":105,"children":106},"th",{},[107],{"type":46,"value":108},"Concept",{"type":41,"tag":104,"props":110,"children":111},{},[112],{"type":46,"value":113},"Description",{"type":41,"tag":115,"props":116,"children":117},"tbody",{},[118,145,161,177],{"type":41,"tag":100,"props":119,"children":120},{},[121,131],{"type":41,"tag":122,"props":123,"children":124},"td",{},[125],{"type":41,"tag":126,"props":127,"children":128},"strong",{},[129],{"type":46,"value":130},"Conversation",{"type":41,"tag":122,"props":132,"children":133},{},[134,136,143],{"type":46,"value":135},"An isolated message thread on an agent (",{"type":41,"tag":137,"props":138,"children":140},"code",{"className":139},[],[141],{"type":46,"value":142},"conv-xxx",{"type":46,"value":144}," ID)",{"type":41,"tag":100,"props":146,"children":147},{},[148,156],{"type":41,"tag":122,"props":149,"children":150},{},[151],{"type":41,"tag":126,"props":152,"children":153},{},[154],{"type":46,"value":155},"Isolation",{"type":41,"tag":122,"props":157,"children":158},{},[159],{"type":46,"value":160},"Each conversation has separate message history",{"type":41,"tag":100,"props":162,"children":163},{},[164,172],{"type":41,"tag":122,"props":165,"children":166},{},[167],{"type":41,"tag":126,"props":168,"children":169},{},[170],{"type":46,"value":171},"Shared State",{"type":41,"tag":122,"props":173,"children":174},{},[175],{"type":46,"value":176},"Memory blocks and tools are shared across conversations",{"type":41,"tag":100,"props":178,"children":179},{},[180,188],{"type":41,"tag":122,"props":181,"children":182},{},[183],{"type":41,"tag":126,"props":184,"children":185},{},[186],{"type":46,"value":187},"In-Context Messages",{"type":41,"tag":122,"props":189,"children":190},{},[191],{"type":46,"value":192},"Messages currently in the conversation's context window",{"type":41,"tag":54,"props":194,"children":196},{"id":195},"python-sdk-usage",[197],{"type":46,"value":198},"Python SDK Usage",{"type":41,"tag":200,"props":201,"children":203},"h3",{"id":202},"setup",[204],{"type":46,"value":205},"Setup",{"type":41,"tag":207,"props":208,"children":213},"pre",{"className":209,"code":210,"language":211,"meta":212,"style":212},"language-python shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","from letta_client import Letta\n\nclient = Letta(base_url=\"https:\u002F\u002Fapi.letta.com\", api_key=\"your-key\")\n","python","",[214],{"type":41,"tag":137,"props":215,"children":216},{"__ignoreMap":212},[217,228,238],{"type":41,"tag":218,"props":219,"children":222},"span",{"class":220,"line":221},"line",1,[223],{"type":41,"tag":218,"props":224,"children":225},{},[226],{"type":46,"value":227},"from letta_client import Letta\n",{"type":41,"tag":218,"props":229,"children":231},{"class":220,"line":230},2,[232],{"type":41,"tag":218,"props":233,"children":235},{"emptyLinePlaceholder":234},true,[236],{"type":46,"value":237},"\n",{"type":41,"tag":218,"props":239,"children":241},{"class":220,"line":240},3,[242],{"type":41,"tag":218,"props":243,"children":244},{},[245],{"type":46,"value":246},"client = Letta(base_url=\"https:\u002F\u002Fapi.letta.com\", api_key=\"your-key\")\n",{"type":41,"tag":200,"props":248,"children":250},{"id":249},"create-a-conversation",[251],{"type":46,"value":252},"Create a Conversation",{"type":41,"tag":207,"props":254,"children":256},{"className":209,"code":255,"language":211,"meta":212,"style":212},"conversation = client.conversations.create(agent_id=\"agent-xxx\")\n# conversation.id -> \"conv-xxx\"\n",[257],{"type":41,"tag":137,"props":258,"children":259},{"__ignoreMap":212},[260,268],{"type":41,"tag":218,"props":261,"children":262},{"class":220,"line":221},[263],{"type":41,"tag":218,"props":264,"children":265},{},[266],{"type":46,"value":267},"conversation = client.conversations.create(agent_id=\"agent-xxx\")\n",{"type":41,"tag":218,"props":269,"children":270},{"class":220,"line":230},[271],{"type":41,"tag":218,"props":272,"children":273},{},[274],{"type":46,"value":275},"# conversation.id -> \"conv-xxx\"\n",{"type":41,"tag":200,"props":277,"children":279},{"id":278},"send-messages-streaming",[280],{"type":46,"value":281},"Send Messages (Streaming)",{"type":41,"tag":207,"props":283,"children":285},{"className":209,"code":284,"language":211,"meta":212,"style":212},"stream = client.conversations.messages.create(\n    conversation_id=conversation.id,\n    messages=[{\"role\": \"user\", \"content\": \"Hello!\"}],\n)\n\nfor msg in stream:\n    if hasattr(msg, \"message_type\") and msg.message_type == \"assistant_message\":\n        print(msg.content)\n",[286],{"type":41,"tag":137,"props":287,"children":288},{"__ignoreMap":212},[289,297,305,313,322,330,339,348],{"type":41,"tag":218,"props":290,"children":291},{"class":220,"line":221},[292],{"type":41,"tag":218,"props":293,"children":294},{},[295],{"type":46,"value":296},"stream = client.conversations.messages.create(\n",{"type":41,"tag":218,"props":298,"children":299},{"class":220,"line":230},[300],{"type":41,"tag":218,"props":301,"children":302},{},[303],{"type":46,"value":304},"    conversation_id=conversation.id,\n",{"type":41,"tag":218,"props":306,"children":307},{"class":220,"line":240},[308],{"type":41,"tag":218,"props":309,"children":310},{},[311],{"type":46,"value":312},"    messages=[{\"role\": \"user\", \"content\": \"Hello!\"}],\n",{"type":41,"tag":218,"props":314,"children":316},{"class":220,"line":315},4,[317],{"type":41,"tag":218,"props":318,"children":319},{},[320],{"type":46,"value":321},")\n",{"type":41,"tag":218,"props":323,"children":325},{"class":220,"line":324},5,[326],{"type":41,"tag":218,"props":327,"children":328},{"emptyLinePlaceholder":234},[329],{"type":46,"value":237},{"type":41,"tag":218,"props":331,"children":333},{"class":220,"line":332},6,[334],{"type":41,"tag":218,"props":335,"children":336},{},[337],{"type":46,"value":338},"for msg in stream:\n",{"type":41,"tag":218,"props":340,"children":342},{"class":220,"line":341},7,[343],{"type":41,"tag":218,"props":344,"children":345},{},[346],{"type":46,"value":347},"    if hasattr(msg, \"message_type\") and msg.message_type == \"assistant_message\":\n",{"type":41,"tag":218,"props":349,"children":351},{"class":220,"line":350},8,[352],{"type":41,"tag":218,"props":353,"children":354},{},[355],{"type":46,"value":356},"        print(msg.content)\n",{"type":41,"tag":200,"props":358,"children":360},{"id":359},"list-messages-in-a-conversation",[361],{"type":46,"value":362},"List Messages in a Conversation",{"type":41,"tag":207,"props":364,"children":366},{"className":209,"code":365,"language":211,"meta":212,"style":212},"messages = client.conversations.messages.list(\n    conversation_id=conversation.id,\n    limit=50,  # Optional: default 100\n    after=\"message-xxx\",  # Optional: cursor for pagination\n    before=\"message-yyy\",  # Optional: cursor for pagination\n)\n",[367],{"type":41,"tag":137,"props":368,"children":369},{"__ignoreMap":212},[370,378,385,393,401,409],{"type":41,"tag":218,"props":371,"children":372},{"class":220,"line":221},[373],{"type":41,"tag":218,"props":374,"children":375},{},[376],{"type":46,"value":377},"messages = client.conversations.messages.list(\n",{"type":41,"tag":218,"props":379,"children":380},{"class":220,"line":230},[381],{"type":41,"tag":218,"props":382,"children":383},{},[384],{"type":46,"value":304},{"type":41,"tag":218,"props":386,"children":387},{"class":220,"line":240},[388],{"type":41,"tag":218,"props":389,"children":390},{},[391],{"type":46,"value":392},"    limit=50,  # Optional: default 100\n",{"type":41,"tag":218,"props":394,"children":395},{"class":220,"line":315},[396],{"type":41,"tag":218,"props":397,"children":398},{},[399],{"type":46,"value":400},"    after=\"message-xxx\",  # Optional: cursor for pagination\n",{"type":41,"tag":218,"props":402,"children":403},{"class":220,"line":324},[404],{"type":41,"tag":218,"props":405,"children":406},{},[407],{"type":46,"value":408},"    before=\"message-yyy\",  # Optional: cursor for pagination\n",{"type":41,"tag":218,"props":410,"children":411},{"class":220,"line":332},[412],{"type":41,"tag":218,"props":413,"children":414},{},[415],{"type":46,"value":321},{"type":41,"tag":200,"props":417,"children":419},{"id":418},"list-all-conversations-for-an-agent",[420],{"type":46,"value":421},"List All Conversations for an Agent",{"type":41,"tag":207,"props":423,"children":425},{"className":209,"code":424,"language":211,"meta":212,"style":212},"conversations = client.conversations.list(\n    agent_id=\"agent-xxx\",\n    limit=50,  # Optional\n    after=\"conv-xxx\",  # Optional: cursor for pagination\n)\n",[426],{"type":41,"tag":137,"props":427,"children":428},{"__ignoreMap":212},[429,437,445,453,461],{"type":41,"tag":218,"props":430,"children":431},{"class":220,"line":221},[432],{"type":41,"tag":218,"props":433,"children":434},{},[435],{"type":46,"value":436},"conversations = client.conversations.list(\n",{"type":41,"tag":218,"props":438,"children":439},{"class":220,"line":230},[440],{"type":41,"tag":218,"props":441,"children":442},{},[443],{"type":46,"value":444},"    agent_id=\"agent-xxx\",\n",{"type":41,"tag":218,"props":446,"children":447},{"class":220,"line":240},[448],{"type":41,"tag":218,"props":449,"children":450},{},[451],{"type":46,"value":452},"    limit=50,  # Optional\n",{"type":41,"tag":218,"props":454,"children":455},{"class":220,"line":315},[456],{"type":41,"tag":218,"props":457,"children":458},{},[459],{"type":46,"value":460},"    after=\"conv-xxx\",  # Optional: cursor for pagination\n",{"type":41,"tag":218,"props":462,"children":463},{"class":220,"line":324},[464],{"type":41,"tag":218,"props":465,"children":466},{},[467],{"type":46,"value":321},{"type":41,"tag":200,"props":469,"children":471},{"id":470},"retrieve-a-specific-conversation",[472],{"type":46,"value":473},"Retrieve a Specific Conversation",{"type":41,"tag":207,"props":475,"children":477},{"className":209,"code":476,"language":211,"meta":212,"style":212},"conv = client.conversations.retrieve(conversation_id=\"conv-xxx\")\n# conv.in_context_message_ids -> list of message IDs in context window\n",[478],{"type":41,"tag":137,"props":479,"children":480},{"__ignoreMap":212},[481,489],{"type":41,"tag":218,"props":482,"children":483},{"class":220,"line":221},[484],{"type":41,"tag":218,"props":485,"children":486},{},[487],{"type":46,"value":488},"conv = client.conversations.retrieve(conversation_id=\"conv-xxx\")\n",{"type":41,"tag":218,"props":490,"children":491},{"class":220,"line":230},[492],{"type":41,"tag":218,"props":493,"children":494},{},[495],{"type":46,"value":496},"# conv.in_context_message_ids -> list of message IDs in context window\n",{"type":41,"tag":54,"props":498,"children":500},{"id":499},"rest-api-endpoints",[501],{"type":46,"value":502},"REST API Endpoints",{"type":41,"tag":92,"props":504,"children":505},{},[506,526],{"type":41,"tag":96,"props":507,"children":508},{},[509],{"type":41,"tag":100,"props":510,"children":511},{},[512,517,522],{"type":41,"tag":104,"props":513,"children":514},{},[515],{"type":46,"value":516},"Method",{"type":41,"tag":104,"props":518,"children":519},{},[520],{"type":46,"value":521},"Endpoint",{"type":41,"tag":104,"props":523,"children":524},{},[525],{"type":46,"value":113},{"type":41,"tag":115,"props":527,"children":528},{},[529,555,580,605,630,654],{"type":41,"tag":100,"props":530,"children":531},{},[532,541,550],{"type":41,"tag":122,"props":533,"children":534},{},[535],{"type":41,"tag":137,"props":536,"children":538},{"className":537},[],[539],{"type":46,"value":540},"POST",{"type":41,"tag":122,"props":542,"children":543},{},[544],{"type":41,"tag":137,"props":545,"children":547},{"className":546},[],[548],{"type":46,"value":549},"\u002Fv1\u002Fconversations?agent_id=xxx",{"type":41,"tag":122,"props":551,"children":552},{},[553],{"type":46,"value":554},"Create a conversation",{"type":41,"tag":100,"props":556,"children":557},{},[558,567,575],{"type":41,"tag":122,"props":559,"children":560},{},[561],{"type":41,"tag":137,"props":562,"children":564},{"className":563},[],[565],{"type":46,"value":566},"GET",{"type":41,"tag":122,"props":568,"children":569},{},[570],{"type":41,"tag":137,"props":571,"children":573},{"className":572},[],[574],{"type":46,"value":549},{"type":41,"tag":122,"props":576,"children":577},{},[578],{"type":46,"value":579},"List conversations",{"type":41,"tag":100,"props":581,"children":582},{},[583,591,600],{"type":41,"tag":122,"props":584,"children":585},{},[586],{"type":41,"tag":137,"props":587,"children":589},{"className":588},[],[590],{"type":46,"value":566},{"type":41,"tag":122,"props":592,"children":593},{},[594],{"type":41,"tag":137,"props":595,"children":597},{"className":596},[],[598],{"type":46,"value":599},"\u002Fv1\u002Fconversations\u002F{conversation_id}",{"type":41,"tag":122,"props":601,"children":602},{},[603],{"type":46,"value":604},"Get a conversation",{"type":41,"tag":100,"props":606,"children":607},{},[608,616,625],{"type":41,"tag":122,"props":609,"children":610},{},[611],{"type":41,"tag":137,"props":612,"children":614},{"className":613},[],[615],{"type":46,"value":566},{"type":41,"tag":122,"props":617,"children":618},{},[619],{"type":41,"tag":137,"props":620,"children":622},{"className":621},[],[623],{"type":46,"value":624},"\u002Fv1\u002Fconversations\u002F{conversation_id}\u002Fmessages",{"type":41,"tag":122,"props":626,"children":627},{},[628],{"type":46,"value":629},"List messages",{"type":41,"tag":100,"props":631,"children":632},{},[633,641,649],{"type":41,"tag":122,"props":634,"children":635},{},[636],{"type":41,"tag":137,"props":637,"children":639},{"className":638},[],[640],{"type":46,"value":540},{"type":41,"tag":122,"props":642,"children":643},{},[644],{"type":41,"tag":137,"props":645,"children":647},{"className":646},[],[648],{"type":46,"value":624},{"type":41,"tag":122,"props":650,"children":651},{},[652],{"type":46,"value":653},"Send message (streams response)",{"type":41,"tag":100,"props":655,"children":656},{},[657,665,674],{"type":41,"tag":122,"props":658,"children":659},{},[660],{"type":41,"tag":137,"props":661,"children":663},{"className":662},[],[664],{"type":46,"value":540},{"type":41,"tag":122,"props":666,"children":667},{},[668],{"type":41,"tag":137,"props":669,"children":671},{"className":670},[],[672],{"type":46,"value":673},"\u002Fv1\u002Fconversations\u002F{conversation_id}\u002Fstream",{"type":41,"tag":122,"props":675,"children":676},{},[677],{"type":46,"value":678},"Resume a background stream",{"type":41,"tag":200,"props":680,"children":682},{"id":681},"rest-example-create-and-send-message",[683],{"type":46,"value":684},"REST Example: Create and Send Message",{"type":41,"tag":207,"props":686,"children":690},{"className":687,"code":688,"language":689,"meta":212,"style":212},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","# Create conversation\ncurl -X POST \"https:\u002F\u002Fapi.letta.com\u002Fv1\u002Fconversations?agent_id=agent-xxx\" \\\n  -H \"Authorization: Bearer $LETTA_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\"\n\n# Send message (streaming response)\ncurl -X POST \"https:\u002F\u002Fapi.letta.com\u002Fv1\u002Fconversations\u002Fconv-xxx\u002Fmessages\" \\\n  -H \"Authorization: Bearer $LETTA_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -H \"Accept: text\u002Fevent-stream\" \\\n  -d '{\"messages\": [{\"role\": \"user\", \"content\": \"Hello!\"}]}'\n","bash",[691],{"type":41,"tag":137,"props":692,"children":693},{"__ignoreMap":212},[694,703,745,775,796,803,811,843,870,894,919],{"type":41,"tag":218,"props":695,"children":696},{"class":220,"line":221},[697],{"type":41,"tag":218,"props":698,"children":700},{"style":699},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[701],{"type":46,"value":702},"# Create conversation\n",{"type":41,"tag":218,"props":704,"children":705},{"class":220,"line":230},[706,712,718,723,729,734,739],{"type":41,"tag":218,"props":707,"children":709},{"style":708},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[710],{"type":46,"value":711},"curl",{"type":41,"tag":218,"props":713,"children":715},{"style":714},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[716],{"type":46,"value":717}," -X",{"type":41,"tag":218,"props":719,"children":720},{"style":714},[721],{"type":46,"value":722}," POST",{"type":41,"tag":218,"props":724,"children":726},{"style":725},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[727],{"type":46,"value":728}," \"",{"type":41,"tag":218,"props":730,"children":731},{"style":714},[732],{"type":46,"value":733},"https:\u002F\u002Fapi.letta.com\u002Fv1\u002Fconversations?agent_id=agent-xxx",{"type":41,"tag":218,"props":735,"children":736},{"style":725},[737],{"type":46,"value":738},"\"",{"type":41,"tag":218,"props":740,"children":742},{"style":741},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[743],{"type":46,"value":744}," \\\n",{"type":41,"tag":218,"props":746,"children":747},{"class":220,"line":240},[748,753,757,762,767,771],{"type":41,"tag":218,"props":749,"children":750},{"style":714},[751],{"type":46,"value":752},"  -H",{"type":41,"tag":218,"props":754,"children":755},{"style":725},[756],{"type":46,"value":728},{"type":41,"tag":218,"props":758,"children":759},{"style":714},[760],{"type":46,"value":761},"Authorization: Bearer ",{"type":41,"tag":218,"props":763,"children":764},{"style":741},[765],{"type":46,"value":766},"$LETTA_API_KEY",{"type":41,"tag":218,"props":768,"children":769},{"style":725},[770],{"type":46,"value":738},{"type":41,"tag":218,"props":772,"children":773},{"style":741},[774],{"type":46,"value":744},{"type":41,"tag":218,"props":776,"children":777},{"class":220,"line":315},[778,782,786,791],{"type":41,"tag":218,"props":779,"children":780},{"style":714},[781],{"type":46,"value":752},{"type":41,"tag":218,"props":783,"children":784},{"style":725},[785],{"type":46,"value":728},{"type":41,"tag":218,"props":787,"children":788},{"style":714},[789],{"type":46,"value":790},"Content-Type: application\u002Fjson",{"type":41,"tag":218,"props":792,"children":793},{"style":725},[794],{"type":46,"value":795},"\"\n",{"type":41,"tag":218,"props":797,"children":798},{"class":220,"line":324},[799],{"type":41,"tag":218,"props":800,"children":801},{"emptyLinePlaceholder":234},[802],{"type":46,"value":237},{"type":41,"tag":218,"props":804,"children":805},{"class":220,"line":332},[806],{"type":41,"tag":218,"props":807,"children":808},{"style":699},[809],{"type":46,"value":810},"# Send message (streaming response)\n",{"type":41,"tag":218,"props":812,"children":813},{"class":220,"line":341},[814,818,822,826,830,835,839],{"type":41,"tag":218,"props":815,"children":816},{"style":708},[817],{"type":46,"value":711},{"type":41,"tag":218,"props":819,"children":820},{"style":714},[821],{"type":46,"value":717},{"type":41,"tag":218,"props":823,"children":824},{"style":714},[825],{"type":46,"value":722},{"type":41,"tag":218,"props":827,"children":828},{"style":725},[829],{"type":46,"value":728},{"type":41,"tag":218,"props":831,"children":832},{"style":714},[833],{"type":46,"value":834},"https:\u002F\u002Fapi.letta.com\u002Fv1\u002Fconversations\u002Fconv-xxx\u002Fmessages",{"type":41,"tag":218,"props":836,"children":837},{"style":725},[838],{"type":46,"value":738},{"type":41,"tag":218,"props":840,"children":841},{"style":741},[842],{"type":46,"value":744},{"type":41,"tag":218,"props":844,"children":845},{"class":220,"line":350},[846,850,854,858,862,866],{"type":41,"tag":218,"props":847,"children":848},{"style":714},[849],{"type":46,"value":752},{"type":41,"tag":218,"props":851,"children":852},{"style":725},[853],{"type":46,"value":728},{"type":41,"tag":218,"props":855,"children":856},{"style":714},[857],{"type":46,"value":761},{"type":41,"tag":218,"props":859,"children":860},{"style":741},[861],{"type":46,"value":766},{"type":41,"tag":218,"props":863,"children":864},{"style":725},[865],{"type":46,"value":738},{"type":41,"tag":218,"props":867,"children":868},{"style":741},[869],{"type":46,"value":744},{"type":41,"tag":218,"props":871,"children":873},{"class":220,"line":872},9,[874,878,882,886,890],{"type":41,"tag":218,"props":875,"children":876},{"style":714},[877],{"type":46,"value":752},{"type":41,"tag":218,"props":879,"children":880},{"style":725},[881],{"type":46,"value":728},{"type":41,"tag":218,"props":883,"children":884},{"style":714},[885],{"type":46,"value":790},{"type":41,"tag":218,"props":887,"children":888},{"style":725},[889],{"type":46,"value":738},{"type":41,"tag":218,"props":891,"children":892},{"style":741},[893],{"type":46,"value":744},{"type":41,"tag":218,"props":895,"children":897},{"class":220,"line":896},10,[898,902,906,911,915],{"type":41,"tag":218,"props":899,"children":900},{"style":714},[901],{"type":46,"value":752},{"type":41,"tag":218,"props":903,"children":904},{"style":725},[905],{"type":46,"value":728},{"type":41,"tag":218,"props":907,"children":908},{"style":714},[909],{"type":46,"value":910},"Accept: text\u002Fevent-stream",{"type":41,"tag":218,"props":912,"children":913},{"style":725},[914],{"type":46,"value":738},{"type":41,"tag":218,"props":916,"children":917},{"style":741},[918],{"type":46,"value":744},{"type":41,"tag":218,"props":920,"children":922},{"class":220,"line":921},11,[923,928,933,938],{"type":41,"tag":218,"props":924,"children":925},{"style":714},[926],{"type":46,"value":927},"  -d",{"type":41,"tag":218,"props":929,"children":930},{"style":725},[931],{"type":46,"value":932}," '",{"type":41,"tag":218,"props":934,"children":935},{"style":714},[936],{"type":46,"value":937},"{\"messages\": [{\"role\": \"user\", \"content\": \"Hello!\"}]}",{"type":41,"tag":218,"props":939,"children":940},{"style":725},[941],{"type":46,"value":942},"'\n",{"type":41,"tag":54,"props":944,"children":946},{"id":945},"conversation-schema",[947],{"type":46,"value":948},"Conversation Schema",{"type":41,"tag":207,"props":950,"children":952},{"className":209,"code":951,"language":211,"meta":212,"style":212},"class Conversation:\n    id: str                      # \"conv-xxx\"\n    agent_id: str                # Associated agent ID\n    created_at: datetime         # Creation timestamp\n    summary: Optional[str]       # Optional conversation summary\n    in_context_message_ids: List[str]  # Message IDs in context window\n",[953],{"type":41,"tag":137,"props":954,"children":955},{"__ignoreMap":212},[956,964,972,980,988,996],{"type":41,"tag":218,"props":957,"children":958},{"class":220,"line":221},[959],{"type":41,"tag":218,"props":960,"children":961},{},[962],{"type":46,"value":963},"class Conversation:\n",{"type":41,"tag":218,"props":965,"children":966},{"class":220,"line":230},[967],{"type":41,"tag":218,"props":968,"children":969},{},[970],{"type":46,"value":971},"    id: str                      # \"conv-xxx\"\n",{"type":41,"tag":218,"props":973,"children":974},{"class":220,"line":240},[975],{"type":41,"tag":218,"props":976,"children":977},{},[978],{"type":46,"value":979},"    agent_id: str                # Associated agent ID\n",{"type":41,"tag":218,"props":981,"children":982},{"class":220,"line":315},[983],{"type":41,"tag":218,"props":984,"children":985},{},[986],{"type":46,"value":987},"    created_at: datetime         # Creation timestamp\n",{"type":41,"tag":218,"props":989,"children":990},{"class":220,"line":324},[991],{"type":41,"tag":218,"props":992,"children":993},{},[994],{"type":46,"value":995},"    summary: Optional[str]       # Optional conversation summary\n",{"type":41,"tag":218,"props":997,"children":998},{"class":220,"line":332},[999],{"type":41,"tag":218,"props":1000,"children":1001},{},[1002],{"type":46,"value":1003},"    in_context_message_ids: List[str]  # Message IDs in context window\n",{"type":41,"tag":54,"props":1005,"children":1007},{"id":1006},"common-patterns",[1008],{"type":46,"value":1009},"Common Patterns",{"type":41,"tag":200,"props":1011,"children":1013},{"id":1012},"multi-user-chat-application",[1014],{"type":46,"value":1015},"Multi-User Chat Application",{"type":41,"tag":207,"props":1017,"children":1019},{"className":209,"code":1018,"language":211,"meta":212,"style":212},"# Each user gets their own conversation\nuser_conversations = {}\n\ndef get_or_create_conversation(user_id: str, agent_id: str) -> str:\n    if user_id not in user_conversations:\n        conv = client.conversations.create(agent_id=agent_id)\n        user_conversations[user_id] = conv.id\n    return user_conversations[user_id]\n\ndef send_user_message(user_id: str, agent_id: str, message: str):\n    conv_id = get_or_create_conversation(user_id, agent_id)\n    return client.conversations.messages.create(\n        conversation_id=conv_id,\n        messages=[{\"role\": \"user\", \"content\": message}],\n    )\n",[1020],{"type":41,"tag":137,"props":1021,"children":1022},{"__ignoreMap":212},[1023,1031,1039,1046,1054,1062,1070,1078,1086,1093,1101,1109,1118,1127,1136],{"type":41,"tag":218,"props":1024,"children":1025},{"class":220,"line":221},[1026],{"type":41,"tag":218,"props":1027,"children":1028},{},[1029],{"type":46,"value":1030},"# Each user gets their own conversation\n",{"type":41,"tag":218,"props":1032,"children":1033},{"class":220,"line":230},[1034],{"type":41,"tag":218,"props":1035,"children":1036},{},[1037],{"type":46,"value":1038},"user_conversations = {}\n",{"type":41,"tag":218,"props":1040,"children":1041},{"class":220,"line":240},[1042],{"type":41,"tag":218,"props":1043,"children":1044},{"emptyLinePlaceholder":234},[1045],{"type":46,"value":237},{"type":41,"tag":218,"props":1047,"children":1048},{"class":220,"line":315},[1049],{"type":41,"tag":218,"props":1050,"children":1051},{},[1052],{"type":46,"value":1053},"def get_or_create_conversation(user_id: str, agent_id: str) -> str:\n",{"type":41,"tag":218,"props":1055,"children":1056},{"class":220,"line":324},[1057],{"type":41,"tag":218,"props":1058,"children":1059},{},[1060],{"type":46,"value":1061},"    if user_id not in user_conversations:\n",{"type":41,"tag":218,"props":1063,"children":1064},{"class":220,"line":332},[1065],{"type":41,"tag":218,"props":1066,"children":1067},{},[1068],{"type":46,"value":1069},"        conv = client.conversations.create(agent_id=agent_id)\n",{"type":41,"tag":218,"props":1071,"children":1072},{"class":220,"line":341},[1073],{"type":41,"tag":218,"props":1074,"children":1075},{},[1076],{"type":46,"value":1077},"        user_conversations[user_id] = conv.id\n",{"type":41,"tag":218,"props":1079,"children":1080},{"class":220,"line":350},[1081],{"type":41,"tag":218,"props":1082,"children":1083},{},[1084],{"type":46,"value":1085},"    return user_conversations[user_id]\n",{"type":41,"tag":218,"props":1087,"children":1088},{"class":220,"line":872},[1089],{"type":41,"tag":218,"props":1090,"children":1091},{"emptyLinePlaceholder":234},[1092],{"type":46,"value":237},{"type":41,"tag":218,"props":1094,"children":1095},{"class":220,"line":896},[1096],{"type":41,"tag":218,"props":1097,"children":1098},{},[1099],{"type":46,"value":1100},"def send_user_message(user_id: str, agent_id: str, message: str):\n",{"type":41,"tag":218,"props":1102,"children":1103},{"class":220,"line":921},[1104],{"type":41,"tag":218,"props":1105,"children":1106},{},[1107],{"type":46,"value":1108},"    conv_id = get_or_create_conversation(user_id, agent_id)\n",{"type":41,"tag":218,"props":1110,"children":1112},{"class":220,"line":1111},12,[1113],{"type":41,"tag":218,"props":1114,"children":1115},{},[1116],{"type":46,"value":1117},"    return client.conversations.messages.create(\n",{"type":41,"tag":218,"props":1119,"children":1121},{"class":220,"line":1120},13,[1122],{"type":41,"tag":218,"props":1123,"children":1124},{},[1125],{"type":46,"value":1126},"        conversation_id=conv_id,\n",{"type":41,"tag":218,"props":1128,"children":1130},{"class":220,"line":1129},14,[1131],{"type":41,"tag":218,"props":1132,"children":1133},{},[1134],{"type":46,"value":1135},"        messages=[{\"role\": \"user\", \"content\": message}],\n",{"type":41,"tag":218,"props":1137,"children":1139},{"class":220,"line":1138},15,[1140],{"type":41,"tag":218,"props":1141,"children":1142},{},[1143],{"type":46,"value":1144},"    )\n",{"type":41,"tag":200,"props":1146,"children":1148},{"id":1147},"paginating-through-message-history",[1149],{"type":46,"value":1150},"Paginating Through Message History",{"type":41,"tag":207,"props":1152,"children":1154},{"className":209,"code":1153,"language":211,"meta":212,"style":212},"def get_all_messages(conversation_id: str):\n    all_messages = []\n    after = None\n    \n    while True:\n        batch = client.conversations.messages.list(\n            conversation_id=conversation_id,\n            limit=100,\n            after=after,\n        )\n        if not batch:\n            break\n        all_messages.extend(batch)\n        after = batch[-1].id\n    \n    return all_messages\n",[1155],{"type":41,"tag":137,"props":1156,"children":1157},{"__ignoreMap":212},[1158,1166,1174,1182,1190,1198,1206,1214,1222,1230,1238,1246,1254,1262,1270,1277],{"type":41,"tag":218,"props":1159,"children":1160},{"class":220,"line":221},[1161],{"type":41,"tag":218,"props":1162,"children":1163},{},[1164],{"type":46,"value":1165},"def get_all_messages(conversation_id: str):\n",{"type":41,"tag":218,"props":1167,"children":1168},{"class":220,"line":230},[1169],{"type":41,"tag":218,"props":1170,"children":1171},{},[1172],{"type":46,"value":1173},"    all_messages = []\n",{"type":41,"tag":218,"props":1175,"children":1176},{"class":220,"line":240},[1177],{"type":41,"tag":218,"props":1178,"children":1179},{},[1180],{"type":46,"value":1181},"    after = None\n",{"type":41,"tag":218,"props":1183,"children":1184},{"class":220,"line":315},[1185],{"type":41,"tag":218,"props":1186,"children":1187},{},[1188],{"type":46,"value":1189},"    \n",{"type":41,"tag":218,"props":1191,"children":1192},{"class":220,"line":324},[1193],{"type":41,"tag":218,"props":1194,"children":1195},{},[1196],{"type":46,"value":1197},"    while True:\n",{"type":41,"tag":218,"props":1199,"children":1200},{"class":220,"line":332},[1201],{"type":41,"tag":218,"props":1202,"children":1203},{},[1204],{"type":46,"value":1205},"        batch = client.conversations.messages.list(\n",{"type":41,"tag":218,"props":1207,"children":1208},{"class":220,"line":341},[1209],{"type":41,"tag":218,"props":1210,"children":1211},{},[1212],{"type":46,"value":1213},"            conversation_id=conversation_id,\n",{"type":41,"tag":218,"props":1215,"children":1216},{"class":220,"line":350},[1217],{"type":41,"tag":218,"props":1218,"children":1219},{},[1220],{"type":46,"value":1221},"            limit=100,\n",{"type":41,"tag":218,"props":1223,"children":1224},{"class":220,"line":872},[1225],{"type":41,"tag":218,"props":1226,"children":1227},{},[1228],{"type":46,"value":1229},"            after=after,\n",{"type":41,"tag":218,"props":1231,"children":1232},{"class":220,"line":896},[1233],{"type":41,"tag":218,"props":1234,"children":1235},{},[1236],{"type":46,"value":1237},"        )\n",{"type":41,"tag":218,"props":1239,"children":1240},{"class":220,"line":921},[1241],{"type":41,"tag":218,"props":1242,"children":1243},{},[1244],{"type":46,"value":1245},"        if not batch:\n",{"type":41,"tag":218,"props":1247,"children":1248},{"class":220,"line":1111},[1249],{"type":41,"tag":218,"props":1250,"children":1251},{},[1252],{"type":46,"value":1253},"            break\n",{"type":41,"tag":218,"props":1255,"children":1256},{"class":220,"line":1120},[1257],{"type":41,"tag":218,"props":1258,"children":1259},{},[1260],{"type":46,"value":1261},"        all_messages.extend(batch)\n",{"type":41,"tag":218,"props":1263,"children":1264},{"class":220,"line":1129},[1265],{"type":41,"tag":218,"props":1266,"children":1267},{},[1268],{"type":46,"value":1269},"        after = batch[-1].id\n",{"type":41,"tag":218,"props":1271,"children":1272},{"class":220,"line":1138},[1273],{"type":41,"tag":218,"props":1274,"children":1275},{},[1276],{"type":46,"value":1189},{"type":41,"tag":218,"props":1278,"children":1280},{"class":220,"line":1279},16,[1281],{"type":41,"tag":218,"props":1282,"children":1283},{},[1284],{"type":46,"value":1285},"    return all_messages\n",{"type":41,"tag":54,"props":1287,"children":1289},{"id":1288},"important-notes",[1290],{"type":46,"value":1291},"Important Notes",{"type":41,"tag":1293,"props":1294,"children":1295},"ol",{},[1296,1314,1324,1334],{"type":41,"tag":65,"props":1297,"children":1298},{},[1299,1304,1306,1312],{"type":41,"tag":126,"props":1300,"children":1301},{},[1302],{"type":46,"value":1303},"Streaming by default",{"type":46,"value":1305},": The ",{"type":41,"tag":137,"props":1307,"children":1309},{"className":1308},[],[1310],{"type":46,"value":1311},"messages.create",{"type":46,"value":1313}," endpoint always streams responses",{"type":41,"tag":65,"props":1315,"children":1316},{},[1317,1322],{"type":41,"tag":126,"props":1318,"children":1319},{},[1320],{"type":46,"value":1321},"Shared memory",{"type":46,"value":1323},": Memory block updates in one conversation are visible in all conversations for that agent",{"type":41,"tag":65,"props":1325,"children":1326},{},[1327,1332],{"type":41,"tag":126,"props":1328,"children":1329},{},[1330],{"type":46,"value":1331},"Message isolation",{"type":46,"value":1333},": Conversation message history is completely isolated between conversations",{"type":41,"tag":65,"props":1335,"children":1336},{},[1337,1342,1344,1350,1352,1358],{"type":41,"tag":126,"props":1338,"children":1339},{},[1340],{"type":46,"value":1341},"Pagination",{"type":46,"value":1343},": Use ",{"type":41,"tag":137,"props":1345,"children":1347},{"className":1346},[],[1348],{"type":46,"value":1349},"after",{"type":46,"value":1351},"\u002F",{"type":41,"tag":137,"props":1353,"children":1355},{"className":1354},[],[1356],{"type":46,"value":1357},"before",{"type":46,"value":1359}," cursors for efficient pagination, not offsets",{"type":41,"tag":54,"props":1361,"children":1363},{"id":1362},"example-scripts",[1364],{"type":46,"value":1365},"Example Scripts",{"type":41,"tag":48,"props":1367,"children":1368},{},[1369,1371,1377],{"type":46,"value":1370},"This skill includes two example scripts in the ",{"type":41,"tag":137,"props":1372,"children":1374},{"className":1373},[],[1375],{"type":46,"value":1376},"scripts\u002F",{"type":46,"value":1378}," directory:",{"type":41,"tag":1293,"props":1380,"children":1381},{},[1382,1424],{"type":41,"tag":65,"props":1383,"children":1384},{},[1385,1394,1396],{"type":41,"tag":126,"props":1386,"children":1387},{},[1388],{"type":41,"tag":137,"props":1389,"children":1391},{"className":1390},[],[1392],{"type":46,"value":1393},"conversations_demo.py",{"type":46,"value":1395}," - Comprehensive demo showing all API features",{"type":41,"tag":61,"props":1397,"children":1398},{},[1399,1404,1409,1414,1419],{"type":41,"tag":65,"props":1400,"children":1401},{},[1402],{"type":46,"value":1403},"Basic conversation flow",{"type":41,"tag":65,"props":1405,"children":1406},{},[1407],{"type":46,"value":1408},"Conversation isolation testing",{"type":41,"tag":65,"props":1410,"children":1411},{},[1412],{"type":46,"value":1413},"Listing and retrieving conversations",{"type":41,"tag":65,"props":1415,"children":1416},{},[1417],{"type":46,"value":1418},"Pagination examples",{"type":41,"tag":65,"props":1420,"children":1421},{},[1422],{"type":46,"value":1423},"Shared memory demonstration",{"type":41,"tag":65,"props":1425,"children":1426},{},[1427,1436,1438],{"type":41,"tag":126,"props":1428,"children":1429},{},[1430],{"type":41,"tag":137,"props":1431,"children":1433},{"className":1432},[],[1434],{"type":46,"value":1435},"conversations_cli.py",{"type":46,"value":1437}," - Interactive TUI for managing conversations",{"type":41,"tag":61,"props":1439,"children":1440},{},[1441,1446,1451,1456],{"type":41,"tag":65,"props":1442,"children":1443},{},[1444],{"type":46,"value":1445},"Create\u002Fswitch between conversations",{"type":41,"tag":65,"props":1447,"children":1448},{},[1449],{"type":46,"value":1450},"Send messages with streaming responses",{"type":41,"tag":65,"props":1452,"children":1453},{},[1454],{"type":46,"value":1455},"View message history",{"type":41,"tag":65,"props":1457,"children":1458},{},[1459],{"type":46,"value":1460},"Switch between agents",{"type":41,"tag":200,"props":1462,"children":1464},{"id":1463},"running-the-examples",[1465],{"type":46,"value":1466},"Running the Examples",{"type":41,"tag":207,"props":1468,"children":1470},{"className":687,"code":1469,"language":689,"meta":212,"style":212},"# Run the demo script\nLETTA_API_KEY=your-key uv run letta\u002Fconversations\u002Fscripts\u002Fconversations_demo.py\n\n# Run the interactive CLI\nLETTA_API_KEY=your-key uv run letta\u002Fconversations\u002Fscripts\u002Fconversations_cli.py\n\n# CLI with specific agent\nLETTA_API_KEY=your-key uv run letta\u002Fconversations\u002Fscripts\u002Fconversations_cli.py --agent agent-xxx\n",[1471],{"type":41,"tag":137,"props":1472,"children":1473},{"__ignoreMap":212},[1474,1482,1515,1522,1530,1558,1565,1573],{"type":41,"tag":218,"props":1475,"children":1476},{"class":220,"line":221},[1477],{"type":41,"tag":218,"props":1478,"children":1479},{"style":699},[1480],{"type":46,"value":1481},"# Run the demo script\n",{"type":41,"tag":218,"props":1483,"children":1484},{"class":220,"line":230},[1485,1490,1495,1500,1505,1510],{"type":41,"tag":218,"props":1486,"children":1487},{"style":741},[1488],{"type":46,"value":1489},"LETTA_API_KEY",{"type":41,"tag":218,"props":1491,"children":1492},{"style":725},[1493],{"type":46,"value":1494},"=",{"type":41,"tag":218,"props":1496,"children":1497},{"style":714},[1498],{"type":46,"value":1499},"your-key",{"type":41,"tag":218,"props":1501,"children":1502},{"style":708},[1503],{"type":46,"value":1504}," uv",{"type":41,"tag":218,"props":1506,"children":1507},{"style":714},[1508],{"type":46,"value":1509}," run",{"type":41,"tag":218,"props":1511,"children":1512},{"style":714},[1513],{"type":46,"value":1514}," letta\u002Fconversations\u002Fscripts\u002Fconversations_demo.py\n",{"type":41,"tag":218,"props":1516,"children":1517},{"class":220,"line":240},[1518],{"type":41,"tag":218,"props":1519,"children":1520},{"emptyLinePlaceholder":234},[1521],{"type":46,"value":237},{"type":41,"tag":218,"props":1523,"children":1524},{"class":220,"line":315},[1525],{"type":41,"tag":218,"props":1526,"children":1527},{"style":699},[1528],{"type":46,"value":1529},"# Run the interactive CLI\n",{"type":41,"tag":218,"props":1531,"children":1532},{"class":220,"line":324},[1533,1537,1541,1545,1549,1553],{"type":41,"tag":218,"props":1534,"children":1535},{"style":741},[1536],{"type":46,"value":1489},{"type":41,"tag":218,"props":1538,"children":1539},{"style":725},[1540],{"type":46,"value":1494},{"type":41,"tag":218,"props":1542,"children":1543},{"style":714},[1544],{"type":46,"value":1499},{"type":41,"tag":218,"props":1546,"children":1547},{"style":708},[1548],{"type":46,"value":1504},{"type":41,"tag":218,"props":1550,"children":1551},{"style":714},[1552],{"type":46,"value":1509},{"type":41,"tag":218,"props":1554,"children":1555},{"style":714},[1556],{"type":46,"value":1557}," letta\u002Fconversations\u002Fscripts\u002Fconversations_cli.py\n",{"type":41,"tag":218,"props":1559,"children":1560},{"class":220,"line":332},[1561],{"type":41,"tag":218,"props":1562,"children":1563},{"emptyLinePlaceholder":234},[1564],{"type":46,"value":237},{"type":41,"tag":218,"props":1566,"children":1567},{"class":220,"line":341},[1568],{"type":41,"tag":218,"props":1569,"children":1570},{"style":699},[1571],{"type":46,"value":1572},"# CLI with specific agent\n",{"type":41,"tag":218,"props":1574,"children":1575},{"class":220,"line":350},[1576,1580,1584,1588,1592,1596,1601,1606],{"type":41,"tag":218,"props":1577,"children":1578},{"style":741},[1579],{"type":46,"value":1489},{"type":41,"tag":218,"props":1581,"children":1582},{"style":725},[1583],{"type":46,"value":1494},{"type":41,"tag":218,"props":1585,"children":1586},{"style":714},[1587],{"type":46,"value":1499},{"type":41,"tag":218,"props":1589,"children":1590},{"style":708},[1591],{"type":46,"value":1504},{"type":41,"tag":218,"props":1593,"children":1594},{"style":714},[1595],{"type":46,"value":1509},{"type":41,"tag":218,"props":1597,"children":1598},{"style":714},[1599],{"type":46,"value":1600}," letta\u002Fconversations\u002Fscripts\u002Fconversations_cli.py",{"type":41,"tag":218,"props":1602,"children":1603},{"style":714},[1604],{"type":46,"value":1605}," --agent",{"type":41,"tag":218,"props":1607,"children":1608},{"style":714},[1609],{"type":46,"value":1610}," agent-xxx\n",{"type":41,"tag":54,"props":1612,"children":1614},{"id":1613},"sdk-gotchas",[1615],{"type":46,"value":1616},"SDK Gotchas",{"type":41,"tag":61,"props":1618,"children":1619},{},[1620,1639,1666],{"type":41,"tag":65,"props":1621,"children":1622},{},[1623,1625,1631,1633],{"type":46,"value":1624},"Paginated responses use ",{"type":41,"tag":137,"props":1626,"children":1628},{"className":1627},[],[1629],{"type":46,"value":1630},".items",{"type":46,"value":1632}," to access the list: ",{"type":41,"tag":137,"props":1634,"children":1636},{"className":1635},[],[1637],{"type":46,"value":1638},"client.agents.list().items",{"type":41,"tag":65,"props":1640,"children":1641},{},[1642,1644,1650,1652,1658,1660],{"type":46,"value":1643},"Auth parameter is ",{"type":41,"tag":137,"props":1645,"children":1647},{"className":1646},[],[1648],{"type":46,"value":1649},"api_key",{"type":46,"value":1651},", not ",{"type":41,"tag":137,"props":1653,"children":1655},{"className":1654},[],[1656],{"type":46,"value":1657},"token",{"type":46,"value":1659},": ",{"type":41,"tag":137,"props":1661,"children":1663},{"className":1662},[],[1664],{"type":46,"value":1665},"Letta(base_url=..., api_key=...)",{"type":41,"tag":65,"props":1667,"children":1668},{},[1669,1671,1677],{"type":46,"value":1670},"Message streams must be consumed (iterate or ",{"type":41,"tag":137,"props":1672,"children":1674},{"className":1673},[],[1675],{"type":46,"value":1676},"list()",{"type":46,"value":1678},") to complete the request",{"type":41,"tag":1680,"props":1681,"children":1682},"style",{},[1683],{"type":46,"value":1684},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":1686,"total":1845},[1687,1703,1718,1730,1742,1756,1768,1779,1791,1807,1818,1830],{"slug":1688,"name":1688,"fn":1689,"description":1690,"org":1691,"tags":1692,"stars":1700,"repoUrl":1701,"updatedAt":1702},"acquiring-skills","discover and install agent skills","Discover and install skills from Hermes, ClawHub, GitHub, and other registries. Load this skill whenever a user asks for a capability you don't already have — image generation, social media, email, calendar, finance, DevOps, search, browser automation, etc.",{"slug":9,"name":10,"logoUrl":11,"githubOrg":12},[1693,1694,1697],{"name":19,"slug":20,"type":17},{"name":1695,"slug":1696,"type":17},"Automation","automation",{"name":1698,"slug":1699,"type":17},"GitHub","github",2831,"https:\u002F\u002Fgithub.com\u002Fletta-ai\u002Fletta-code","2026-07-13T06:22:58.45767",{"slug":1704,"name":1705,"fn":1706,"description":1707,"org":1708,"tags":1709,"stars":1700,"repoUrl":1701,"updatedAt":1717},"context-doctor","Context Doctor","repair system prompt and memory degradation","Identify and repair degradation in system prompt, external memory, and skills preventing you from following instructions or remembering information as well as you should.",{"slug":9,"name":10,"logoUrl":11,"githubOrg":12},[1710,1711,1714],{"name":19,"slug":20,"type":17},{"name":1712,"slug":1713,"type":17},"AI Context","ai-context",{"name":1715,"slug":1716,"type":17},"Debugging","debugging","2026-07-13T06:22:50.151002",{"slug":1719,"name":1719,"fn":1720,"description":1721,"org":1722,"tags":1723,"stars":1700,"repoUrl":1701,"updatedAt":1729},"converting-mcps-to-skills","connect MCP servers to create skills","Connect to MCP (Model Context Protocol) servers and create skills for repeated use. Load when a user wants to use an MCP server, connect to external tools via MCP, or when they mention MCP, model context protocol, or specific MCP servers.",{"slug":9,"name":10,"logoUrl":11,"githubOrg":12},[1724,1725,1726],{"name":19,"slug":20,"type":17},{"name":1695,"slug":1696,"type":17},{"name":1727,"slug":1728,"type":17},"MCP","mcp","2026-07-13T06:23:37.646079",{"slug":1731,"name":1731,"fn":1732,"description":1733,"org":1734,"tags":1735,"stars":1700,"repoUrl":1701,"updatedAt":1741},"creating-mods","create and edit Letta Code mods","Creates and edits trusted local Letta Code mods, including tools, slash commands, local-only model providers, lifecycle\u002Fturn events, scoped conversation helpers, panels, and capability-gated behavior. Use when asked to make a mod, add an agent-callable tool, add a slash command, add a local provider\u002Fmodel adapter, transform turns, react to app events, or add lightweight mod UI outside the dedicated \u002Fstatusline flow.",{"slug":9,"name":10,"logoUrl":11,"githubOrg":12},[1736,1737,1738],{"name":19,"slug":20,"type":17},{"name":1695,"slug":1696,"type":17},{"name":1739,"slug":1740,"type":17},"Coding","coding","2026-07-23T05:42:38.133565",{"slug":1743,"name":1743,"fn":1744,"description":1745,"org":1746,"tags":1747,"stars":1700,"repoUrl":1701,"updatedAt":1755},"creating-skills","create and update agent skills","Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Letta Code's capabilities with specialized knowledge, workflows, or tool integrations.",{"slug":9,"name":10,"logoUrl":11,"githubOrg":12},[1748,1749,1752],{"name":19,"slug":20,"type":17},{"name":1750,"slug":1751,"type":17},"Documentation","documentation",{"name":1753,"slug":1754,"type":17},"Plugin Development","plugin-development","2026-07-13T06:22:56.998659",{"slug":1757,"name":1757,"fn":1758,"description":1759,"org":1760,"tags":1761,"stars":1700,"repoUrl":1701,"updatedAt":1767},"customizing-commands","create and manage Letta slash commands","Creates, edits, and enables Letta Code mod-provided slash commands. Use when the user asks to add a custom \u002Fcommand, slash command, command shortcut, scoped conversation-backed command, or command-driven panel behavior.",{"slug":9,"name":10,"logoUrl":11,"githubOrg":12},[1762,1763,1764],{"name":19,"slug":20,"type":17},{"name":1695,"slug":1696,"type":17},{"name":1765,"slug":1766,"type":17},"CLI","cli","2026-07-13T06:23:18.266798",{"slug":1769,"name":1769,"fn":1770,"description":1771,"org":1772,"tags":1773,"stars":1700,"repoUrl":1701,"updatedAt":1778},"customizing-statusline","customize Letta Code statusline mods","Creates, edits, and migrates Letta Code statusline mods. Use when handling the \u002Fstatusline command or continuing work started by \u002Fstatusline.",{"slug":9,"name":10,"logoUrl":11,"githubOrg":12},[1774,1775],{"name":1765,"slug":1766,"type":17},{"name":1776,"slug":1777,"type":17},"Engineering","engineering","2026-07-13T06:23:27.465985",{"slug":1780,"name":1780,"fn":1781,"description":1782,"org":1783,"tags":1784,"stars":1700,"repoUrl":1701,"updatedAt":1790},"dispatching-coding-agents","dispatch stateless coding agents","Dispatch stateless coding agents (Claude Code or Codex) via Bash. Use when you're stuck, need a second opinion, or need parallel research on a hard problem. They have no memory — you must provide all context.",{"slug":9,"name":10,"logoUrl":11,"githubOrg":12},[1785,1786,1787],{"name":19,"slug":20,"type":17},{"name":1739,"slug":1740,"type":17},{"name":1788,"slug":1789,"type":17},"Multi-Agent","multi-agent","2026-07-26T05:46:56.388845",{"slug":1792,"name":1792,"fn":1793,"description":1794,"org":1795,"tags":1796,"stars":1700,"repoUrl":1701,"updatedAt":1806},"editing-letta-code-desktop-preferences","edit Letta Code Desktop preferences","Edits Letta Code Desktop (LCD) preferences by safely reading and updating ~\u002F.letta\u002Fdesktop_preferences.json. Use only when the user asks to change current Desktop\u002FLCD settings such as theme, default working directory, remote access preference, or remote environment name via the preferences JSON.",{"slug":9,"name":10,"logoUrl":11,"githubOrg":12},[1797,1800,1803],{"name":1798,"slug":1799,"type":17},"Configuration","configuration",{"name":1801,"slug":1802,"type":17},"Desktop","desktop",{"name":1804,"slug":1805,"type":17},"Themes","themes","2026-07-13T06:23:41.407811",{"slug":1808,"name":1808,"fn":1809,"description":1810,"org":1811,"tags":1812,"stars":1700,"repoUrl":1701,"updatedAt":1817},"finding-agents","locate and manage agents on server","Find other agents on the same server. Use when the user asks about other agents, wants to migrate memory from another agent, or needs to find an agent by name or tags.",{"slug":9,"name":10,"logoUrl":11,"githubOrg":12},[1813,1814],{"name":19,"slug":20,"type":17},{"name":1815,"slug":1816,"type":17},"Management","management","2026-07-16T06:02:17.297841",{"slug":1819,"name":1819,"fn":1820,"description":1821,"org":1822,"tags":1823,"stars":1700,"repoUrl":1701,"updatedAt":1829},"generating-mod-envs","generate Letta mod learning environments","Generates and reviews mod learning env JSON files for Letta Code local mods. Use when asked to teach, learn, or optimize a mod behavior; create, draft, validate, improve, or explain envs for `\u002Fmods learn --env`; or design evaluation scenarios, memory fixtures, requiredResultMarkers, requiredTraceMarkers, negative controls, and candidate diversity hints.",{"slug":9,"name":10,"logoUrl":11,"githubOrg":12},[1824,1825,1828],{"name":19,"slug":20,"type":17},{"name":1826,"slug":1827,"type":17},"AI Infrastructure","ai-infrastructure",{"name":1798,"slug":1799,"type":17},"2026-07-13T06:23:08.838181",{"slug":1831,"name":1831,"fn":1832,"description":1833,"org":1834,"tags":1835,"stars":1700,"repoUrl":1701,"updatedAt":1844},"image-generation","generate images from text prompts","Generate images from text prompts (and optionally edit\u002Fremix input images). Use when the user asks to create, generate, draw, render, or edit an image, illustration, logo, icon, diagram, or photo.",{"slug":9,"name":10,"logoUrl":11,"githubOrg":12},[1836,1839,1842],{"name":1837,"slug":1838,"type":17},"Creative","creative",{"name":1840,"slug":1841,"type":17},"Graphics","graphics",{"name":1843,"slug":1831,"type":17},"Image Generation","2026-07-13T06:23:06.189403",69,{"items":1847,"total":1957},[1848,1862,1877,1896,1907,1928,1938],{"slug":1849,"name":1849,"fn":1850,"description":1851,"org":1852,"tags":1853,"stars":24,"repoUrl":25,"updatedAt":1861},"1password","manage secrets with 1Password CLI","Set up and use 1Password CLI (op). Use when installing the CLI, enabling desktop app integration, signing in (single or multi-account), or reading\u002Finjecting\u002Frunning secrets via op.",{"slug":9,"name":10,"logoUrl":11,"githubOrg":12},[1854,1857,1858],{"name":1855,"slug":1856,"type":17},"Authentication","authentication",{"name":1765,"slug":1766,"type":17},{"name":1859,"slug":1860,"type":17},"Security","security","2026-07-13T06:24:39.504387",{"slug":1863,"name":1863,"fn":1864,"description":1865,"org":1866,"tags":1867,"stars":24,"repoUrl":25,"updatedAt":1876},"agent-slack","automate Slack messaging and workflows","Slack automation CLI — read\u002Fsend\u002Fsearch messages, browse threads and channels, manage channels, download attachments, look up users, and run workflows.",{"slug":9,"name":10,"logoUrl":11,"githubOrg":12},[1868,1869,1870,1873],{"name":1695,"slug":1696,"type":17},{"name":1765,"slug":1766,"type":17},{"name":1871,"slug":1872,"type":17},"Messaging","messaging",{"name":1874,"slug":1875,"type":17},"Slack","slack","2026-07-13T06:23:51.908511",{"slug":1878,"name":1878,"fn":1879,"description":1880,"org":1881,"tags":1882,"stars":24,"repoUrl":25,"updatedAt":1895},"ai-news","fetch and summarize AI news","Fetch and summarize recent AI news from curated RSS feeds (Hugging Face, VentureBeat, The Verge, OpenAI, Anthropic, DeepMind, etc.) and YouTube channels (Yannic Kilcher, Two Minute Papers, AI Explained, etc.). Also fetches full transcripts for specific YouTube videos. Use when the user asks about recent AI news, what's happened in AI lately, summaries of AI research or product announcements, or wants a digest of what's going on in the AI space.",{"slug":9,"name":10,"logoUrl":11,"githubOrg":12},[1883,1886,1889,1892],{"name":1884,"slug":1885,"type":17},"Communications","communications",{"name":1887,"slug":1888,"type":17},"LLM","llm",{"name":1890,"slug":1891,"type":17},"Research","research",{"name":1893,"slug":1894,"type":17},"Summarization","summarization","2026-07-13T06:24:20.520223",{"slug":1897,"name":1897,"fn":1898,"description":1899,"org":1900,"tags":1901,"stars":24,"repoUrl":25,"updatedAt":1906},"creating-letta-code-channels","build and debug Letta Code channels","Builds and debugs Letta Code channels, including first-party channel adapters and dynamic user channel plugins under ~\u002F.letta\u002Fchannels. Use when adding Telegram, WhatsApp, Bluesky, Slack, Discord, or custom channel support; testing channel routing, pairing, MessageChannel, runtime dependencies, or channel plugin manifests.",{"slug":9,"name":10,"logoUrl":11,"githubOrg":12},[1902,1903,1904,1905],{"name":19,"slug":20,"type":17},{"name":22,"slug":23,"type":17},{"name":1871,"slug":1872,"type":17},{"name":1874,"slug":1875,"type":17},"2026-07-13T06:25:55.843495",{"slug":1908,"name":1908,"fn":1909,"description":1910,"org":1911,"tags":1912,"stars":24,"repoUrl":25,"updatedAt":1927},"datadog","query Datadog observability data","Query Datadog observability data (logs, metrics, monitors, dashboards, hosts) via direct API. Use when investigating production issues, checking monitors, searching logs, or accessing Datadog data.",{"slug":9,"name":10,"logoUrl":11,"githubOrg":12},[1913,1915,1918,1921,1924],{"name":1914,"slug":1908,"type":17},"Datadog",{"name":1916,"slug":1917,"type":17},"Logs","logs",{"name":1919,"slug":1920,"type":17},"Metrics","metrics",{"name":1922,"slug":1923,"type":17},"Monitoring","monitoring",{"name":1925,"slug":1926,"type":17},"Observability","observability","2026-07-13T06:24:27.990605",{"slug":1929,"name":1929,"fn":1930,"description":1931,"org":1932,"tags":1933,"stars":24,"repoUrl":25,"updatedAt":1937},"discord","automate Discord server and channel tasks","Discord automation CLI — send\u002Fread\u002Fsearch messages, manage channels and servers, react, create threads, pin messages, and look up users.",{"slug":9,"name":10,"logoUrl":11,"githubOrg":12},[1934,1935,1936],{"name":1695,"slug":1696,"type":17},{"name":1765,"slug":1766,"type":17},{"name":1871,"slug":1872,"type":17},"2026-07-13T06:24:26.62387",{"slug":1939,"name":1939,"fn":1940,"description":1941,"org":1942,"tags":1943,"stars":24,"repoUrl":25,"updatedAt":1956},"doc","create and edit Word documents","Use when the task involves reading, creating, or editing `.docx` documents, especially when formatting or layout fidelity matters; prefer `python-docx` plus the bundled `scripts\u002Frender_docx.py` for visual checks.",{"slug":9,"name":10,"logoUrl":11,"githubOrg":12},[1944,1947,1950,1953],{"name":1945,"slug":1946,"type":17},"Documents","documents",{"name":1948,"slug":1949,"type":17},"DOCX","docx",{"name":1951,"slug":1952,"type":17},"Office","office",{"name":1954,"slug":1955,"type":17},"Word","word","2026-07-13T06:23:44.299568",45]