Aimash — AI Google Ads Manager (Telegram)
A Telegram bot that manages Google Ads in plain language — but never on its own. Every budget, bid or keyword change is shown as a 'before → after' diff and runs only after you approve it. Multi-model AI, keyword research, RSA ad-copy and deep .xlsx / Google Sheets reports — a production client build with ~110k lines of Python and 2,030 automated tests behind the chat.
Timeline
2025
Role
Lead Engineer
Confirm-gate
Every change
Swappable
AI models
~21k LOC
Codebase
Engineering outcome
Ads tasks in seconds via chat · zero unapproved changes
Honest impact
Confirm-gate on every mutation · full audit trail · 2,030 tests
Problem
Running Google Ads by hand is slow and easy to get wrong, while most 'AI' tools optimise autonomously — they move real money before you can check. Advertisers want the speed of automation without handing over the keys to their budget.
The Challenge
Build an AI assistant that executes Google Ads work from a chat in natural language (RU/EN), yet keeps a human in control: every mutation must be previewed as before → after and confirmed, all secrets must stay encrypted, and nothing may ever touch a live account by accident.
The Solution
Aimash is a Python 3.12 / aiogram bot wired to the Google Ads API at MCC level. An OpenRouter LLM parses commands into typed Pydantic tool calls; reads run instantly, while every write becomes a proposal stored in PostgreSQL with a before → after diff and ✅/❌ buttons — executed only on approval and written to an audit log. It also does keyword research with AI intent-clustering, RSA ad-copy with per-element review, and deep period-over-period reports exported to Excel or Google Sheets. Even the LLM was chosen by measurement: an in-repo A/B benchmark found DeepSeek ≈ Claude on function-calling at ~13× lower cost, with Claude as automatic fallback.
Live Capabilities
See what the bot can do
A faithful recreation of the Aimash interface, built from the bot's real Telegram messages. Every change is proposed, previewed as “before → after”, and only runs after you approve it.
Telegram
aiogram 3 · RU/EN chat
LLM router
OpenRouter · DeepSeek, Claude fallback
Tool schemas
Pydantic · code-level allow-list
Confirm-gate
one-time confirmation_id · ✅ / ❌
Google Ads API
v24 · MCC level
Every request flows through typed schemas and a confirm-gate before it can touch a live account — with four standing guard-rails watching every step.
Talk to your account
Plain-language commands — stats, reports and changes, no dashboards.
Confirm-gate on every change
The AI proposes a before → after diff and waits for your ✅. Nothing moves without it.
AI ad copy (RSA)
Generates headlines and descriptions within Google's limits, reviewed one by one.
Keyword research
Search volumes and AI intent-clusters, exportable to .xlsx.
Deep reports
Period-over-period comparison, exported to Excel or Google Sheets.
Technical 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
System Architecture
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)
Core Technologies