Inspiration

Teams drown in dashboards but still guess why users drop off. We wanted an instant, side‑by‑side view of raw funnel numbers and an AI narrative so PMs can decide what to fix without spelunking through spreadsheets.

What it does

  • Collects product events into a Rails + Postgres backend.
  • Builds funnel summaries (counts, conversion %, avg step time, device/country mix).
  • Sends that payload to a FastAPI service (Gemini via google-genai) to surface the biggest issue, the reason, and a 3‑step playbook.
  • Frontend dashboard shows AI insights on the left and live funnel data on the right, with per‑step conversion bars and breakdowns.
  • Allows users to create custom dashboards and events through the use of our API.

How we built it

  • Backend: Rails 7, Postgres, endpoints for events, funnels, summaries, and AI analysis.
  • AI microservice: FastAPI (Python 3.11), Gemini model, optional MOCK_MODE for offline demos.
  • Frontend: React + Vite dashboard consuming Rails + AI; Dockerized demo landing.
  • Infra: Docker Compose for backend, AI, dashboard, and demo.

Challenges we ran into

  • Cross‑container DNS (Rails → FastAPI) and env defaults for both host and Compose.
  • Guaranteeing AI responses are valid JSON (cleaning markdown fences, handling fallbacks).
  • Keeping git clean from compiled artifacts (__pycache__) during merges.

Accomplishments that we're proud of

  • Single click in the dashboard triggers AI analysis and shows actionable copy next to the raw funnel.
  • Deterministic demo path (MOCK_MODE=true) so the experience never breaks on stage.
  • Clean funnel payload schema that any model can consume or be swapped out for.

What we learned

  • Small interface tweaks (conversion bars + percent of previous step) make drop‑offs obvious without reading text.
  • Defaulting envs for both host and Compose saves most integration headaches.
  • Keeping AI prompts strict and JSON‑only dramatically reduces parsing errors.
  • Using FastAPI for AI prompting and handling AI API keys
  • Using Redis to cache event signals and increment them if there are duplicates

What's next for PM.ai

  • Role‑based access and per‑project API keys.
  • A/B test hooks to auto‑apply the AI playbook and measure lift.
  • Streaming updates so funnel cards refresh in near real time.
  • An SDK to allow developers to easily integrate PM.ai into their projects and create custom events.
Share this project:

Updates