Skip to main content

Overview

This example deploys a daily news-agent built with meshagent process. The agent works across three entry points:
  • chat
  • email
  • a scheduled queue job
Because different users will want their own mailbox, recipient address, and topics, this example uses a ServiceTemplate so those values can be provided at deploy time. Use this pattern when you want one agent that:
  • users can chat with in the room
  • can receive or send email through a mailbox
  • can run a daily scheduled digest job
  • keeps one shared identity, tool setup, and thread model across all of those flows
In this example, the scheduled digest runs at 17:30 UTC, which is 10:30 AM Pacific Daylight Time on March 16, 2026. When Pacific time returns to standard time, 10:30 AM PT would require 18:30 UTC.

Prerequisites

  • MeshAgent CLI installed and signed in with meshagent setup
  • permission to create a mailbox for the agent, or help from a project admin

Step 1: Create the configuration file

This configuration defines a ServiceTemplate with:
  • one multi-channel agent
  • three user-provided variables: the mailbox address, the digest recipient, and the topics to cover
  • a container that seeds editable rules into room storage and then starts the agent with meshagent process join
Create a file called meshagent.yaml and copy the example:
kind: ServiceTemplate
version: v1
metadata:
  name: news-agent
  description: "Daily news agent with chat, email, and scheduled digest delivery"
  annotations:
    meshagent.service.id: "news-agent"
    meshagent.service.readme: "Daily AI news agent that users can chat with, email, and schedule for daily digests."
agents:
  - name: news-agent
    description: "A unified news agent"
    annotations:
      meshagent.agent.type: "ChatBot"
      meshagent.chatbot.threading: "default-new"
      meshagent.chatbot.thread-list: ".threads/news-agent/index.threadl"
      # 17:30 UTC is 10:30 AM Pacific Daylight Time on March 16, 2026.
      # Use 18:30 UTC during Pacific Standard Time.
      meshagent.agent.schedule: '{"schedule":"30 17 * * *","queue":"news-updates","name":"DailyAINews","payload":{"prompt":"Generate and send the daily news briefing. Follow your rules."}}'
variables:
  - name: email
    type: email
    description: "Choose an email address for the agent (for example, news@mail.meshagent.com)."
  - name: send_to_email
    type: email
    description: "Choose the recipient address for the daily digest."
  - name: report_topics
    description: "Enter the topics the agent should cover in the daily digest."
container:
  image: "us-central1-docker.pkg.dev/meshagent-public/images/cli:{SERVER_VERSION}-esgz"
  command: /bin/bash /var/start.sh
  environment:
    - name: MESHAGENT_TOKEN
      token:
        identity: news-agent
        api:
          livekit: {}
          queues:
            list: true
          messaging:
            broadcast: true
            list: true
            send: true
          database:
            list_tables: true
          sync: {}
          storage: {}
          containers:
            logs: true
            use_containers: true
          developer:
            logs: true
          agents:
            register_agent: true
            register_public_toolkit: true
            register_private_toolkit: true
            call: true
            use_agents: true
            use_tools: true
            allowed_toolkits: null
  storage:
    room:
      - path: /data
        read_only: false
    files:
      - path: /var/start.sh
        text: |
          #!/bin/bash
          set -e

          mkdir -p /data/agents/news-agent

          if [ ! -f /data/agents/news-agent/news-agent-rules.md ]; then
            cat > /data/agents/news-agent/news-agent-rules.md <<'EOF'
          # Shared news agent rules
          # Edit this file to change the topics or curation preferences for future digests.
          You create curated AI news reports for users.
          Cover the user's topics of interest: {{report_topics}}.
          Focus on the most important developments from the last 24 hours unless the user asks for another timeframe.
          Include direct source links whenever possible.
          EOF
          fi

          if [ ! -f /data/agents/news-agent/process-rules.md ]; then
            cat > /data/agents/news-agent/process-rules.md <<'EOF'
          # Process-specific rules
          You are a newsroom assistant that works across chat, email, and scheduled jobs.
          When asked to send the daily briefing, email the digest to {{send_to_email}} using the mail toolkit.
          Save the full report to storage at news/YYYY/MM/DD/ai-news-YYYY-MM-DD.md.
          Do not include the full saved report in the email body unless the user asks for it.
          EOF
          fi

          exec /usr/bin/meshagent process join \
            --agent-name=news-agent \
            --threading-mode=default-new \
            --thread-dir=".threads/news-agent" \
            --channel=chat \
            --channel=mail:{{email}} \
            --channel=queue:news-updates \
            --require-web-search \
            --require-storage \
            --rule="You are a daily AI news agent. Use web search to find the most important AI news from the last 24 hours, include source links, and produce clear briefings." \
            --room-rules="agents/news-agent/news-agent-rules.md" \
            --room-rules="agents/news-agent/process-rules.md"

Next, validate the template before deploying:
meshagent service validate-template --file meshagent.yaml

How it works

One multi-channel agent, several entry points

This template runs one news-agent with:
  • a chat channel for interactive conversation
  • a mail:{{email}} channel for inbound and outbound email
  • a queue:news-updates channel for scheduled digest work
Instead of coordinating a separate ChatBot, MailBot, and Worker, the same multi-channel agent handles all three flows.

User-provided variables

Because this is a ServiceTemplate, three values are left for the user to fill in:
  • email — the mailbox address for the agent
  • send_to_email — where the daily digest should be sent
  • report_topics — the topics the daily digest should cover
These appear as {{email}}, {{send_to_email}}, and {{report_topics}} inside the template. At deploy time, meshagent service create-template or Powerboards substitutes the actual values.

Scheduled digest

The meshagent.agent.schedule annotation creates a scheduled task for the agent:
  • the schedule runs at 30 17 * * *
  • MeshAgent sends the configured payload into the news-updates queue
  • the same multi-channel agent receives that queued message through --channel=queue:news-updates
That is how the daily digest is scheduled without introducing a separate worker runtime.

Editable rules in room storage

The container command runs a small start.sh bootstrap script first. On first boot, that script seeds editable rules files into room storage under agents/news-agent/:
  • news-agent-rules.md holds the shared news curation guidance and starts with the chosen {{report_topics}}
  • process-rules.md adds process-specific instructions such as where to send the digest and where to save the full report
Because the script only creates those files if they do not already exist, users can edit them later without losing changes on restart or redeploy.

Container command

After seeding the rules files, the script runs:
meshagent process join ...
That one command starts the agent with:
  • chat, mail, and queue channels
  • web search for research
  • storage for saving the full report
  • room-editable rules loaded from room storage
The chat-facing annotations and --thread-dir ".threads/news-agent" settings keep the chat UI thread-aware while still letting mail and queue work route into the same agent.

Participant token and permissions

The environment section injects a MESHAGENT_TOKEN with the API scopes this service needs for messaging, storage, queue handling, and agent/tool registration.

Step 2: Create the mailbox

Create the mailbox before you deploy. Replace the sample address with the mailbox you want the agent to use:
meshagent mailbox create \
  --address news-agent@mail.meshagent.com \
  --room myroom \
  --queue news-agent@mail.meshagent.com
By default, the mailbox accepts email from room members. Add --public if you want it to accept email from anyone.

Step 3: Deploy the template

Deploy the template, providing the mailbox, recipient address, and topics you want this news agent to use:
meshagent service create-template \
  --file meshagent.yaml \
  --value email=news-agent@mail.meshagent.com \
  --value send_to_email=you@example.com \
  --value report_topics="AI policy, foundation models, chips, and startup funding" \
  --room myroom

Step 4: Try it out

Open MeshAgent Studio or Powerboards and navigate to your room. From there you can:
  • chat with news-agent and ask for a briefing on demand
  • send email to the configured mailbox
  • wait for the scheduled digest to run automatically at 17:30 UTC
Because this is one multi-channel agent, those flows all share the same identity, tools, and thread model.

Step 5: Make it shareable via Powerboards

Because this is a ServiceTemplate, it is a good fit for one-click installation flows.
  1. Push your meshagent.yaml file to a GitHub Gist.
  2. Copy the Raw URL for that file.
  3. Build an install link with https://app.powerboards.com/install?url=...
When someone opens that link, Powerboards can prompt for the same email, send_to_email, and report_topics values and then deploy the service into their room.