← Back to Projects

Hermes AI: Autonomous Telegram Community Engagement System

> Private repository. Available for code review on request.

▍ Problem Space

Businesses relying on Telegram for community engagement face fundamental scalability constraints:

  • Manual Moderation Bottleneck: Human operators cannot maintain 24/7 engagement across multiple channels.
  • Anti-Ban Arms Race: Telegram actively detects and bans automated accounts. Naive implementations get flagged within hours.
  • Context-Blind Responses: Simple keyword-triggered bots produce generic replies that damage brand perception.
  • Account Infrastructure Fragility: Managing multiple accounts with distinct device fingerprints requires specialized tooling.

▍ Architecture

CONTENT PIPELINE
  Channel Monitor → Context Extractor → AI Comment Generator (Gemini/Claude)
          ↓
  ANTI-BAN LAYER
  Rate Limiter | Device Fingerprinting | Behavioral Jitter | FloodWait Handler
          ↓
  ACCOUNT POOL
  Session Management | Health Tracking | Rotation Logic | Quarantine
          ↓
  TELEGRAM API (MTProto via Grammers)

Key Components:

  • Channel Monitor: Real-time event stream from target Telegram channels via MTProto.
  • Context Extractor: Semantic analysis of post content, thread history, and channel tone.
  • AI Comment Generator: LLM-powered comment synthesis with persona-specific voice and tone matching.
  • Anti-Ban Layer: Per-account rate limiters, device fingerprint matching, humanized timing jitter, FloodWait handling.
  • Account Pool: RAII-managed pool with health tracking, automatic rotation, and quarantine-on-warning.

▍ Key Engineering Decisions

Problem
Telegram detects automation by correlating device metadata with behavioral patterns. Mismatched fingerprints trigger immediate bans.
Solution
Device fingerprints derived from purchased TData session files. The system parses session metadata and constructs API client options matching the original device exactly.
Alternative Rejected
Random fingerprint generation — Produces statistically detectable patterns.
Problem
Sending messages at fixed intervals is a trivial detection signal.
Solution
Behavioral jitter engine: random delays from log-normal distribution, per-account rate windows with daily budget limits, mandatory cooldown periods.

▍ Tech Stack

Backend
Rust, Tokio, Grammers (MTProto), Axum
AI
Gemini/Claude via Antigravity Gateway
Data
PostgreSQL (event sourcing)
Anti-Ban
Custom rate limiter, device fingerprinting, behavioral jitter

▍ Demonstrated Competencies

Anti-Detection Engineering
Systems that survive adversarial platform detection through behavioral mimicry and fingerprint consistency.
LLM Integration
Production-grade AI content generation with context-aware prompting and multi-provider fallback.
Protocol Engineering
Direct MTProto implementation via Grammers, bypassing Bot API limitations.
Stateful Account Management
RAII-controlled resource pool with health tracking and graceful degradation.
Event-Driven Architecture
Real-time event processing with backpressure and fire-and-forget persistence.

Ready to build something like this?

Start a Project