ASK KNOX
beta
LESSON 330

Level 3: Messaging & Skills

Connect your agent to every chat platform you already use, then give it a library of reusable skills so it can actually do things when you message it.

7 min read·The Seven Levels of Agent Orchestration

Introduction

Your agent is running on a dedicated machine. It is available 24/7. But how do you actually talk to it?

If the answer is "SSH into the machine and run a script," you have not really changed your workflow — you have just moved the chat window to a different location. Level 3 fixes this: you connect the agent to the messaging platforms you already use, and you give it a library of skills it can execute when you send it a command.

After level 3, sending a task to your agent feels the same as sending a message to a teammate. You type in Discord or Telegram, the agent reads it, executes the right skill, and replies with results — from your laptop, your phone, or anywhere else.

Core Concept

The Messaging Layer

Agent Framework supports more than 15 messaging interfaces out of the box: Discord, Telegram, Slack, WhatsApp, Microsoft Teams, and others. The specific platform does not matter as much as the pattern: your agent is always listening on a channel, and you are always reachable on that channel.

The architecture is straightforward. The agent runs a background process that polls or webhooks into the messaging platform. When a message arrives in the configured channel, the agent:

  1. Reads the message content
  2. Classifies the intent (is this a command? a question? a data request?)
  3. Routes to the appropriate skill
  4. Executes the skill
  5. Replies in the same channel with the result

This is identical to how a Discord bot works — because it effectively is one. The difference is that your "bot" is backed by a full LLM that can interpret natural language commands and compose multi-step responses.

Why this changes everything: Once the messaging layer is live, you stop thinking about your agent as software you run. You start thinking about it as a teammate you message. That psychological shift — from "I need to SSH in and run a command" to "I'll just ask it" — is when adoption actually sticks.

The Skill Library

A is a named, reusable capability. It has a defined trigger (what input activates it), a defined execution path (what it does), and a defined output format (what it returns). Skills are the building blocks that let your agent do more than just chat.

Examples of common skills in a production agent:

Skill NameTriggerWhat It Does
web_search"search for X"Returns top 5 results with summaries
summarize_urlURL in messageFetches and summarizes the page
run_script"run X"Executes a named script and returns output
git_status"what's in flight"Shows open PRs and recent commits across repos
daily_brief"morning brief"Assembles health metrics and sends summary

The power of a skill library is composability. A single message — "give me a morning brief" — can chain multiple skills: check_bot_health, pull_overnight_trades, summarize_top_news, format_report. The agent orchestrates the chain; you just asked for the output.

Agent Gateway ships with 48+ skills across approximately 10 agent personas. Those skills range from blog post generation to trading bot health checks to Discord channel summaries. The skill library is what makes the agent useful across domains — without it, you have a conversational interface with nothing to converse about.

Open Skill Formats

One of the design decisions in the Agent Framework ecosystem is open skill formats — skills are defined in plain text files (typically YAML or Markdown), not compiled code. This means:

  • You can read and modify skills without understanding the agent's internal architecture
  • Skills can be shared across agents and teams without recompilation
  • The agent itself can generate new skills based on patterns it observes in your requests

Agent Gateway stores skills as Markdown files in ~/.config/agent/skills/. Each skill file defines what the skill does, when to use it, and what parameters it accepts. Claude Code can read these files and follow the instructions exactly. That is the "open" part — the format is human-readable and human-editable.

Practical Application

Here is a minimal Discord bot setup pattern for a Python-based persistent agent. This is the structural template — fill in your actual LLM calls and skill routing:

import discord
from discord.ext import commands

intents = discord.Intents.default()
intents.message_content = True

bot = commands.Bot(command_prefix="!", intents=intents)

@bot.event
async def on_ready():
    print(f"Agent online as {bot.user}")

@bot.event
async def on_message(message):
    if message.author == bot.user:
        return
    # Only respond in your designated channel
    if message.channel.id != YOUR_CHANNEL_ID:
        return

    user_input = message.content
    # Route to your skill dispatcher
    result = await dispatch_skill(user_input)
    await message.channel.send(result)

async def dispatch_skill(text: str) -> str:
    # Your LLM classifies the intent and routes to the right skill
    # This is where the orchestration model earns its cost
    ...

bot.run("YOUR_DISCORD_BOT_TOKEN")

For Telegram, replace discord with python-telegram-bot — the pattern is identical. The agent listens, classifies, dispatches, replies.

Critical operational detail: Add channel ID filtering immediately. Without it, your agent replies to every message in every channel it can see, which is both noisy and potentially expensive (every message triggers an LLM call).

Common Mistakes

Not filtering by channel. Your agent should only listen on designated channels. A single unguarded Discord bot can trigger on messages in every server it is invited to, burning API tokens on noise.

Treating skill libraries as code, not configuration. If adding a new skill requires a code change and a redeploy, your skill library will not grow. Skills should be text files the agent can read at runtime, so new capabilities can be added without touching the core agent process.

Building the messaging layer before having a stable agent core. The messaging layer is an interface to your agent's capabilities — if the agent cannot reliably do anything useful, the messaging layer just exposes that unreliability to more channels. Get the core working first, then open the interface.

No rate limiting. A persistent agent that responds instantly to every message in every channel is a DDoS against your own API budget. Add a per-user or per-channel rate limit from day one.

Summary

  • Level 3 connects your agent to messaging platforms (Discord, Telegram, Slack) so you can interact from any device
  • Agent Framework supports 15+ messaging interfaces out of the box
  • A skill library gives the agent reusable, named capabilities it can execute on command
  • Skills should be stored as readable text files — open formats that can be added without redeploying
  • Channel filtering and rate limiting are safety requirements, not optional polish
  • The psychological shift from "SSH to run a command" to "message my agent" is when adoption actually sticks

What's Next

The next lesson confronts the dark side of self-improving skill libraries: context rot. As your agent accumulates skills, unused ones start wasting tokens and degrading model attention. The Skill Curator pattern gives you a lifecycle strategy — active, stale, archived — to keep the library sharp.