Inspiration
Every day, millions of people make decisions based on how they think they feel — not how they actually felt. A therapist asks "how was your week?" A UX researcher runs a survey after the session ends. A manager sends a quarterly engagement poll. By the time anyone answers, the real moment is gone. Memory rewrites it. Context colors it. The truth slips away. This isn't just a psychology problem. It's a healthcare problem. A product design problem. A management problem. Any time someone needs to understand human experience in real time and acts on a reconstruction instead they're making decisions on flawed data.
Experience Sampling Method was designed to fix this. Catch people in the moment. Ask before the brain revises. Get the truth while it's still warm. It's used in clinical trials, mental health apps, UX research, workplace wellbeing studies, anywhere the gap between "what happened" and "what people remember" actually matters. But running an ESM study is brutally hard. I know because I tried. I'm an incoming MSc Cognitive Science student studying boredom and creativity, and I kept hitting the same wall: the infrastructure was consuming the research. Prompts sent manually. Compliance tracked in spreadsheets. Patterns spotted days after they emerged too late to do anything about them.
The tool I needed didn't exist. So I built it.
Momentra doesn't just collect data, it thinks about it while it arrives. It notices when someone reports 9/10 boredom and generates a follow-up question before the moment passes. It predicts what your study will find before you run a single session. It runs while you sleep, flags problems before they compound, and turns raw responses into testable hypotheses automatically.
For researchers. For clinicians. For product teams. For anyone who needs to understand people in the moment ,not in retrospect.
What it does
Momentra is the first ESM platform where AI participates in the entire research lifecycle , not just analysis after the fact.
Before the study: The Study Designer Agent designs a full ESM protocol from a plain-English research question. Then it runs a pre-study simulation predicting what your data will likely look like, flagging methodological risks, estimating compliance rates, and referencing similar ESM studies before you collect a single response.
During the study: Participants respond via a lightweight form at random times. Every response lands in MongoDB Atlas instantly. The Engagement Agent monitors compliance and when boredom spikes ≥8/10, Gemini generates a personalized follow-up question based on that participant's specific activity and context.
After every response: The Statistician Agent generates testable hypotheses from live data automatically. The Data Quality Agent flags batch submissions, missing data, and anomalies with a real-time quality score. Everything syncs to BigQuery via Fivetran.
Always: Researchers can open "Ask Your Data" and chat directly with their MongoDB database "which activity correlates most with boredom?" gets a specific, quantitative answer from real responses.
The result: **A solo researcher or a mental health startup, a UX team, or a clinical researcher gets the intelligence of an entire research team: study design, simulation, data collection, quality control, hypothesis generation, and analysis all running automatically and in parallel.
How we built it
Stack: MongoDB Atlas · Google Cloud Functions · Gemini 2.5 Flash · Fivetran · BigQuery · Python · Tally · GitHub Pages
The agent loop:
- Participant submits form
esm-webhooksaves response to MongoDB, tags participant by name- If boredom ≥ 8, Gemini generates a context-aware follow-up question stored as an agent action in MongoDB
esm-insightstriggers Gemini analyzes the full dataset and stores a structured insight- Researcher sees updated dashboard with live data, agent actions, and fresh AI analysis
- Fivetran syncs all collections to BigQuery every 6 hours for deeper analysis
Five agents, one platform: Study Designer (protocol + pre-study simulation), Statistician (live hypothesis generation), Data Quality (anomaly detection), Engagement (compliance + adaptive questioning), and Ask Your Data (natural language queries over live MongoDB data).
Each agent's Cloud Run service is registered as an MCP tool inside Google Cloud Agent Builder, so the orchestration and reasoning layer lives in Agent Builder — not raw Cloud Functions.
Challenges we ran into
- The biggest technical challenge was API authentication during Cloud Functions deployment — environment variables weren't propagating correctly across GCP projects, causing silent failures that took time to trace.
- Tally sends multiple-choice answers as UUIDs rather than readable labels. Every activity in MongoDB showed as a hash like
55065165-984a-48c6-9. We built a UUID-to-label mapping layer in the webhook and backfilled all existing records. - The pre-study simulation required careful prompt engineering — getting Gemini to produce structured JSON predictions while also generating conversational responses in the same output, without hallucinating references to non-existent studies.
Accomplishments that we're proud of
The agent action system genuinely surprised us. When a participant reported 9/10 boredom after Work/studying, Gemini generated:
"Despite being so focused, what about this 'new change' felt so boring?"
— picking up on a detail in the notes field. That felt like real reasoning, not pattern matching.
The pre-study simulation is something we haven't seen in any existing ESM tool. Telling a researcher "your morning prompts will likely have 30% lower compliance due to time pressure" before the study launches changes how they design it that's AI actually improving research methodology, not just automating it.
This is a real running study , not a mock demo. Real participants are filling the form, real data is flowing into MongoDB, and the agents are making real decisions about it.
What we learned
Building this changed how I think about research design. A good study instrument isn't just a data collection tool, it has to account for psychological conditions, response fatigue, and the gap between what participants report and what they mean. You can't rely on surface-level answers to define your study. You have to look deeper — and that's exactly what the agent does.
MongoDB's flexible document model was the right call. ESM responses are inherently variable, some have notes, some have agent-generated follow-ups, some don't. A rigid schema would have broken constantly.
What's next for Momentra
- Notification layer — WhatsApp/email prompts so participants don't need to remember to open the form
- Multi-study support — any researcher, mental health app, or UX team can define their own ESM study through a config interface
- Longitudinal analysis — track how patterns shift over weeks, not just days
- IRB-ready export — generate anonymized, citation-ready datasets for academic publication
- Simulation validation — compare pre-study predictions against actual outcomes to improve the simulation model over time
Built With
- chart.js-cloud-services:-google-cloud-functions
- google-cloud-run-databases:-mongodb-atlas-apis:-gemini-2.5-flash-(google-ai-studio)-platforms:-github-pages
- google-cloud-scheduler
- html/css-frameworks:-flask
- javascript
- languages:-python
- pymongo
- tally-(form-builder)-other:-functions-framework
Log in or sign up for Devpost to join the conversation.