
Multi-user SaaS chatbot. Acts as digital marketing expert: advises on selling online, answers from curated marketing knowledge base, runs Google Ads + Meta Ads campaigns, reads Search Console + GA4.
Stack: Next.js (Vercel) + FastAPI (Cloud Run) + Supabase (auth, Postgres/RLS, storage). Python 3.12, uv. All chat traffic through OpenRouter via OpenAI SDK. Agent = LangChain 1.x create_agent on LangGraph. Tracing via Langfuse.
What it does
RAG — hybrid retrieval (pgvector + BM25, reciprocal-rank fusion) reranked by local cross-encoder. Plus GraphRAG: knowledge graph over curated corpus, entity traversal + community summaries. Four KB tools incl. bounded agentic loop (research_kb).
Ads management — function calling into Google Ads and Meta. Every write returns a Proposal, human approves, executor runs. Google mutations run validate_only preflight. Meta builds ship as Ads Manager bulk-import .xlsx (app stuck in Dev mode, subcode 1885183).
Creatives — copywriter picks angle + archetype + headline, art director renders it (Nano Banana 2), critic reviews. Placement table owns aspect ratio and whether text is baked in. Video ads: MiniMax H3 Max animates an approved still, 9:16, async job.
Analytics — nightly sync of metrics, pacing/anomaly alerts, per-campaign LLM review (hold/pause/raise/lower) applied only on autopilot inside code caps. Digest email by campaign with HTML-table bar charts. Full business audit (GA4/GSC + Playwright visual pass) scored into a report.
Billing — plans + credits in USD, mock checkout at the real processor seam, every pricing bullet enforced as a code gate.
Core design stance: safety and craft live in code, not prompts. Guardrails, aspect ratios, camera moves, angle tables, plan gates, spend ceilings — all tables the model reads, never writes. Write tools cannot execute without approval. Logs carry metadata only; content goes to traces.