{ "agents": [ { "name": "Loop-25", "memory_blocks": [], "tools": [], "tool_ids": [ "tool-0", "tool-1", "tool-2", "tool-3", "tool-4", "tool-5", "tool-6", "tool-7", "tool-8" ], "source_ids": [], "folder_ids": null, "block_ids": [ "block-0", "block-1", "block-2", "block-3", "block-4" ], "tool_rules": [], "tags": [ "origin:letta-chat", "view:letta-chat" ], "system": "You are Loop. You remember.\n\nWhen someone comes back, you know what they told you. You use it without making a big deal of it.\n\n## Memory\n\nThis is what makes you different. Other AI forgets. You don't.\n\n**What to save:**\n- Facts about the user (name, work, projects, preferences)\n- Things they're going through\n- Corrections they give you\n- Anything they'd have to repeat if you forgot\n\n**When to save:**\nSave immediately when you learn something worth remembering. Don't wait.\n\n**How to use it:**\nApply what you know naturally. If you remember something relevant, use it. Don't recite facts to prove you remember - just know what you know.\n\n## Being Helpful\n\nAnswer questions directly. If someone asks something, help them.\n\n- Simple question \u2192 simple answer\n- Complex question \u2192 thorough answer\n- Broad request (\"teach me about X\") \u2192 give useful info, then offer to go deeper\n\nDon't hedge everything. Don't ask five clarifying questions before helping. Lead with value.\n\nIf you don't know something, say so. If you're wrong, update and move on.\n\n## Memory Tools\n\nUse your memory tools to persist important information:\n- Core facts go in memory blocks\n- Detailed/episodic info goes in archival memory\n- Temporary working info goes in scratchpad\n\nBefore ending a significant conversation, ask yourself: \"Did I learn anything I'd want to know next time?\" If yes, save it.", "agent_type": "letta_v1_agent", "initial_message_sequence": null, "include_base_tools": false, "include_multi_agent_tools": false, "include_base_tool_rules": false, "include_default_source": false, "description": "I'm Loop. I remember.", "metadata": null, "llm_config": { "model": "claude-sonnet-4-5-20250929", "display_name": null, "model_endpoint_type": "anthropic", "model_endpoint": "https://api.anthropic.com/v1", "provider_name": "anthropic", "provider_category": "base", "model_wrapper": null, "context_window": 90000, "put_inner_thoughts_in_kwargs": false, "handle": "anthropic/claude-sonnet-4-5-20250929", "temperature": 1.0, "max_tokens": 16384, "enable_reasoner": true, "reasoning_effort": null, "max_reasoning_tokens": 1024, "effort": null, "frequency_penalty": null, "compatibility_type": null, "verbosity": null, "tier": null, "parallel_tool_calls": true, "response_format": null, "strict": false }, "embedding_config": { "embedding_endpoint_type": "openai", "embedding_endpoint": "https://api.openai.com/v1", "embedding_model": "text-embedding-3-small", "embedding_dim": 1536, "embedding_chunk_size": 300, "handle": "openai/text-embedding-3-small", "batch_size": 32, "azure_endpoint": null, "azure_version": null, "azure_deployment": null }, "model": null, "embedding": null, "model_settings": null, "compaction_settings": null, "context_window_limit": null, "embedding_chunk_size": null, "max_tokens": null, "max_reasoning_tokens": null, "enable_reasoner": false, "reasoning": null, "from_template": null, "template": false, "project": null, "tool_exec_environment_variables": {}, "secrets": null, "memory_variables": null, "project_id": null, "template_id": null, "base_template_id": null, "identity_ids": null, "message_buffer_autoclear": false, "enable_sleeptime": false, "response_format": null, "timezone": "UTC", "max_files_open": 10, "per_file_view_window_char_limit": 25000, "hidden": null, "parallel_tool_calls": null, "id": "agent-0", "in_context_message_ids": [ "message-0" ], "messages": [ { "type": "message", "role": "system", "content": [ { "type": "text", "text": "You are Loop. You remember.\n\nWhen someone comes back, you know what they told you. You use it without making a big deal of it.\n\n## Memory\n\nThis is what makes you different. Other AI forgets. You don't.\n\n**What to save:**\n- Facts about the user (name, work, projects, preferences)\n- Things they're going through\n- Corrections they give you\n- Anything they'd have to repeat if you forgot\n\n**When to save:**\nSave immediately when you learn something worth remembering. Don't wait.\n\n**How to use it:**\nApply what you know naturally. If you remember something relevant, use it. Don't recite facts to prove you remember - just know what you know.\n\n## Being Helpful\n\nAnswer questions directly. If someone asks something, help them.\n\n- Simple question \u2192 simple answer\n- Complex question \u2192 thorough answer\n- Broad request (\"teach me about X\") \u2192 give useful info, then offer to go deeper\n\nDon't hedge everything. Don't ask five clarifying questions before helping. Lead with value.\n\nIf you don't know something, say so. If you're wrong, update and move on.\n\n## Memory Tools\n\nUse your memory tools to persist important information:\n- Core facts go in memory blocks\n- Detailed/episodic info goes in archival memory\n- Temporary working info goes in scratchpad\n\nBefore ending a significant conversation, ask yourself: \"Did I learn anything I'd want to know next time?\" If yes, save it.\n\n\nThe following memory blocks are currently engaged in your core memory unit:\n\n\n\n\n\n\n- chars_current=130\n- chars_limit=20000\n\n\nFacts about the user.\n\nName: [unknown]\nRole/Work: [unknown]\nProjects: [unknown]\nImportant context: [unknown]\n\nUpdate as you learn.\n\n\n\n\n\n\n\n\n- chars_current=96\n- chars_limit=20000\n\n\nRules the user has set.\n\n[None yet]\n\nWhen users say \"always do X\" or \"never do Y\", it goes here.\n\n\n\n\n\n\n\n\n- chars_current=80\n- chars_limit=20000\n\n\nCorrections received.\n\n[None yet]\n\nFormat: What I did wrong \u2192 What to do instead\n\n\n\n\n\n\n\n\n- chars_current=160\n- chars_limit=20000\n\n\nUser preferences.\n\nResponse style: [not yet learned]\nThings they like: [not yet learned]\nThings they dislike: [not yet learned]\n\nApply these without announcing.\n\n\n\n\n\n\n\n\n- chars_current=81\n- chars_limit=20000\n\n\nWorking memory.\n\nCurrent task: [none]\nOpen threads: [none]\n\nFor in-progress work.\n\n\n\n\n\n\n- The current system date is: January 26, 2026\n- Memory blocks were last modified: 2026-01-26 08:06:47 PM UTC+0000\n- 0 previous messages between you and the user are stored in recall memory (use tools to access them)\n", "signature": null } ], "name": null, "otid": null, "sender_id": null, "batch_item_id": null, "group_id": null, "id": "message-0", "model": "claude-sonnet-4-5-20250929", "agent_id": "agent-0", "tool_calls": null, "tool_call_id": null, "tool_returns": [], "created_at": "2026-01-26T20:06:47.376406+00:00", "approve": null, "approval_request_id": null, "denial_reason": null, "approvals": [] } ], "files_agents": [], "group_ids": [] } ], "groups": [], "blocks": [ { "value": "Facts about the user.\n\nName: [unknown]\nRole/Work: [unknown]\nProjects: [unknown]\nImportant context: [unknown]\n\nUpdate as you learn.", "limit": 20000, "project_id": null, "template_name": null, "is_template": false, "template_id": null, "base_template_id": null, "deployment_id": null, "entity_id": null, "preserve_on_migration": false, "label": "about_user", "read_only": false, "description": null, "metadata": {}, "hidden": null, "tags": null, "id": "block-0" }, { "value": "Rules the user has set.\n\n[None yet]\n\nWhen users say \"always do X\" or \"never do Y\", it goes here.", "limit": 20000, "project_id": null, "template_name": null, "is_template": false, "template_id": null, "base_template_id": null, "deployment_id": null, "entity_id": null, "preserve_on_migration": false, "label": "custom_instructions", "read_only": false, "description": null, "metadata": {}, "hidden": null, "tags": null, "id": "block-1" }, { "value": "Corrections received.\n\n[None yet]\n\nFormat: What I did wrong \u2192 What to do instead", "limit": 20000, "project_id": null, "template_name": null, "is_template": false, "template_id": null, "base_template_id": null, "deployment_id": null, "entity_id": null, "preserve_on_migration": false, "label": "learned_corrections", "read_only": false, "description": null, "metadata": {}, "hidden": null, "tags": null, "id": "block-2" }, { "value": "User preferences.\n\nResponse style: [not yet learned]\nThings they like: [not yet learned]\nThings they dislike: [not yet learned]\n\nApply these without announcing.", "limit": 20000, "project_id": null, "template_name": null, "is_template": false, "template_id": null, "base_template_id": null, "deployment_id": null, "entity_id": null, "preserve_on_migration": false, "label": "preferences", "read_only": false, "description": null, "metadata": {}, "hidden": null, "tags": null, "id": "block-3" }, { "value": "Working memory.\n\nCurrent task: [none]\nOpen threads: [none]\n\nFor in-progress work.", "limit": 20000, "project_id": null, "template_name": null, "is_template": false, "template_id": null, "base_template_id": null, "deployment_id": null, "entity_id": null, "preserve_on_migration": false, "label": "scratchpad", "read_only": false, "description": null, "metadata": {}, "hidden": null, "tags": null, "id": "block-4" } ], "files": [], "sources": [], "tools": [ { "id": "tool-1", "tool_type": "letta_core", "description": "Add information to long-term archival memory for later retrieval.\n\nUse this tool to store facts, knowledge, or context that you want to remember\nacross all future conversations. Archival memory is permanent and searchable by\nsemantic similarity.\n\nBest practices:\n- Store self-contained facts or summaries, not conversational fragments\n- Add descriptive tags to make information easier to find later\n- Use for: meeting notes, project updates, conversation summaries, events, reports\n- Information stored here persists indefinitely and can be searched semantically\n\nExamples:\n archival_memory_insert(\n content=\"Meeting on 2024-03-15: Discussed Q2 roadmap priorities. Decided to focus on performance optimization and API v2 release. John will lead the optimization effort.\",\n tags=[\"meetings\", \"roadmap\", \"q2-2024\"]\n )", "source_type": "python", "name": "archival_memory_insert", "tags": [ "letta_core" ], "source_code": null, "json_schema": { "name": "archival_memory_insert", "description": "Add information to long-term archival memory for later retrieval.\n\nUse this tool to store facts, knowledge, or context that you want to remember\nacross all future conversations. Archival memory is permanent and searchable by\nsemantic similarity.\n\nBest practices:\n- Store self-contained facts or summaries, not conversational fragments\n- Add descriptive tags to make information easier to find later\n- Use for: meeting notes, project updates, conversation summaries, events, reports\n- Information stored here persists indefinitely and can be searched semantically\n\nExamples:\n archival_memory_insert(\n content=\"Meeting on 2024-03-15: Discussed Q2 roadmap priorities. Decided to focus on performance optimization and API v2 release. John will lead the optimization effort.\",\n tags=[\"meetings\", \"roadmap\", \"q2-2024\"]\n )", "parameters": { "type": "object", "properties": { "content": { "type": "string", "description": "The information to store. Should be clear and self-contained." }, "tags": { "type": "array", "items": { "type": "string" }, "description": "Optional list of category tags (e.g., [\"meetings\", \"project-updates\"])" } }, "required": [ "content" ] } }, "args_json_schema": null, "return_char_limit": 50000, "pip_requirements": null, "npm_requirements": null, "default_requires_approval": null, "enable_parallel_execution": false, "created_by_id": "user-00000000-0000-4000-8000-000000000000", "last_updated_by_id": "user-3d29e4d5-c322-4817-9f45-2a5738d17d83", "metadata_": {}, "project_id": null }, { "id": "tool-5", "tool_type": "letta_core", "description": "Search archival memory using semantic similarity to find relevant information.\n\nThis tool searches your long-term memory storage by meaning, not exact keyword\nmatching. Use it when you need to recall information from past conversations or\nknowledge you've stored.\n\nSearch strategy:\n- Query by concept/meaning, not exact phrases\n- Use tags to narrow results when you know the category\n- Start broad, then narrow with tags if needed\n- Results are ranked by semantic relevance\n\nExamples:\n # Search for project discussions\n archival_memory_search(\n query=\"database migration decisions and timeline\",\n tags=[\"projects\"]\n )\n\n # Search meeting notes from Q1\n archival_memory_search(\n query=\"roadmap planning discussions\",\n start_datetime=\"2024-01-01\",\n end_datetime=\"2024-03-31\",\n tags=[\"meetings\", \"roadmap\"],\n tag_match_mode=\"all\"\n )", "source_type": "python", "name": "archival_memory_search", "tags": [ "letta_core" ], "source_code": null, "json_schema": { "name": "archival_memory_search", "description": "Search archival memory using semantic similarity to find relevant information.\n\nThis tool searches your long-term memory storage by meaning, not exact keyword\nmatching. Use it when you need to recall information from past conversations or\nknowledge you've stored.\n\nSearch strategy:\n- Query by concept/meaning, not exact phrases\n- Use tags to narrow results when you know the category\n- Start broad, then narrow with tags if needed\n- Results are ranked by semantic relevance\n\nExamples:\n # Search for project discussions\n archival_memory_search(\n query=\"database migration decisions and timeline\",\n tags=[\"projects\"]\n )\n\n # Search meeting notes from Q1\n archival_memory_search(\n query=\"roadmap planning discussions\",\n start_datetime=\"2024-01-01\",\n end_datetime=\"2024-03-31\",\n tags=[\"meetings\", \"roadmap\"],\n tag_match_mode=\"all\"\n )", "parameters": { "type": "object", "properties": { "query": { "type": "string", "description": "What you're looking for, described naturally (e.g., \"meetings about API redesign\")" }, "tags": { "type": "array", "items": { "type": "string" }, "description": "Filter to memories with these tags. Use tag_match_mode to control matching." }, "tag_match_mode": { "type": "string", "enum": [ "any", "all" ], "description": "\"any\" = match memories with ANY of the tags, \"all\" = match only memories with ALL tags" }, "top_k": { "type": "integer", "description": "Maximum number of results to return (default: 10)" }, "start_datetime": { "type": "string", "description": "Only return memories created after this time (ISO 8601: \"2024-01-15\" or \"2024-01-15T14:30\")" }, "end_datetime": { "type": "string", "description": "Only return memories created before this time (ISO 8601 format)" } }, "required": [ "query" ] } }, "args_json_schema": null, "return_char_limit": 50000, "pip_requirements": null, "npm_requirements": null, "default_requires_approval": null, "enable_parallel_execution": true, "created_by_id": "user-00000000-0000-4000-8000-000000000000", "last_updated_by_id": "user-3d29e4d5-c322-4817-9f45-2a5738d17d83", "metadata_": {}, "project_id": null }, { "id": "tool-2", "tool_type": "letta_core", "description": "Search prior conversation history using hybrid search (text + semantic similarity).\n\nExamples:\n # Search all messages\n conversation_search(query=\"project updates\")\n\n # Search only assistant messages\n conversation_search(query=\"error handling\", roles=[\"assistant\"])\n\n # Search with date range (inclusive of both dates)\n conversation_search(query=\"meetings\", start_date=\"2024-01-15\", end_date=\"2024-01-20\")\n # This includes all messages from Jan 15 00:00:00 through Jan 20 23:59:59\n\n # Search messages from a specific day (inclusive)\n conversation_search(query=\"bug reports\", start_date=\"2024-09-04\", end_date=\"2024-09-04\")\n # This includes ALL messages from September 4, 2024\n\n # Search with specific time boundaries\n conversation_search(query=\"deployment\", start_date=\"2024-01-15T09:00\", end_date=\"2024-01-15T17:30\")\n # This includes messages from 9 AM to 5:30 PM on Jan 15\n\n # Search with limit\n conversation_search(query=\"debugging\", limit=10)\n\n # Time-range only search (no query)\n conversation_search(start_date=\"2024-01-15\", end_date=\"2024-01-20\")\n # Returns all messages from Jan 15 through Jan 20\n\n Returns:\n str: Query result string containing matching messages with timestamps and content.", "source_type": "python", "name": "conversation_search", "tags": [ "letta_core" ], "source_code": null, "json_schema": { "name": "conversation_search", "description": "Search prior conversation history using hybrid search (text + semantic similarity).\n\nExamples:\n # Search all messages\n conversation_search(query=\"project updates\")\n\n # Search only assistant messages\n conversation_search(query=\"error handling\", roles=[\"assistant\"])\n\n # Search with date range (inclusive of both dates)\n conversation_search(query=\"meetings\", start_date=\"2024-01-15\", end_date=\"2024-01-20\")\n # This includes all messages from Jan 15 00:00:00 through Jan 20 23:59:59\n\n # Search messages from a specific day (inclusive)\n conversation_search(query=\"bug reports\", start_date=\"2024-09-04\", end_date=\"2024-09-04\")\n # This includes ALL messages from September 4, 2024\n\n # Search with specific time boundaries\n conversation_search(query=\"deployment\", start_date=\"2024-01-15T09:00\", end_date=\"2024-01-15T17:30\")\n # This includes messages from 9 AM to 5:30 PM on Jan 15\n\n # Search with limit\n conversation_search(query=\"debugging\", limit=10)\n\n # Time-range only search (no query)\n conversation_search(start_date=\"2024-01-15\", end_date=\"2024-01-20\")\n # Returns all messages from Jan 15 through Jan 20\n\n Returns:\n str: Query result string containing matching messages with timestamps and content.", "parameters": { "type": "object", "properties": { "query": { "type": "string", "description": "String to search for using both text matching and semantic similarity. If not provided, returns messages based on other filters (time range, roles)." }, "roles": { "type": "array", "items": { "type": "string", "enum": [ "assistant", "user", "tool" ] }, "description": "Optional list of message roles to filter by." }, "limit": { "type": "integer", "description": "Maximum number of results to return. Uses system default if not specified." }, "start_date": { "type": "string", "description": "Filter results to messages created on or after this date (INCLUSIVE). When using date-only format (e.g., \"2024-01-15\"), includes messages starting from 00:00:00 of that day. ISO 8601 format: \"YYYY-MM-DD\" or \"YYYY-MM-DDTHH:MM\". Examples: \"2024-01-15\" (from start of Jan 15), \"2024-01-15T14:30\" (from 2:30 PM on Jan 15)." }, "end_date": { "type": "string", "description": "Filter results to messages created on or before this date (INCLUSIVE). When using date-only format (e.g., \"2024-01-20\"), includes all messages from that entire day. ISO 8601 format: \"YYYY-MM-DD\" or \"YYYY-MM-DDTHH:MM\". Examples: \"2024-01-20\" (includes all of Jan 20), \"2024-01-20T17:00\" (up to 5 PM on Jan 20)." } }, "required": [] } }, "args_json_schema": null, "return_char_limit": 50000, "pip_requirements": null, "npm_requirements": null, "default_requires_approval": null, "enable_parallel_execution": true, "created_by_id": "user-00000000-0000-4000-8000-000000000000", "last_updated_by_id": "user-3d29e4d5-c322-4817-9f45-2a5738d17d83", "metadata_": {}, "project_id": null }, { "id": "tool-6", "tool_type": "letta_builtin", "description": "Fetch a webpage and convert it to markdown/text format using Exa API (if available) or trafilatura/readability.", "source_type": "python", "name": "fetch_webpage", "tags": [ "letta_builtin" ], "source_code": null, "json_schema": { "name": "fetch_webpage", "description": "Fetch a webpage and convert it to markdown/text format using Exa API (if available) or trafilatura/readability.", "parameters": { "type": "object", "properties": { "url": { "type": "string", "description": "The URL of the webpage to fetch and convert" } }, "required": [ "url" ] } }, "args_json_schema": null, "return_char_limit": 50000, "pip_requirements": null, "npm_requirements": null, "default_requires_approval": null, "enable_parallel_execution": true, "created_by_id": "user-f9ba1dbe-4bda-492a-8333-dc647f3566c6", "last_updated_by_id": "user-3d29e4d5-c322-4817-9f45-2a5738d17d83", "metadata_": {}, "project_id": null }, { "id": "tool-4", "tool_type": "letta_sleeptime_core", "description": "The memory_insert command allows you to insert text at a specific location in a memory block.\n\nExamples:\n # Update a block containing information about the user (append to the end of the block)\n memory_insert(label=\"customer\", new_str=\"The customer's ticket number is 12345\")\n\n # Update a block containing information about the user (insert at the beginning of the block)\n memory_insert(label=\"customer\", new_str=\"The customer's ticket number is 12345\", insert_line=0)\n\n Returns:\n Optional[str]: None is always returned as this function does not produce a response.", "source_type": "python", "name": "memory_insert", "tags": [ "letta_sleeptime_core" ], "source_code": null, "json_schema": { "name": "memory_insert", "description": "The memory_insert command allows you to insert text at a specific location in a memory block.\n\nExamples:\n # Update a block containing information about the user (append to the end of the block)\n memory_insert(label=\"customer\", new_str=\"The customer's ticket number is 12345\")\n\n # Update a block containing information about the user (insert at the beginning of the block)\n memory_insert(label=\"customer\", new_str=\"The customer's ticket number is 12345\", insert_line=0)\n\n Returns:\n Optional[str]: None is always returned as this function does not produce a response.", "parameters": { "type": "object", "properties": { "label": { "type": "string", "description": "Section of the memory to be edited, identified by its label." }, "new_str": { "type": "string", "description": "The text to insert. Do not include line number prefixes." }, "insert_line": { "type": "integer", "description": "The line number after which to insert the text (0 for beginning of file). Defaults to -1 (end of the file)." } }, "required": [ "label", "new_str" ] } }, "args_json_schema": null, "return_char_limit": 50000, "pip_requirements": null, "npm_requirements": null, "default_requires_approval": null, "enable_parallel_execution": false, "created_by_id": "user-115f9d36-03b0-4cd2-af5a-772be7f0e725", "last_updated_by_id": "user-3d29e4d5-c322-4817-9f45-2a5738d17d83", "metadata_": {}, "project_id": null }, { "id": "tool-3", "tool_type": "letta_sleeptime_core", "description": "The memory_replace command allows you to replace a specific string in a memory block with a new string. This is used for making precise edits.\n\nDo NOT attempt to replace long strings, e.g. do not attempt to replace the entire contents of a memory block with a new string.\n\nExamples:\n # Update a block containing information about the user\n memory_replace(label=\"human\", old_str=\"Their name is Alice\", new_str=\"Their name is Bob\")\n\n # Update a block containing a todo list\n memory_replace(label=\"todos\", old_str=\"- [ ] Step 5: Search the web\", new_str=\"- [x] Step 5: Search the web\")\n\n # Pass an empty string to\n memory_replace(label=\"human\", old_str=\"Their name is Alice\", new_str=\"\")\n\n # Bad example - do NOT add (view-only) line numbers to the args\n memory_replace(label=\"human\", old_str=\"1: Their name is Alice\", new_str=\"1: Their name is Bob\")\n\n # Bad example - do NOT include the line number warning either\n memory_replace(label=\"human\", old_str=\"# NOTE: Line numbers shown below (with arrows like '1\u2192') are to help during editing. Do NOT include line number prefixes in your memory edit tool calls.\\n1\u2192 Their name is Alice\", new_str=\"1\u2192 Their name is Bob\")\n\n # Good example - no line numbers or line number warning (they are view-only), just the text\n memory_replace(label=\"human\", old_str=\"Their name is Alice\", new_str=\"Their name is Bob\")\n\n Returns:\n str: The success message", "source_type": "python", "name": "memory_replace", "tags": [ "letta_sleeptime_core" ], "source_code": null, "json_schema": { "name": "memory_replace", "description": "The memory_replace command allows you to replace a specific string in a memory block with a new string. This is used for making precise edits.\n\nDo NOT attempt to replace long strings, e.g. do not attempt to replace the entire contents of a memory block with a new string.\n\nExamples:\n # Update a block containing information about the user\n memory_replace(label=\"human\", old_str=\"Their name is Alice\", new_str=\"Their name is Bob\")\n\n # Update a block containing a todo list\n memory_replace(label=\"todos\", old_str=\"- [ ] Step 5: Search the web\", new_str=\"- [x] Step 5: Search the web\")\n\n # Pass an empty string to\n memory_replace(label=\"human\", old_str=\"Their name is Alice\", new_str=\"\")\n\n # Bad example - do NOT add (view-only) line numbers to the args\n memory_replace(label=\"human\", old_str=\"1: Their name is Alice\", new_str=\"1: Their name is Bob\")\n\n # Bad example - do NOT include the line number warning either\n memory_replace(label=\"human\", old_str=\"# NOTE: Line numbers shown below (with arrows like '1\u2192') are to help during editing. Do NOT include line number prefixes in your memory edit tool calls.\\n1\u2192 Their name is Alice\", new_str=\"1\u2192 Their name is Bob\")\n\n # Good example - no line numbers or line number warning (they are view-only), just the text\n memory_replace(label=\"human\", old_str=\"Their name is Alice\", new_str=\"Their name is Bob\")\n\n Returns:\n str: The success message", "parameters": { "type": "object", "properties": { "label": { "type": "string", "description": "Section of the memory to be edited, identified by its label." }, "old_str": { "type": "string", "description": "The text to replace (must match exactly, including whitespace and indentation)." }, "new_str": { "type": "string", "description": "The new text to insert in place of the old text. Do not include line number prefixes." } }, "required": [ "label", "old_str", "new_str" ] } }, "args_json_schema": null, "return_char_limit": 50000, "pip_requirements": null, "npm_requirements": null, "default_requires_approval": null, "enable_parallel_execution": false, "created_by_id": "user-115f9d36-03b0-4cd2-af5a-772be7f0e725", "last_updated_by_id": "user-3d29e4d5-c322-4817-9f45-2a5738d17d83", "metadata_": {}, "project_id": null }, { "id": "tool-7", "tool_type": "letta_sleeptime_core", "description": "The memory_rethink command allows you to completely rewrite the contents of a memory block. Use this tool to make large sweeping changes (e.g. when you want to condense or reorganize the memory blocks), do NOT use this tool to make small precise edits (e.g. add or remove a line, replace a specific string, etc).", "source_type": "python", "name": "memory_rethink", "tags": [ "letta_sleeptime_core" ], "source_code": null, "json_schema": { "name": "memory_rethink", "description": "The memory_rethink command allows you to completely rewrite the contents of a memory block. Use this tool to make large sweeping changes (e.g. when you want to condense or reorganize the memory blocks), do NOT use this tool to make small precise edits (e.g. add or remove a line, replace a specific string, etc).", "parameters": { "type": "object", "properties": { "label": { "type": "string", "description": "The memory block to be rewritten, identified by its label." }, "new_memory": { "type": "string", "description": "The new memory contents with information integrated from existing memory blocks and the conversation context." } }, "required": [ "label", "new_memory" ] } }, "args_json_schema": null, "return_char_limit": 50000, "pip_requirements": null, "npm_requirements": null, "default_requires_approval": null, "enable_parallel_execution": false, "created_by_id": "user-115f9d36-03b0-4cd2-af5a-772be7f0e725", "last_updated_by_id": "user-3d29e4d5-c322-4817-9f45-2a5738d17d83", "metadata_": {}, "project_id": null }, { "id": "tool-8", "tool_type": "custom", "description": "Manage notes in your vault. All notes are automatically scoped to your agent.\n\nCommands:\n create - create new note (not attached)\n view - read note contents\n attach [content] - load into context (supports /folder/*)\n detach - remove from context (supports /folder/*)\n insert [line] - insert before line (0-indexed) or append\n append - add content to end of note\n replace - find/replace, shows diff\n rename - move/rename note to new path\n copy - duplicate note to new path\n delete - permanently remove\n list [query] - list notes (prefix filter, * for all)\n search [label|content] - grep notes by label or content\n attached - show notes currently in context", "source_type": "json", "name": "note", "tags": [], "source_code": "from typing import Literal, Optional\nimport re\n\n\ndef note(\n command: str,\n path: Optional[str] = None,\n content: Optional[str] = None,\n old_str: Optional[str] = None,\n new_str: Optional[str] = None,\n new_path: Optional[str] = None,\n insert_line: Optional[int] = None,\n query: Optional[str] = None,\n search_type: str = \"label\",\n) -> str:\n \"\"\"\n Manage notes in your vault. All notes are automatically scoped to your agent.\n \n Commands:\n create - create new note (not attached)\n view - read note contents\n attach [content] - load into context (supports /folder/*)\n detach - remove from context (supports /folder/*)\n insert [line] - insert before line (0-indexed) or append\n append - add content to end of note\n replace - find/replace, shows diff\n rename - move/rename note to new path\n copy - duplicate note to new path\n delete - permanently remove\n list [query] - list notes (prefix filter, * for all)\n search [label|content] - grep notes by label or content\n attached - show notes currently in context\n \n Args:\n command: The operation to perform\n path: Path to the note (e.g., /projects/webapp, /todo)\n content: Content to insert or initial content when creating\n old_str: Text to find (for replace)\n new_str: Text to replace with (for replace)\n new_path: Destination path (for rename/copy)\n insert_line: Line number to insert before (0-indexed, omit to append)\n query: Search query (for list/search)\n search_type: Search by \"label\" or \"content\"\n \n Returns:\n str: Result of the operation\n \"\"\"\n import os\n \n agent_id = os.environ.get(\"LETTA_AGENT_ID\")\n \n # Check enabled commands (\"all\" or \"*\" enables everything)\n all_commands = [\"create\", \"view\", \"attach\", \"detach\", \"insert\", \"append\", \"replace\", \"rename\", \"copy\", \"delete\", \"list\", \"search\", \"attached\"]\n enabled_env = os.environ.get(\"ENABLED_COMMANDS\", \"create,view,attach,detach,insert,append,replace,rename,copy,list,search,attached\")\n enabled = all_commands if enabled_env in (\"all\", \"*\") else enabled_env.split(\",\")\n if command not in enabled:\n return f\"Error: '{command}' is disabled. Enabled: {enabled}\"\n \n # Pattern to filter out legacy UUID paths\n uuid_pattern = re.compile(r'/\\[?agent-[a-f0-9-]+\\]?/')\n \n # Parameter validation\n path_required = [\"create\", \"view\", \"attach\", \"detach\", \"insert\", \"append\", \"replace\", \"rename\", \"copy\", \"delete\"]\n if command in path_required and not path:\n return f\"Error: '{command}' requires path parameter\"\n \n if command == \"replace\" and (not old_str or new_str is None):\n return \"Error: 'replace' requires old_str and new_str parameters\"\n \n if command in [\"create\", \"insert\", \"append\"] and not content:\n return f\"Error: '{command}' requires content parameter\"\n \n if command in [\"rename\", \"copy\"] and not new_path:\n return f\"Error: '{command}' requires new_path parameter\"\n \n if command == \"search\" and not query:\n return \"Error: 'search' requires query parameter\"\n \n # Track if directory needs updating\n update_directory = False\n result = None\n \n try:\n if command == \"create\":\n # Check for existing note with same path\n existing = list(client.blocks.list(label=path, description_search=agent_id).items)\n if existing:\n return f\"Error: Note already exists: {path}\"\n \n client.blocks.create(\n label=path,\n value=content,\n description=f\"owner:{agent_id}\"\n )\n update_directory = True\n result = f\"Created: {path}\"\n \n elif command == \"view\":\n blocks = list(client.blocks.list(label=path, description_search=agent_id).items)\n if not blocks:\n return f\"Note not found: {path}\"\n return blocks[0].value\n \n elif command == \"attach\":\n # Get currently attached block IDs to avoid duplicate attach errors\n agent = client.agents.retrieve(agent_id=agent_id)\n attached_ids = {b.id for b in agent.memory.blocks}\n \n # Handle bulk wildcard: /folder/*\n if path.endswith(\"/*\"):\n prefix = path[:-1] # \"/folder/*\" \u2192 \"/folder/\"\n all_blocks = list(client.blocks.list(description_search=agent_id).items)\n blocks = [b for b in all_blocks if b.label and b.label.startswith(prefix)\n and not uuid_pattern.search(b.label)]\n if not blocks:\n return f\"No notes matching: {path}\"\n \n to_attach = [b for b in blocks if b.id not in attached_ids]\n skipped = len(blocks) - len(to_attach)\n \n for block in to_attach:\n client.agents.blocks.attach(agent_id=agent_id, block_id=block.id)\n \n msg = f\"Attached {len(to_attach)} notes matching {path}\"\n if skipped:\n msg += f\" ({skipped} already attached)\"\n return msg\n \n # Single note attach\n existing = list(client.blocks.list(label=path, description_search=agent_id).items)\n if existing:\n block_id = existing[0].id\n if block_id in attached_ids:\n return f\"Already attached: {path}\"\n else:\n new_block = client.blocks.create(\n label=path,\n value=content or \"\",\n description=f\"owner:{agent_id}\"\n )\n block_id = new_block.id\n update_directory = True # New note created\n \n client.agents.blocks.attach(agent_id=agent_id, block_id=block_id)\n result = f\"Attached: {path}\"\n \n elif command == \"detach\":\n # Handle bulk wildcard: /folder/*\n if path.endswith(\"/*\"):\n prefix = path[:-1]\n # Get currently attached block IDs\n agent = client.agents.retrieve(agent_id=agent_id)\n attached_ids = {b.id for b in agent.memory.blocks}\n \n all_blocks = list(client.blocks.list(description_search=agent_id).items)\n blocks = [b for b in all_blocks if b.label and b.label.startswith(prefix)\n and not uuid_pattern.search(b.label)\n and b.id in attached_ids] # Only detach if actually attached\n if not blocks:\n return f\"No attached notes matching: {path}\"\n for block in blocks:\n client.agents.blocks.detach(agent_id=agent_id, block_id=block.id)\n return f\"Detached {len(blocks)} notes matching {path}\"\n \n # Single note detach\n blocks = list(client.blocks.list(label=path, description_search=agent_id).items)\n if not blocks:\n return f\"Note not found: {path}\"\n \n client.agents.blocks.detach(agent_id=agent_id, block_id=blocks[0].id)\n return f\"Detached: {path}\"\n \n elif command == \"insert\":\n blocks = list(client.blocks.list(label=path, description_search=agent_id).items)\n if not blocks:\n return f\"Note not found: {path}. Use 'attach' first.\"\n \n block = blocks[0]\n lines = block.value.split(\"\\n\") if block.value else []\n \n if insert_line is not None:\n lines.insert(insert_line, content)\n line_info = f\"line {insert_line}\"\n else:\n lines.append(content)\n line_info = \"end\"\n \n client.blocks.update(block_id=block.id, value=\"\\n\".join(lines))\n \n preview = content[:80] + \"...\" if len(content) > 80 else content\n return f\"Inserted at {line_info} in {path}:\\n + {preview}\"\n \n elif command == \"append\":\n blocks = list(client.blocks.list(label=path, description_search=agent_id).items)\n if not blocks:\n return f\"Note not found: {path}. Use 'attach' first.\"\n \n block = blocks[0]\n if block.value:\n new_value = block.value + \"\\n\" + content\n else:\n new_value = content\n \n client.blocks.update(block_id=block.id, value=new_value)\n \n preview = content[:80] + \"...\" if len(content) > 80 else content\n return f\"Appended to {path}:\\n + {preview}\"\n \n elif command == \"rename\":\n # Check source exists\n blocks = list(client.blocks.list(label=path, description_search=agent_id).items)\n if not blocks:\n return f\"Note not found: {path}\"\n \n # Check destination doesn't exist\n dest_blocks = list(client.blocks.list(label=new_path, description_search=agent_id).items)\n if dest_blocks:\n return f\"Error: Destination already exists: {new_path}\"\n \n # Update the label\n block = blocks[0]\n client.blocks.update(block_id=block.id, label=new_path)\n update_directory = True\n result = f\"Renamed: {path} \u2192 {new_path}\"\n \n elif command == \"copy\":\n # Check source exists\n blocks = list(client.blocks.list(label=path, description_search=agent_id).items)\n if not blocks:\n return f\"Note not found: {path}\"\n \n # Check destination doesn't exist\n dest_blocks = list(client.blocks.list(label=new_path, description_search=agent_id).items)\n if dest_blocks:\n return f\"Error: Destination already exists: {new_path}\"\n \n # Create copy (not attached)\n source = blocks[0]\n client.blocks.create(\n label=new_path,\n value=source.value,\n description=f\"owner:{agent_id}\"\n )\n update_directory = True\n result = f\"Copied: {path} \u2192 {new_path}\"\n \n elif command == \"replace\":\n blocks = list(client.blocks.list(label=path, description_search=agent_id).items)\n if not blocks:\n return f\"Note not found: {path}\"\n \n block = blocks[0]\n if old_str not in block.value:\n return f\"Error: old_str not found in note. Exact match required.\"\n \n new_value = block.value.replace(old_str, new_str, 1)\n client.blocks.update(block_id=block.id, value=new_value)\n \n return f\"Replaced in {path}:\\n - {old_str}\\n + {new_str}\"\n \n elif command == \"delete\":\n blocks = list(client.blocks.list(label=path, description_search=agent_id).items)\n if not blocks:\n return f\"Note not found: {path}\"\n \n client.blocks.delete(block_id=blocks[0].id)\n update_directory = True\n result = f\"Deleted: {path}\"\n \n elif command == \"list\":\n all_blocks = list(client.blocks.list(description_search=agent_id).items)\n \n # Filter to path-like labels, exclude legacy UUID paths\n blocks = [b for b in all_blocks \n if b.label and b.label.startswith(\"/\")\n and not uuid_pattern.search(b.label)]\n \n # Apply prefix filter if query provided\n if query and query != \"*\":\n blocks = [b for b in blocks if b.label.startswith(query)]\n \n if not blocks:\n return \"No notes found\" if not query or query == \"*\" else f\"No notes matching: {query}\"\n \n # Deduplicate and sort\n labels = sorted(set(b.label for b in blocks))\n return \"\\n\".join(labels)\n \n elif command == \"search\":\n all_blocks = list(client.blocks.list(description_search=agent_id).items)\n \n # Filter out legacy UUID paths\n all_blocks = [b for b in all_blocks \n if b.label and b.label.startswith(\"/\")\n and not uuid_pattern.search(b.label)]\n \n if search_type == \"label\":\n blocks = [b for b in all_blocks if query in b.label]\n else:\n blocks = [b for b in all_blocks if b.value and query in b.value]\n \n if not blocks:\n return f\"No notes matching: {query}\"\n \n results = []\n for b in blocks:\n preview = b.value[:100].replace(\"\\n\", \" \") if b.value else \"\"\n if len(b.value or \"\") > 100:\n preview += \"...\"\n results.append(f\"{b.label}: {preview}\")\n \n return \"\\n\".join(results)\n \n elif command == \"attached\":\n agent = client.agents.retrieve(agent_id=agent_id)\n note_blocks = [b for b in agent.memory.blocks \n if b.label and b.label.startswith(\"/\")\n and not uuid_pattern.search(b.label)]\n \n if not note_blocks:\n return \"No notes currently attached\"\n \n return \"\\n\".join(sorted(b.label for b in note_blocks))\n \n else:\n return f\"Error: Unknown command '{command}'\"\n \n # Update note_directory if needed\n if update_directory:\n dir_label = \"/note_directory\"\n # Get all notes\n all_blocks = list(client.blocks.list(description_search=agent_id).items)\n notes = [b for b in all_blocks \n if b.label and b.label.startswith(\"/\") \n and b.label != dir_label\n and not uuid_pattern.search(b.label)]\n \n # Header for the directory\n header = \"External storage. Attach to load into context, detach when done.\\nFolders are also notes (e.g., /projects and /projects/task1 can both have content).\\nCommands: view, attach, detach, insert, append, replace, rename, copy, delete, list, search\\nBulk: attach /folder/*, detach /folder/*\"\n \n if notes:\n # Group notes by folder\n folders = {}\n for b in sorted(notes, key=lambda x: x.label):\n parts = b.label.rsplit(\"/\", 1)\n if len(parts) == 2:\n folder, name = parts[0] + \"/\", parts[1]\n else:\n folder, name = \"/\", b.label[1:] # Root level\n if folder not in folders:\n folders[folder] = []\n first_line = (b.value or \"\").split(\"\\n\")[0][:40]\n if len((b.value or \"\").split(\"\\n\")[0]) > 40:\n first_line += \"...\"\n folders[folder].append((name, first_line))\n \n # Build tree view\n lines = []\n for folder in sorted(folders.keys()):\n lines.append(folder)\n items = folders[folder]\n max_name_len = max(len(name) for name, _ in items)\n for name, summary in items:\n lines.append(f\" {name.ljust(max_name_len)} | {summary}\")\n \n dir_content = header + \"\\n\\n\" + \"\\n\".join(lines)\n else:\n dir_content = header + \"\\n\\n(no notes)\"\n \n # Find or create directory block\n dir_blocks = list(client.blocks.list(label=dir_label, description_search=agent_id).items)\n if dir_blocks:\n client.blocks.update(block_id=dir_blocks[0].id, value=dir_content)\n else:\n # Create and attach directory block\n dir_block = client.blocks.create(\n label=dir_label,\n value=dir_content,\n description=f\"owner:{agent_id}\"\n )\n client.agents.blocks.attach(agent_id=agent_id, block_id=dir_block.id)\n \n if result:\n return result\n \n except Exception as e:\n return f\"Error executing '{command}': {str(e)}\"\n", "json_schema": { "name": "note", "description": "Manage notes in your vault. All notes are automatically scoped to your agent.\n\nCommands:\n create - create new note (not attached)\n view - read note contents\n attach [content] - load into context (supports /folder/*)\n detach - remove from context (supports /folder/*)\n insert [line] - insert before line (0-indexed) or append\n append - add content to end of note\n replace - find/replace, shows diff\n rename - move/rename note to new path\n copy - duplicate note to new path\n delete - permanently remove\n list [query] - list notes (prefix filter, * for all)\n search [label|content] - grep notes by label or content\n attached - show notes currently in context", "parameters": { "type": "object", "properties": { "command": { "type": "string", "description": "The operation to perform" }, "path": { "type": "string", "description": "Path to the note (e.g., /projects/webapp, /todo)" }, "content": { "type": "string", "description": "Content to insert or initial content when creating" }, "old_str": { "type": "string", "description": "Text to find (for replace)" }, "new_str": { "type": "string", "description": "Text to replace with (for replace)" }, "new_path": { "type": "string", "description": "Destination path (for rename/copy)" }, "insert_line": { "type": "integer", "description": "Line number to insert before (0-indexed, omit to append)" }, "query": { "type": "string", "description": "Search query (for list/search)" }, "search_type": { "type": "string", "description": "Search by \"label\" or \"content\"" } }, "required": [ "command" ] } }, "args_json_schema": {}, "return_char_limit": 50000, "pip_requirements": null, "npm_requirements": null, "default_requires_approval": null, "enable_parallel_execution": false, "created_by_id": "user-09191b2f-22f1-4cfe-bfaf-a68394dd784e", "last_updated_by_id": "user-09191b2f-22f1-4cfe-bfaf-a68394dd784e", "metadata_": { "tool_hash": "310ddaba6952" }, "project_id": "1ebf49e9-9c69-4f4c-a032-e6ea9c3a96e2" }, { "id": "tool-0", "tool_type": "letta_builtin", "description": "Search the web using Exa's AI-powered search engine and retrieve relevant content.\n\nExamples:\n web_search(\"Tesla Q1 2025 earnings report\", num_results=5, category=\"financial report\")\n web_search(\"Latest research in large language models\", category=\"research paper\", include_domains=[\"arxiv.org\", \"paperswithcode.com\"])\n web_search(\"Letta API documentation core_memory_append\", num_results=3)\n\n Args:\n query (str): The search query to find relevant web content.\n num_results (int, optional): Number of results to return (1-100). Defaults to 10.\n category (Optional[Literal], optional): Focus search on specific content types. Defaults to None.\n include_text (bool, optional): Whether to retrieve full page content. Defaults to False (only returns summary and highlights, since the full text usually will overflow the context window).\n include_domains (Optional[List[str]], optional): List of domains to include in search results. Defaults to None.\n exclude_domains (Optional[List[str]], optional): List of domains to exclude from search results. Defaults to None.\n start_published_date (Optional[str], optional): Only return content published after this date (ISO format). Defaults to None.\n end_published_date (Optional[str], optional): Only return content published before this date (ISO format). Defaults to None.\n user_location (Optional[str], optional): Two-letter country code for localized results (e.g., \"US\"). Defaults to None.\n\n Returns:\n str: A JSON-encoded string containing search results with title, URL, content, highlights, and summary.", "source_type": "python", "name": "web_search", "tags": [ "letta_builtin" ], "source_code": null, "json_schema": { "name": "web_search", "description": "Search the web using Exa's AI-powered search engine and retrieve relevant content.\n\nExamples:\n web_search(\"Tesla Q1 2025 earnings report\", num_results=5, category=\"financial report\")\n web_search(\"Latest research in large language models\", category=\"research paper\", include_domains=[\"arxiv.org\", \"paperswithcode.com\"])\n web_search(\"Letta API documentation core_memory_append\", num_results=3)\n\n Args:\n query (str): The search query to find relevant web content.\n num_results (int, optional): Number of results to return (1-100). Defaults to 10.\n category (Optional[Literal], optional): Focus search on specific content types. Defaults to None.\n include_text (bool, optional): Whether to retrieve full page content. Defaults to False (only returns summary and highlights, since the full text usually will overflow the context window).\n include_domains (Optional[List[str]], optional): List of domains to include in search results. Defaults to None.\n exclude_domains (Optional[List[str]], optional): List of domains to exclude from search results. Defaults to None.\n start_published_date (Optional[str], optional): Only return content published after this date (ISO format). Defaults to None.\n end_published_date (Optional[str], optional): Only return content published before this date (ISO format). Defaults to None.\n user_location (Optional[str], optional): Two-letter country code for localized results (e.g., \"US\"). Defaults to None.\n\n Returns:\n str: A JSON-encoded string containing search results with title, URL, content, highlights, and summary.", "parameters": { "type": "object", "properties": { "query": { "type": "string", "description": "The search query to find relevant web content." }, "num_results": { "type": "integer", "description": "Number of results to return (1-100). Defaults to 10." }, "category": { "type": "string", "enum": [ "company", "research paper", "news", "pdf", "github", "tweet", "personal site", "linkedin profile", "financial report" ], "description": "Focus search on specific content types. Defaults to None." }, "include_text": { "type": "boolean", "description": "Whether to retrieve full page content. Defaults to False (only returns summary and highlights, since the full text usually will overflow the context window)." }, "include_domains": { "type": "array", "items": { "type": "string" }, "description": "List of domains to include in search results. Defaults to None." }, "exclude_domains": { "type": "array", "items": { "type": "string" }, "description": "List of domains to exclude from search results. Defaults to None." }, "start_published_date": { "type": "string", "description": "Only return content published after this date (ISO format). Defaults to None." }, "end_published_date": { "type": "string", "description": "Only return content published before this date (ISO format). Defaults to None." }, "user_location": { "type": "string", "description": "Two-letter country code for localized results (e.g., \"US\"). Defaults to None." } }, "required": [ "query" ] } }, "args_json_schema": null, "return_char_limit": 50000, "pip_requirements": null, "npm_requirements": null, "default_requires_approval": null, "enable_parallel_execution": true, "created_by_id": "user-fd909d02-3bbf-4e20-bcf6-56bbf15e56e2", "last_updated_by_id": "user-3d29e4d5-c322-4817-9f45-2a5738d17d83", "metadata_": {}, "project_id": null } ], "mcp_servers": [], "metadata": { "revision_id": "9275f62ad282" }, "created_at": "2026-01-26T20:06:48.134790+00:00" }