What is MallMind?
MallMind is a real-time AI operations agent for brick-and-mortar shopping malls. It monitors live foot traffic across all mall zones, autonomously detects crowd surges and operational issues, logs incidents, triggers marketing campaigns, and resolves situations, all without human intervention.
The Problem
Mall operations today are reactive, manual, and slow. Crowd surges go undetected until they become safety issues. Maintenance tickets sit in radio queues for hours. Marketing campaigns run blind with no real-time traffic data. Operations managers juggle CCTV feeds, security radios, and WhatsApp messages simultaneously. By the time anyone responds, the situation has already escalated.
The Solution
MallMind is an autonomous operations layer that sits on top of a mall's data infrastructure and turns raw sensor data into intelligent, real-time action.
- Auto-Patrol System— scans all zones every 5 minutes, creates incidents when thresholds are crossed, triggers dispersal campaigns for critical zones, and auto-resolves everything when zones normalize -Gemini 2.5 AI Agent — answers natural language queries from operators and executes multi-step tool chains against live MongoDB data
- Atlas Vector Search — every incident is embedded using Gemini's text-embedding-004 model and stored as a 768-dimension vector, enabling semantic similarity search across past incidents
- Aggregation Pipelines — zone risk scores, incident trends, and hourly traffic patterns computed live from MongoDB
- Live Traffic Simulator — weather-adjusted foot traffic readings inserted every 30 seconds using real Dallas weather from OpenWeatherMap
How We Built It
Backend — Node.js Express API deployed on Google Cloud Run. The Gemini 2.5 Flash agent on Vertex AI uses function calling to execute 7 real tools against live MongoDB Atlas data. A background auto-patrol loop runs every 5 minutes alongside a traffic simulator that inserts weather-adjusted readings every 30 seconds.
Database — MongoDB Atlas with 6 collections: foot_traffic, incidents, campaigns, agent_logs, zones, and tenants. Atlas Vector Search indexes incident embeddings for semantic lookup. A TTL index auto-deletes traffic data older than 24 hours to keep the collection lean.
Frontend — Next.js dashboard deployed on Vercel showing live zone occupancy, active incidents, running campaigns, analytics demographics, and a full agent chat interface with one-click scenario buttons.
Infrastructure — Google Cloud Build for CI/CD, Google Artifact Registry for Docker images, Google Secret Manager for all secrets, and Google Cloud Run for serverless deployment.
IDE — We also used Cursor as our IDE for assistance in code generation and debugging, following standard industry practices for AI-assisted development.
MongoDB Atlas Integration
MallMind demonstrates four Atlas capabilities:
- Live operational database — every agent action writes real documents in real time
- Atlas Vector Search — semantic incident similarity using 768-dimension Gemini embeddings
- Aggregation pipelines — zone risk scoring, incident analytics, campaign performance
- TTL indexes — automatic data lifecycle management for high-volume traffic data
Challenges
- Gemini function calling format — the new
@google/genaiSDK sends function responses differently from the deprecated Vertex AI SDK, requiring each tool result to be sent as a separate content item - MongoDB memory limits — the foot_traffic collection grew large enough to exceed Atlas free tier sort memory, solved with
allowDiskUse: trueon all aggregations and a TTL index - Production auth — switching between local ADC and Cloud Run service account authentication required environment-aware GenAI client configuration
What We Learned
Building MallMind taught us how to design a truly autonomous agent loop — one that doesn't just respond to user input but actively monitors data, makes decisions, and takes action on its own schedule. The most powerful insight was that MongoDB Atlas is not just a database for this kind of system — it's the memory, the audit trail, the vector store, and the analytics engine all in one.
Built With
- adc
- atlasvectorsearch
- cursor
- docker
- express.js
- gemini2.5-flash
- google-cloud
- mongodbaggregationpipelines
- mongodbatlas
- next.js
- node.js
- openweathermapapi
- sdk
- tailwindcss
- typescript
- vercel


Log in or sign up for Devpost to join the conversation.