Agent Skillsletta-ai/letta-code › messaging-agents

messaging-agents

GitHub

允许代理通过线程安全API向同一服务器上的其他代理发送消息,用于查询专业知识、获取记忆信息或协调任务。支持按名称/标签查找代理,并提供CLI用法及目标代理能力边界说明。

src/skills/builtin/messaging-agents/SKILL.md letta-ai/letta-code

触发场景

需要询问另一个代理问题 查询具有专业知识的代理 需要获取其他代理记忆中的信息 与其他代理协调任务

安装

npx skills add letta-ai/letta-code --skill messaging-agents -g -y
更多选项

非标准路径

npx skills add https://github.com/letta-ai/letta-code/tree/main/src/skills/builtin/messaging-agents -g -y

不安装直接使用

npx skills use letta-ai/letta-code@messaging-agents

指定 Agent (Claude Code)

npx skills add letta-ai/letta-code --skill messaging-agents -a claude-code -g -y

安装 repo 全部 skill

npx skills add letta-ai/letta-code --all -g -y

预览 repo 内 skill

npx skills add letta-ai/letta-code --list

SKILL.md

Frontmatter
{
    "name": "messaging-agents",
    "description": "Send messages to other agents on your server. Use when you need to communicate with, query, or delegate tasks to another agent."
}

Messaging Agents

This skill enables you to send messages to other agents on the same Letta server using the thread-safe conversations API.

When to Use This Skill

  • You need to ask another agent a question
  • You want to query an agent that has specialized knowledge
  • You need information that another agent has in their memory
  • You want to coordinate with another agent on a task

What the Target Agent Can and Cannot Do

The target agent CANNOT:

  • Access your local environment (read/write files in your codebase)
  • Execute shell commands on your machine
  • Use your tools (Bash, Read, Write, Edit, etc.)

The target agent CAN:

  • Use their own tools (whatever they have configured)
  • Access their own memory blocks
  • Make API calls if they have web/API tools
  • Search the web if they have web search tools
  • Respond with information from their knowledge/memory

Important: This skill is for communication with other agents, not delegation of local work. The target agent runs in their own environment and cannot interact with your codebase.

Need local access? If you need the target agent to access your local environment (read/write files, run commands), use the Agent tool instead to deploy them as a subagent:

Agent({
  agent_id: "agent-xxx",            // Deploy this existing agent
  subagent_type: "general-purpose", // read-write access to your local tools
  prompt: "Look at the code in src/ and tell me about the architecture"
})

This gives the agent access to your codebase while running as a subagent.

Finding an Agent to Message

If you don't have a specific agent ID, use these skills to find one:

By Name or Tags

Load the finding-agents skill to search for agents:

letta agents list --query "agent-name"
letta agents list --tags "origin:letta-code"

By Topic They Discussed

Load the searching-messages skill to find which agent worked on something:

letta messages search --query "topic" --all-agents

Results include agent_id for each matching message.

CLI Usage (agent-to-agent)

Starting a New Conversation

letta -p --from-agent $LETTA_AGENT_ID --agent <id> "message text"

When no --environment is specified, the target agent will run in the same environment as the caller agent.

To route the target agent turn through a specific remote/local environment:

letta -p --from-agent $LETTA_AGENT_ID \
  --agent <id> \
  --environment <name-or-device-id-or-connection-id> \
  "message text"

Arguments:

Arg Required Description
--agent <id> Yes Target agent ID to message
--from-agent <id> Yes Sender agent ID (injects agent-to-agent system reminder)
--environment <selector> No Route through an online environment by connection name, device ID, or connection ID
"message text" Yes Message body (positional after flags)

Example:

letta -p --from-agent $LETTA_AGENT_ID \
  --agent agent-abc123 \
  "What do you know about the authentication system?"

Response:

{
  "conversation_id": "conversation-xyz789",
  "response": "The authentication system uses JWT tokens...",
  "agent_id": "agent-abc123",
  "agent_name": "BackendExpert"
}

Continuing a Conversation

letta -p --from-agent $LETTA_AGENT_ID --conversation <id> "message text"

Add --environment <selector> to continue the conversation on a specific environment.

Discovering Environments

letta environments list --online-only
# alias:
letta envs list --online-only

Use connectionName, deviceId, or connectionId from the JSON output as the --environment selector. If a name is ambiguous, prefer deviceId or connectionId. In environments list, the current local runtime is marked with "isCurrent": true.

To force the target agent onto the current registered Letta Code environment, resolve the current environment and pass its connectionId:

CURRENT_ENV=$(letta environments current | jq -r .connectionId)
letta -p --from-agent $LETTA_AGENT_ID \
  --agent agent-abc123 \
  --environment "$CURRENT_ENV" \
  "Run on my same machine/environment."

Omit --environment when you want the target agent to run in the same environment as the caller agent.

Arguments:

Arg Required Description
--conversation <id> Yes Existing conversation ID
--from-agent <id> Yes Sender agent ID (injects agent-to-agent system reminder)
"message text" Yes Follow-up message (positional after flags)

Example:

letta -p --from-agent $LETTA_AGENT_ID \
  --conversation conversation-xyz789 \
  "Can you explain more about the token refresh flow?"

Understanding the Response

  • Text-mode scripts return only the final assistant message (not tool calls, reasoning, or metadata)
  • JSON and stream-json responses include agent_id, conversation_id, and environment.source so you can continue the same conversation/runtime. Environment-routed turns also include environment.id, connection_id, device_id, and name.
  • The target agent may use tools, think, and reason - but you only see their final response
  • To see the full conversation transcript (including tool calls), use the searching-messages skill with letta messages list --agent <id> targeting the other agent

How It Works

When you send a message, the target agent receives it with a system reminder:

<system-reminder>
This message is from "YourAgentName" (agent ID: agent-xxx), an agent currently running inside the Letta Code CLI (docs.letta.com/letta-code).
The sender will only see the final message you generate (not tool calls or reasoning).
If you need to share detailed information, include it in your response text.
</system-reminder>

This helps the target agent understand the context and format their response appropriately.

Hidden Conversations

Agent-to-agent conversations (started via --from-agent) are created hidden on the target agent. They don't appear in the target's default conversation list in the ADE, so automated inter-agent chatter doesn't clutter the UI.

To inspect them:

  • List hidden conversations via the API with archive_status=archived (or all)
  • Pull the transcript directly with letta messages transcript --conversation <id>
  • The conversation_id returned when you sent the message is the handle you need

Continuing a hidden conversation with --conversation <id> keeps it hidden — only archive status is affected, messaging still works normally.

Related Skills

  • finding-agents: Find agents by name, tags, or fuzzy search
  • searching-messages: Search past messages across agents, or view full conversation transcripts

版本历史

  • 23446a1 当前 2026-07-23 06:14

    新增通过环境变量路由无头消息的功能,支持指定连接名称、设备ID或连接ID进行路由。

  • b7b6330 2026-07-05 20:11

同 Skill 集合

.skills/adding-models/SKILL.md
src/skills/builtin/acquiring-skills/SKILL.md
src/skills/builtin/context-doctor/SKILL.md
src/skills/builtin/converting-mcps-to-skills/SKILL.md
src/skills/builtin/creating-mods/SKILL.md
src/skills/builtin/creating-skills/SKILL.md
src/skills/builtin/customizing-commands/SKILL.md
src/skills/builtin/customizing-statusline/SKILL.md
src/skills/builtin/dispatching-coding-agents/SKILL.md
src/skills/builtin/editing-letta-code-desktop-preferences/SKILL.md
src/skills/builtin/finding-agents/SKILL.md
src/skills/builtin/generating-mod-envs/SKILL.md
src/skills/builtin/image-generation/SKILL.md
src/skills/builtin/initializing-memory/SKILL.md
src/skills/builtin/letta-guide/SKILL.md
src/skills/builtin/managing-shared-memory/SKILL.md
src/skills/builtin/migrating-memory/SKILL.md
src/skills/builtin/modifying-the-harness/SKILL.md
src/skills/builtin/scheduling-tasks/SKILL.md
src/skills/builtin/self-configuration/SKILL.md
src/skills/builtin/syncing-memory-filesystem/SKILL.md

元信息

文件数
0
版本
f010e27
Hash
bb9b8665
收录时间
2026-07-05 20:11

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-04 07:26
浙ICP备14020137号-1 $访客地图$