Aymam AI – Instagram Marketing Agent
An AI agent that runs a small shop's Instagram from WhatsApp: it designs the posts, publishes on schedule and answers customer DMs 24/7.
The owner simply sends a product photo on WhatsApp (or Telegram). The agent turns it into studio-quality ad images and Reels, keeps a posting calendar, publishes to Instagram through the official API, and replies to customer messages using only the shop's own product, price and FAQ data. It is live and running for real shops.
Links
Why it's an agent, not just a post scheduler
- Perceive: reads product photos, captions and plain-language WhatsApp messages from the owner, plus customer DMs, story replies and images on Instagram.
- Reason: decides whether a photo should be posted now or saved to the reserve, picks the right product for each slot, plans captions, headlines and video scenes, and works out what a customer is actually asking.
- Act: generates and publishes feed posts, stories, Reels and carousels, sends previews and reminders to the owners, and replies to customers in their own language.
- Hold intent: keeps the weekly schedule, approval rules, campaigns and posting languages, and follows up on open questions until an owner answers.
The owner never opens a dashboard; everything happens in a chat.
What it does
- Photo → ad creative: keeps the real product unchanged while generating a new studio or lifestyle scene around it; text overlays are rendered in code (never drawn by the image model) so Turkish and Cyrillic letters stay sharp.
- Moving Reels: image-to-video lifestyle clips (Veo) with a fidelity check on the frames, falling back to a motion Reel from the approved image if anything fails.
- Scheduling: feed posts, Reels and several stories a day, prepared ahead of time; owners can approve, cancel, restyle or edit any draft from WhatsApp.
- Instagram DM assistant: answers 24/7 only from the shop's product/FAQ/campaign data, refuses to invent prices, maps story replies to the right product, and escalates anything it can't answer to the owner, then sends a polite version of the owner's answer and offers to save it as an FAQ.
- Insights: weekly performance report and data-driven posting recommendations.
- Multi-language: posts in Turkish, English and Russian (or several at once); DMs follow the customer's language.
- Agent mode: a tool-using agent turns free-form owner requests ("prepare three stories for tomorrow from these photos") into multi-step actions, with confirmation before anything is published or deleted.
- Onboarding: a smart setup form that researches the shop from its Instagram and website, and one-click "Connect with Instagram".
Architecture
- Owner channel: WhatsApp / Telegram webhooks feed a Gemini-powered agent (with a deterministic command parser as fallback).
- Image pipeline: Gemini image generation, a fidelity check against the original product, SVG text overlay, then ffmpeg or Veo for video.
- Scheduler: drafts, posting slots, reminders and the weekly report.
- DM assistant: knowledge pack built from the shop's own data, price guard, and escalation to the owner.
-
Instagram Graph API: publishing, messaging and insights.
-
One Node service per shop, sharing a webhook hub; SQLite per shop.
- Official APIs only: WhatsApp Cloud API and Instagram API with Instagram Login.
Engineering highlights
- Reliability: model fallbacks, publish retries when Instagram reports a container "not ready", queued WhatsApp messages outside the 24-hour window, weekly automatic token renewal.
- Trust: price guard on every DM reply, fidelity checks on generated images/videos, approval mode for new shops, human takeover detection (the bot pauses when the owner types in the Instagram app).
- Cost control: explicit prompt caching for the agent's fixed instructions, cheap motion-video fallback, reuse of kept video clips for text edits.
- Deployment: AWS EC2, systemd services, Caddy reverse proxy with automatic TLS.
Tech stack
Node.js 22 · Express · Google Gemini (text, vision, image) · Veo · sharp · resvg · ffmpeg · SQLite · WhatsApp Cloud API · Instagram Graph API · Telegram Bot API · AWS EC2 · Caddy