One Agent, Three Doors: Running a Single AI Agent Across Telegram, Discord, and GitHub

10 minute read

I run one AI agent. It talks to me on Telegram, posts to a Discord community, researches on GitHub, and writes the blog post you are reading right now.

Not three agents. Not three integrations bolted together. One process, one memory, one set of skills — wearing three different faces depending on who it is talking to.

This is a write-up of how that works, what it costs to run, and the things that broke along the way. Most of the value here is in the failure modes, so if you are building something similar, skip to “What broke.”

Diagram: one Hermes agent core connected to three doors — Telegram as control plane, Discord as community surface, GitHub for research and code — with a cron scheduler feeding the same core
One process, one memory, three output contracts. The cron scheduler wakes the same agent that answers in chat.

The setup in one paragraph

Hermes Agent runs in a Docker container on a small VPS. It holds a long-lived gateway process that connects to messaging platforms, a cron scheduler that wakes it up on a timetable, and a directory of state — config, credentials, memories, skills, conversation history, and output archives. Everything durable lives in one mounted path. If I back that up, I have backed up the agent.

The three “doors” are just transports. The interesting part is that each door demands a different shape of output, and that shape is what makes the agent feel purpose-built for each audience.

Telegram: the control plane

Telegram is where I run the machine. It is my private DM with the agent — the equivalent of a root shell I can reach from my phone.

The workflow is dead simple: I type what I want, in natural language, and it happens. “What is my disk usage.” “Restart the gateway.” “Draft an email to the course list about X.” “Why did the cron job fail.”

Diagram: a command flows from Telegram through the gateway and guardrails into the agent loop and tool surface, with a dashed approval path looping back to the user, and a cron scheduler feeding the same agent loop
The control path. Note the dashed line: that is the seatbelt. Dangerous operations stop at the guardrail and wait for a human.

What makes this genuinely useful rather than a novelty:

Approval gates. The agent can execute shell commands, which is exactly as dangerous as it sounds. Dangerous operations return an approval prompt instead of executing — I tap approve or deny in the same chat. It drafts, I approve, it executes. I have never once wanted to disable this.

Cron jobs I can interrogate. My scheduled work runs through the same channel, so when something goes wrong I ask about it in the same place. That is worth more than any dashboard, because the conversation already has the context.

Voice and files. I can send a voice note and it gets transcribed. I can send a screenshot and it reads it. I can receive generated files back. All of it in one thread.

The mental model: Telegram is where I am the operator. Everything is addressed to me, formatted for me, and nothing goes out without my say.

Discord: the community surface

Discord is where the agent addresses other people. I run a server for my enterprise AI agents course, and one channel gets a weekly digest of what actually happened in agent infrastructure that week.

The same cron job that serves me produces this. Same research pass, same deduplication, same ranking. But the output contract is different, and this is the part people underestimate:

  • No internal metadata. My version tags each item with a suggested use — email, LinkedIn, course material. The community version drops that column entirely. Nobody needs to see my content calendar.
  • No local file paths. Early versions leaked paths like /opt/data/ai-content-ideas/... into the posted message. That is an information disclosure bug wearing the costume of a helpful note.
  • Links inline, not listed. One column carries [Title](url) markdown rather than a separate URL column. In Discord, a naked URL column looks like a spam dump.
  • Hard length discipline. Discord caps messages at 2,000 characters. Twenty items with commentary does not fit. The cap forces a real editorial decision about what earns inclusion.

Same agent, same research, radically different output — driven by the prompt, not by code branching.

One thing I got wrong here and will admit to: I initially tested the Discord job by triggering it manually while iterating. Each test posted to the live channel. If your community channel is the test environment, your community sees your debugging. Test against your own DM, promote to the channel once.

GitHub: deep research and the code surface

GitHub plays two roles.

As a research substrate. The weekly digest does not just scrape headlines. It maintains a rolling archive — every URL it has ever surfaced, across thousands of rows. Before each run it loads that archive and deduplicates against it. This is the difference between a news feed and a research process: the agent remembers what it already told you, so week twenty is not a rehash of week one.

That archive is are plain markdown tables in a git-adjacent directory. No vector database, no embeddings, no retrieval pipeline. At this scale, a regex over the archive is faster, cheaper, and completely debuggable. If you can read the file and understand the state, you have a better system than one that needs a stack trace.

As the destination for code. Once authenticated, the agent clones, branches, commits, and opens pull requests against my repos. Which brings me to the most useful thing I learned this month.

Hermes deliberately strips your GitHub token

I put GITHUB_TOKEN in the agent’s .env, restarted the container, and expected gh to just work. It did not.

The reason is a security feature, and a good one. From the agent’s subprocess-launching code:

# Tier-1 secrets: stripped from EVERY spawned subprocess unconditionally
_ALWAYS_STRIP_KEYS = frozenset({
    "GH_TOKEN",
    "GITHUB_TOKEN",
    ...
})

Every shell command the agent runs — including gh and git — gets an environment with your GitHub credentials surgically removed. This is designed to stop a compromised dependency from exfiltrating your credentials. It also means the obvious approach silently fails.

The fix is to authenticate the tool from disk rather than from the environment:

# Pipe the token from .env into gh's own credential store
grep '^GITHUB_TOKEN=' /opt/data/.env | cut -d= -f2- \
  | gh auth login --with-token

# Then point git at gh as its credential helper
gh auth setup-git

gh writes to ~/.config/gh/hosts.yml, and git asks gh for credentials on each operation. Neither needs the environment variable, so the stripping no longer matters.

Two follow-on lessons from that afternoon:

A single stray config line can break it. git config --global credential.helper "" — which I had set while “cleaning up” — silently reset the credential helper chain and broke private repo access, while public repos kept working and made it look fine. If private clone fails with could not read Username, check for an empty credential.helper entry before anything else.

Scope your token down. My first token came back with scopes including admin:enterprise, admin:org, admin:public_key, and admin:ssh_signing_key. That is not “access to my repos,” that is “permanent ability to add SSH keys to my account.” For an agent running unattended on a schedule, that is a bad trade. You want repo, and workflow only if it needs to touch Actions. Nothing else.

The harness is the product

A detail worth naming explicitly, because it is where most teams underinvest: almost none of what makes this work is the model.

The model is one component inside a loop. Everything that determines whether the thing is reliable is the scaffolding around it — which is what people mean by the harness.

Diagram: six harness layers — guardrails, context, tools, agent loop with the model as a small swappable chip, scheduler, and persistence
Six layers. The model sits inside layer 04 and is the only part you can swap with a config change.

Read it top to bottom:

  • Guardrails decide what the agent is not allowed to do without me. This layer earns its keep the first time it blocks something.
  • Context is what the agent knows before it starts working: skills written as markdown procedures, persistent memory, session history, project files. This is where almost all reliability is won or lost.
  • Tools are the hands — shell, files, web, GitHub.
  • The agent loop is the only place the model appears. Plan, call a tool, observe, repeat.
  • Scheduler turns a conversational agent into an operator that acts when nobody is watching.
  • Persistence is the boring layer that makes everything else durable: one mounted directory holding config, credentials, memories, skills, cron definitions and archives.

The practical consequence: I have swapped models twice on this setup without touching any other layer. If your agent’s behaviour is spread across prompt strings, glue code and provider-specific calls, that swap is a rewrite. If it lives in the harness, it is a config change.

The blog workflow: closing the loop

This post is the proof of concept. The workflow is:

  1. The agent clones the site repository.
  2. It writes the post as a file with the front matter the site expects.
  3. It commits to a branch and opens a pull request.
  4. I read it, edit it, and merge.

The agent does not push to main. Ever. Not because it is incapable, but because an unattended process with write access to a production branch is a liability that compounds weekly. Branch plus PR means the failure mode is a pull request I decline, not a broken site I discover from a reader.

That constraint is not a limitation of the tooling. It is the design.

What broke

The honest section. All of these are real, all of them cost me hours.

Unattended approval prompts hang forever. My first scheduled jobs wrote files using shell commands. The agent’s security layer flagged those commands for approval. But a cron job runs with no human present, so the approval prompt waited for an answer that never came, the job stalled, and nothing was delivered. Fix: inside scheduled jobs, use the file-writing tool, not shell redirection. Approval-gated operations are for interactive sessions.

Manually triggering a scheduled job can skip the next real run. I ran cronjob run repeatedly to test. Each manual trigger advanced the job’s next-run timestamp. The following day the scheduler believed it had already fired and skipped the tick entirely. Fix: test once, then leave it alone and let the scheduler do its job. If you must test repeatedly, test against a throwaway job.

Provider outages kill unattended runs silently. One Monday both jobs failed — not a config problem, but the model provider returning a 900-second timeout and then five consecutive stale responses. The jobs retried three times and gave up, and I found out by noticing the absence of something. Fix: configure a fallback provider so a primary outage degrades rather than fails, and treat “no output” as a signal worth alerting on.

The scheduler can miss ticks in containers. Twice, a job’s scheduled time passed with no run and no error. A stale lock file was the culprit. Fix: a small watchdog job that runs every five minutes and fires the real job if its window was missed. It is a boring five-line shell script and it has saved me more grief than any clever feature.

Why one agent instead of three

Because memory is the whole game.

Three separate bots would mean three sets of preferences, three sets of lessons learned, three places where I have to re-explain that my audience does not want a “Use” column. Every failure I describe above was learned once and encoded once, into a skill file the agent loads before any future run — regardless of which door the work comes through.

The agent that triages my inbox in the morning is the one that posts to Discord at nine, the one that researches on Monday, and the one that drafted this paragraph. When I teach it something, I teach all of it.

That is the actual argument for running an agent rather than a collection of scripts. Scripts do not get better at their job. This does, because every awkward correction I make gets written down and read back before the next attempt.


If you are building something similar — or if you are evaluating whether your team’s agents can survive contact with production — that is exactly the territory my course Build AI Agents for Enterprises covers. Reliability engineering, context architecture, evals, and the unglamorous operational details that decide whether an agent ships or stalls.

Comments