Une phrase suffit : l'IA comprend, choisit la meilleure version, et prévient quand c'est prêt. One sentence is enough: the AI understands, picks the best version, and pings you when it's ready.
Bot Telegram personnel qui transforme une demande en langage naturel (« Dune 2021 ») en média prêt à être regardé. Deux passes d'IA — comprendre l'intention, puis choisir la meilleure version — orchestrent la recherche, la récupération et la notification de fin, sans aucune action manuelle. Personal Telegram bot that turns a natural-language request (“Dune 2021”) into ready-to-watch media. Two AI passes — understand the intent, then pick the best version — orchestrate the search, retrieval and completion notification, with zero manual action.
Le pitch
J'envoie « Dune 2021 » ou « The Bear S03E04 » à un bot Telegram. ~30 secondes plus tard, je reçois une notification : le média est prêt à regarder, dans la meilleure qualité disponible. Aucune recherche, aucun choix manuel, aucune interface à manipuler — juste une phrase.
Le parcours d'une demande
- Compréhension — une première IA lit le message en langage naturel et en extrait une intention structurée (titre, film/série, année, saison/épisode). Si la demande est ambiguë, elle pose une question de clarification.
- Recherche — interrogation de plusieurs catalogues de sources, avec repli automatique si le premier ne renvoie rien.
- Sélection — une seconde IA classe les résultats selon des règles métier (qualité ≥ 1080p, langue, pistes vidéo/audio, fiabilité) et retient la meilleure version.
- Récupération — le média est envoyé vers l'infrastructure distante et sa progression est suivie en arrière-plan.
- Réponse — dès que c'est terminé, une notification arrive sur Telegram.
Ce qui en fait un projet « AI automation »
Le cœur du projet, ce n'est pas un appel à un LLM, c'est l'orchestration :
- Deux rôles d'IA distincts — extraction d'intention multi-tours (function-calling, le modèle décide seul s'il doit répondre ou poser une question) et prise de décision sur des candidats réels via un prompt de scoring dédié.
- Frontière LLM tolérante — les sorties du modèle sont normalisées et validées avant d'entrer dans le domaine métier (jamais de crash sur une réponse mal formée).
- Maîtrise des coûts — prompt caching, budgets de tokens calibrés, et un benchmark reproductible pour arbitrer entre différents LLM.
- Bout-en-bout autonome — du message reçu à la notification, zéro étape manuelle.
Ingénierie
- Architecture en couches : domain (types purs) → adapters (I/O) → services (métier) → interface Telegram. Chaque morceau testable isolément.
- 230 tests unitaires entièrement mockés (< 2 s), verts sur chaque PR.
- CI/CD complet : tests + auto-merge sur PR, déploiement automatique sur push, healthchecks conteneur.
- Production réelle : tourne 24/7 en conteneurs
Dockersur VPS, derrière un reverse proxy et un accès protégé, sans port public exposé (long-polling).
Statut
En production, 24/7. Le code est désormais open-source (MIT) sur GitHub. Voir aussi mon expérience associée.
The pitch
I send “Dune 2021” or “The Bear S03E04” to a Telegram bot. ~30 seconds later, I get a notification: the media is ready to watch, in the best available quality. No search, no manual choice, no interface to operate — just a sentence.
A request's journey
- Understanding — a first AI reads the natural-language message and extracts a structured intent (title, film/series, year, season/episode). If the request is ambiguous, it asks a clarifying question.
- Search — querying several source catalogs, with automatic fallback if the first returns nothing.
- Selection — a second AI ranks results against business rules (quality ≥ 1080p, language, video/audio tracks, reliability) and keeps the best version.
- Retrieval — the media is sent to the remote infrastructure and its progress tracked in the background.
- Response — as soon as it's done, a notification lands on Telegram.
What makes it an “AI automation” project
The heart of the project isn't an LLM call, it's the orchestration:
- Two distinct AI roles — multi-turn intent extraction (function-calling, the model decides on its own whether to answer or ask a question) and decision-making over real candidates via a dedicated scoring prompt.
- Tolerant LLM boundary — model outputs are normalized and validated before entering the business domain (never a crash on a malformed response).
- Cost control — prompt caching, calibrated token budgets, and a reproducible benchmark to arbitrate between different LLMs.
- Autonomous end-to-end — from message received to notification, zero manual step.
Engineering
- Layered architecture: domain (pure types) → adapters (I/O) → services (business) → Telegram interface. Each piece testable in isolation.
- 230 unit tests fully mocked (< 2 s), green on every PR.
- Full CI/CD: tests + auto-merge on PR, automatic deployment on push, container healthchecks.
- Real production: runs 24/7 in
Dockercontainers on a VPS, behind a reverse proxy and protected access, no public port exposed (long-polling).
Status
In production, 24/7. The code is now open-source (MIT) on GitHub. See also my related experience.