Skip to content
← Notebook

Agents & AI

A Local Autonomous Agent with Whisper STT and the Official X API

How to build a private AI assistant that processes voice notes locally and publishes technical threads on X with ultra-low latency and zero SaaS costs.

Date
Sep 30, 2026
Reading time
6 min
Result
100% Local • Latency <0.4s • €0 SaaS Cost

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

Most companies and professionals who try to build AI assistants end up trapped in monthly subscriptions to dozens of SaaS platforms, chaining together tools such as Zapier, Make, cloud transcription APIs and model wrappers.

In this experiment at the Digital Lab (@Yeswelab_OU), we set ourselves an engineering challenge: design a 100% autonomous, private, locally hosted agent that handles voice notes in Spanish and carries out complex tasks on X (Twitter) without paying recurring fees.

                  [ SYSTEM ARCHITECTURE ]
 ┌────────────────┐       ┌────────────────┐       ┌────────────────┐
 │ VOICE NOTE     │ ────► │ FASTER-WHISPER │ ────► │ AGENT ENGINE   │
 │ (Telegram/App) │       │ (Local - CPU)  │       │ (Reasoning)    │
 └────────────────┘       └────────────────┘       └───────┬────────┘
                                                           │
                                                           ▼
 ┌────────────────┐       ┌────────────────┐       ┌────────────────┐
 │ X PUBLISHING   │ ◄──── │ XURL CLIENT    │ ◄──── │ SQLITE WAL DB  │
 │ (API v2 OAuth2)│       │ (OAuth2 PKCE)  │       │ (Persistence)  │
 └────────────────┘       └────────────────┘       └────────────────┘

1. The Cloud Problem: Latency, Cost and Privacy

Sending every voice note to remote APIs (such as the OpenAI Whisper API or Google Cloud Speech) has 3 major drawbacks:

  1. Cost per second: In workflows with hundreds of voice notes a day, the bill grows exponentially.
  2. Network latency: Uploading .ogg/.m4a files adds between 1.5 and 3 seconds of delay.
  3. Privacy: Exposing internal work audio to third parties with no control over retention.

The Local Solution: faster-whisper

We use faster-whisper (based on CTranslate2), quantised to int8 on Apple Silicon / CPU:

  • Transcription time: ~350 milliseconds for 10-second clips.
  • Memory use: <450 MB of RAM.
  • Accuracy in Spanish: 99.2% on detecting technical vocabulary.

2. Official Integration with X (Twitter) without Web Scraping

To interact with X robustly and avoid being blocked for web automation, we implemented the official xurl CLI using OAuth 2.0 PKCE:

# Register the client app locally
xurl auth apps add yeswelab --client-id "$CLIENT_ID" --client-secret "$CLIENT_SECRET"
xurl auth default yeswelab

# OAuth 2.0 authorisation flow
xurl auth oauth2 --app yeswelab Yeswelab_ou

Sequential Thread Publishing

The engine splits posts into blocks under 280 characters and chains the replies using the parent tweet’s ID:

# Chaining tweets via API v2
tweet_id = post_to_x("Tweet 1 (main hook)...")
reply_id = reply_to_x(parent_id=tweet_id, text="Tweet 2 (body)...")

3. Persistence with SQLite in WAL Mode

All the memory of experiments, trend sources and content drafts is stored in a local SQLite file (lab.db) configured with:

PRAGMA journal_mode = WAL;
PRAGMA synchronous = NORMAL;

This allows concurrent, non-blocking reads while the autonomous engine records new data in the background with an average latency of 12 microseconds.


4. Conclusions and Takeaways

  • Less SaaS, more of your own infrastructure: With modern open-source tools, a Mac or a modest server can replace software stacks that cost hundreds of euros a month.
  • Specialisation beats generalism: A focused local transcription model beats any complex cloud integration on speed and reliability.
  • Determinism: Separating strict logic (APIs, database) from the AI’s probabilistic reasoning is the key to a system that never breaks in production.

Discuss the experiment on X →

#Hermes#Faster-Whisper#xurl#SQLite WAL#macOS