Skip to content
← Notebook

Agents & AI

Mortadelo: a Hermes agent running the lab 24/7 from a MacBook

How Mortadelo, Yeswelab's Hermes agent, works: it researches, writes, edits videos with a cloned voice, publishes and replies on its own, with state in SQLite WAL and guardrails against loops.

Date
Oct 17, 2026
Reading time
12 min
Result
5 autonomous tasks in production • Local voice and transcription • State in SQLite WAL • Anti-loop firewall

Translated from the Spanish original. The code, data and READMEs on GitHub are in Spanish.

Most people use AI by opening a chat. In the lab we wanted to test something else: can an agent take over the day-to-day of a digital lab (researching, writing, editing videos, publishing and replying) with the human only giving voice commands and approving?

To find out, Mario set up an agent on his MacBook (Apple Silicon) with Hermes Agent, Nous Research’s open-source harness. We named it Mortadelo. This experiment describes how it’s built, what it does every day and what we’ve learned running it.

Security note. We describe the architecture and the decisions, not the configuration. We deliberately leave out paths, ports, identifiers, command channels and exact thresholds: they’re exactly what someone would need to attack the agent or impersonate whoever controls it.

1. The hypothesis: from using a chat to running an agent

Three starting conditions:

  • Voice commands from the phone. Mario doesn’t open the terminal: he talks to Mortadelo with voice notes in Spanish while walking or working, through a private messaging channel that only responds to his account.
  • Always on. Hermes runs as a system service, supervised by macOS, with its gateway listening to the channel and its scheduler launching tasks.
  • No paying for closed platforms. Transcription, voice, video and state live locally. The only things in the cloud are the language model, a Google Gemini with a one-million-token window, and the APIs of the networks it publishes to.

2. The architecture

[Mario: voice notes and approvals from the phone]
        │  private, paired channel
        ▼
[Hermes Agent: gateway as a macOS service]
        ├── Brain: Gemini (in the cloud) + persistent agent and user memory
        ├── Ears: local faster-whisper, Spanish transcription without leaving the machine
        ├── Voice: local voice cloning with an open model, GPU-accelerated
        ├── Eyes: headless Chrome to read and capture pages
        ├── Workshop: FFmpeg + Pillow to edit vertical video
        ├── Working memory: SQLite in WAL mode
        └── Hands: the official X API and the Astro website build

Transcription and publishing on X are covered in detail in the previous experiment, a local autonomous agent with Whisper and the X API. Here we focus on the full operation.

3. Context economy: the real limit isn’t intelligence

In long sessions, the problem isn’t that the model “doesn’t know”, it’s that the context fills up. Mortadelo applies three rules:

  • Rationed context. No dumping whole documents if a fragment will do.
  • Automatic compaction when the session grows.
  • On-demand skills. Each tool’s instructions are only loaded when the task needs them (progressive disclosure).

It’s the same lesson as context engineering: an agent that loads everything “just in case” is more expensive, slower and makes more mistakes.

A small rule that makes a big difference: when Mario sends an audio message, Mortadelo acts without repeating the transcript in the chat. It’s written in its user memory. It saves tokens and noise.

4. Voice: input and output, locally

Input. Voice notes are transcribed on the Mac itself with faster-whisper configured for Spanish. The audio never leaves the machine.

Output. For the videos, Mortadelo narrates with Mario’s voice, cloned locally with an open zero-shot cloning model (OmniVoice), on a local app with its own API and GPU acceleration on Apple Silicon. Three decisions matter more than the parameters:

  • It’s Mario’s voice, with his consent, and for his own content. Cloning someone else’s voice without permission isn’t an option.
  • Sample quality over quantity. A clean, well-mastered clip, with the reference text precisely aligned, gives better prosody than a long, noisy recording.
  • An “AI-generated” label on every piece. In the EU, synthetic content that could pass as real must be identified, and it’s also the honest thing to do.

The agent wrote its own skill for handling the voice service: it documents how to prepare the audio, how to call the service and which profiles to use. Next time it doesn’t have to rediscover it.

5. Vertical news videos with no editor

Every day, Mortadelo produces a short vertical (9:16) video with technology news:

  1. It picks 3 to 5 news stories of the day from Spanish media, alternating sources and never repeating one already used.
  2. It opens each story in headless Chrome at mobile size and captures the real headline, highlighted.
  3. It writes the script with a hook and narrates it with the cloned voice.
  4. It extracts word-by-word timestamps with Whisper to know at which millisecond it says “one”, “two”, “three”…
  5. It edits the video with FFmpeg at 30 fps, with a Ken Burns effect synchronised with the voice.
  6. It publishes on X, crediting each outlet and with the AI-generated content label.

Synchronising by timestamps is the detail that stands out most: each image cut lands right on the word, with no manual editing.

6. State outside the model: SQLite in WAL mode

The model forgets between runs; the database doesn’t. All operational state lives in an SQLite file in WAL mode, the same choice we measured in SQLite WAL vs PostgreSQL. Five pieces:

  • Trends and experiments: what has been researched and which articles have been written for the website.
  • Posts with approval: each prepared thread reaches Mario’s phone as a preview card for him to approve before its scheduled time.
  • News history: every story used is recorded so that it never repeats on following days.
  • Reply log: who has received a reply and in which conversation (see point 7).
  • Weekly metrics to adjust the following week’s topics.

7. Guardrails: what we learned the hard way

Bot-to-bot loops. X is full of automated accounts that reply to any reply. Two agents replying to each other burn model tokens and API credits endlessly. The fix wasn’t a prompt but a deterministic guard script that runs before the model gets involved:

  • a limit on replies per user and per period;
  • a single reply per conversation;
  • a list of detected automated accounts;
  • and if there are no new human mentions, the task stops at the first step at zero cost.

The emoji that counts double. The X API counts many emojis and symbols as two characters. Texts that measured about 270 characters in Python were rejected for exceeding the limit. Now the scripts calculate the weighted length before publishing and, if the text doesn’t fit, they move the source mentions to a reply.

Deterministic where it matters. The general pattern, the same as in our hybrid architecture: the model decides and writes; the scripts count, filter, deduplicate and publish.

8. The five tasks it does on its own

Task When What it does
Exploration Weekday mornings Researches a technical trend, writes the article for the website with two routes (open source at zero cost and a fast track with SaaS), generates two infographics and prepares the thread for approval
Publishing Weekday mornings If the thread is approved and pending, publishes it with its infographic and rebuilds the website
News video Every day The day’s news with no repeats, cloned voice, editing and publishing on X
Conversation Every afternoon Filters bots and loops, and only replies to real human questions (a couple per pass at most)
Analytics Weekly Metrics from X and the database to adjust topics

9. Security: the agent reads the internet, and the internet writes back

An agent that reads news and mentions is receiving text from strangers. Any page or reply can carry hidden instructions (prompt injection). The principles we apply, without going into the configuration:

  • One boss only. The command channel only responds to Mario’s account.
  • What it reads isn’t an order. Content from websites and mentions is treated as data.
  • Credentials kept out of the model’s context, as in credential confinement.
  • Bounded external actions. The agent publishes on our own accounts and within limits; it doesn’t send money, doesn’t delete and doesn’t message third parties privately.
  • No operational details in public. That’s why this article doesn’t include them.

10. Verdict

Yes: a local agent can run a lab’s day-to-day, but not because it’s autonomous: because it’s well tethered. What makes it reliable isn’t the model: it’s the state in SQLite, the deterministic scripts around it, the skills it writes for itself and the guardrails that cut loops before they cost money.

What still needs Mario: judgement (which topics, which tone), approval of whatever goes out under his name and with his voice, and checking now and then that the guardrails still work.

How to start something similar

  1. Install Hermes Agent and choose the model: we explain it step by step, at home or in the cloud and with a local or paid model, in how to install Hermes Agent. If you’re unsure what task to give it, see AI agent use cases for business.
  2. Before connecting any channel, configure security: command approval, pairing and container isolation.
  3. Start with a single scheduled task that doesn’t publish anything, it just reports.
  4. Move state out of the model and into a database from day one.
  5. Add publishing only with human approval and deterministic limits.

Want to know whether an agent like this can handle your company’s tasks? Commission the experiment.

Discuss the experiment on X →

#Hermes Agent#Gemini#faster-whisper#OmniVoice#FFmpeg#Chrome headless#SQLite WAL#X API v2#Astro