Skip to content
kobiakov.dev
KI & Tools

Aimash — KI-Google-Ads-Manager (Telegram)

Ein Telegram-Bot, der Google Ads in normaler Sprache verwaltet — aber nie eigenmächtig. Jede Änderung an Budget, Gebot oder Keywords wird als 'vorher → nachher'-Diff gezeigt und erst nach deiner Bestätigung ausgeführt. Multi-Modell-KI, Keyword-Recherche, RSA-Anzeigentexte und tiefe .xlsx- / Google-Sheets-Reports — ein produktiver Kundenbuild mit ~110k Zeilen Python und 2.030 automatisierten Tests hinter dem Chat.

Zeitraum

2025

Rolle

Lead Engineer

Confirm-gate

Every change

Swappable

AI models

~21k LOC

Codebase

Technisches Ergebnis

Ads tasks in seconds via chat · zero unapproved changes

Ehrliches Fazit

Confirm-Gate bei jeder Änderung · vollständiges Audit-Log · 2.030 Tests

Problem

Google Ads von Hand zu betreuen ist langsam und fehleranfällig, und die meisten 'KI'-Tools optimieren autonom — sie bewegen echtes Geld, bevor du prüfen kannst. Werbetreibende wollen das Tempo der Automatisierung, ohne die Kontrolle über ihr Budget abzugeben.

Die Herausforderung

Einen KI-Assistenten bauen, der Google-Ads-Arbeit per Chat in natürlicher Sprache (RU/EN) ausführt und trotzdem dem Menschen die Kontrolle lässt: Jede Mutation muss als vorher → nachher angezeigt und bestätigt werden, alle Geheimnisse müssen verschlüsselt bleiben, und nichts darf versehentlich ein Live-Konto berühren.

Die Lösung

Aimash ist ein Bot in Python 3.12 / aiogram, über die Google Ads API auf MCC-Ebene angebunden. Ein OpenRouter-LLM übersetzt Befehle in typisierte Pydantic-Tool-Calls; Lesezugriffe laufen sofort, während jeder Schreibzugriff zu einem Vorschlag wird, der mit vorher → nachher-Diff und ✅/❌-Buttons in PostgreSQL gespeichert wird — ausgeführt erst nach Freigabe und im Audit-Log protokolliert. Dazu Keyword-Recherche mit KI-Intent-Clustering, RSA-Anzeigentexte mit Prüfung je Element und tiefe Zeitraum-Vergleichsreports als Excel oder Google Sheets. Selbst das LLM wurde per Messung gewählt: Ein A/B-Benchmark im Repo ergab DeepSeek ≈ Claude beim Function-Calling bei ~13× geringeren Kosten, mit Claude als automatischem Fallback.

Live-Funktionen

Sieh, was der Bot kann

Eine originalgetreue Nachbildung der Aimash-Oberfläche, gebaut aus den echten Telegram-Nachrichten des Bots. Jede Änderung wird vorgeschlagen, als „vorher → nachher“ angezeigt und erst nach deiner Freigabe ausgeführt.

Telegram

aiogram 3 · RU/EN-Chat

LLM-Router

OpenRouter · DeepSeek, Fallback Claude

Tool-Schemas

Pydantic · Allow-List im Code

Confirm-Gate

einmalige confirmation_id · ✅ / ❌

Google Ads API

v24 · MCC-Ebene

Jede Anfrage läuft durch typisierte Schemas und ein Confirm-Gate, bevor sie ein Live-Konto berühren kann — vier ständige Leitplanken überwachen jeden Schritt.

Fail-closed Konto-Allow-List 3-stufige Secret-Redaction Audit-Log in PostgreSQL API-Quota-Gate bei 95 %

Sprich mit deinem Konto

Befehle in normaler Sprache — Statistiken, Reports und Änderungen, ohne Dashboards.

A
Aimashbot · online
Du
show me stats for the last 30 days
Aimash · Bot
📊 Account …8841 · 30 d. Impressions: 128 400 Clicks: 5 312 (CTR 4.14%) Cost: 4 187.20 Avg. CPC: 0.79 Conversions: 213 Value: 18 940.00

Confirm-Gate bei jeder Änderung

Die KI schlägt einen vorher → nachher-Diff vor und wartet auf dein ✅. Ohne das passiert nichts.

A
Aimashbot · online
Du
raise the Search Spring budget by 20%
Aimash · Bot
📝 Draft change Campaign "Search Spring" — budget: 50.00 → 60.00 (+20%) Confirm?
Aimash · Bot
✅ Done. Budget updated → 60.00
Bestätigen Abbrechen

KI-Anzeigentexte (RSA)

Erzeugt Titel und Beschreibungen innerhalb der Google-Limits, einzeln geprüft.

A
Aimashbot · online
Du
/rsa Search Spring
Aimash · Bot
✍️ Headline 3/8 · 27/30 · ✅ approved "Same-day flower delivery" 📋 Search Spring / Bouquets
Aimash · Bot
📋 RSA curation summary Headlines approved: 5/8 Descriptions approved: 3/4 ✅ ready to create

Keyword-Recherche

Suchvolumen und KI-Intent-Cluster, als .xlsx exportierbar.

A
Aimashbot · online
Du
/keywords flower delivery
Aimash · Bot
🔍 Keywords — flower delivery Ideas: 312, clusters: 7 Transactional (24) • buy flowers online — 8 100/mo • order roses delivery — 4 400/mo Commercial (18) • flower delivery near me — 6 600/mo …full table in the .xlsx

Tiefe Reports

Zeitraum-Vergleich, exportiert als Excel oder Google Sheets.

A
Aimashbot · online
Du
/export 30
Aimash · Bot
📈 Deep report · 30 d vs prev 30 d Cost: 4 187 → 3 910 −6.6% Conv: 188 → 213 +13% CPA: 22.27 → 18.34 −18%
report.xlsxGoogle Sheets

Technische Highlights

Confirm-gate architecture: the AI proposes a before → after diff for every mutation and only executes after an explicit "yes" — no autonomous spending

Multi-model LLM via OpenRouter (DeepSeek / Claude / GPT-4o) — the model is swappable per task, never locked to one vendor

Pydantic tool schemas: the model fills typed forms that are validated before any Google Ads call — it can never invoke arbitrary SDK methods

Full audit log: who, when, what, before → after and the result of every action are persisted in PostgreSQL

Secrets encrypted at rest (Fernet); tokens never appear in code, logs or stderr; fail-closed account allow-list

Keyword research via the Keyword Plan API with AI intent-clustering, plus RSA ad-copy with per-element review and .xlsx / Google Sheets reports

Systemarchitektur

Python 3.12 · aiogram 3.x (async bot)

OpenRouter (multi-model LLM)

Google Ads API v24 (GAQL + mutations)

SQLAlchemy + Alembic + PostgreSQL

Pydantic tool schemas (function calling)

APScheduler (reports & anomaly alerts)

openpyxl + Google Sheets API

Fernet-encrypted secrets · audit log

Docker + GitHub Actions CI (ruff · mypy · pytest)

Kerntechnologien

Python 3.12aiogram 3.xGoogle Ads APIOpenRouter LLMPostgreSQL
Share: