Inspiration

Every mall operator faces the same invisible problem: by the time staff notice a crowd spike, a sudden rainstorm, or a missed promotional opportunity — the moment has already passed. Coordinating a response across marketing, facilities, and operations takes calls, messages, and manual effort that the real-time world simply doesn't wait for.

We wanted to build something that closes that gap entirely: a system that watches the mall the way a human operations director would, but reacts at the speed of software. The "Brick-and-Mortar Retail" challenge in the hackathon mapped perfectly to this problem, and the MongoDB MCP server gave us a natural integration point — a live, queryable data layer the agent could reason over directly.

What it does

Aura Mall Mind is an autonomous, multi-agent operations platform for shopping malls with two specialized agents coordinated by a Gemini-powered orchestrator:

Shopper Concierge Agent — serves shoppers in natural language:

  • "Where is Nike?" → floor, unit, zone, and hours from live MongoDB data
  • "What's on sale near Zone A?" → active promotions filtered by location
  • "Plan my visit: running shoes, a latte, an umbrella" → multi-stop route optimized across floors

Operations Manager Agent — acts autonomously on physical events:

  • Rainstorm trigger: checks live inventory for umbrellas and hot beverages, writes a hyper-local campaign with Gemini, sends a push notification to shoppers, updates digital signage to a weather theme, creates a high-priority wet-floor safety ticket, and dispatches the custodial team — six coordinated actions in under 15 seconds.
  • Crowd spike trigger: verifies Zone C at 92% capacity via live footfall data, reroutes shoppers via signage and push notification, and dispatches security.

Every agent run surfaces a transparent "glass box" timeline — every reasoning step, tool call, result, and data path (MongoDB MCP vs. driver fallback) is visible in real time.

How we built it

Reasoning layer: Gemini 2.5 Flash via the @google/genai SDK handles intent routing, multi-turn function-calling loops (up to 8 turns), and campaign copywriting. Each agent has a focused system prompt and a restricted set of tool declarations — the orchestrator routes by classifying intent, with regex fast-paths for common queries.

Data layer: MongoDB Atlas stores all operational data across 10 collections: tenants, inventory, facilities, staff, footfall, tickets, campaigns, signage, and notifications. All agent reads and writes flow through an MCP-first, driver-fallback abstraction in db-actions.ts — it tries the MongoDB MCP server first, and falls back to the native driver transparently if MCP isn't available (e.g., on Vercel serverless).

MCP integration: mcp-client.ts spawns mongodb-mcp-server as a child process over stdio using @modelcontextprotocol/sdk. The 12 agent tools (findStore, getFootfall, createTicket, draftCampaign, dispatchStaff, etc.) call into db-actions.ts, which routes through MCP. The UI badges every result as via MongoDB MCP or via driver.

Frontend: Next.js 16 App Router with React 19. The agent API routes stream NDJSON — every reasoning step lands in the UI as it happens. The design system is Tailwind CSS 4 with a Linear/n8n-inspired commercial SaaS aesthetic.

Challenges we ran into

MCP on serverless: The MongoDB MCP server runs as a child process over stdio — which Vercel's serverless functions don't support. We solved this with an MCP-first, driver-fallback pattern: the same code path works on any Node host with full MCP visibility, and falls back gracefully on serverless so the hosted demo URL never breaks.

Streaming multi-turn agents: Gemini's function-calling loop can run 6–8 turns before producing a final answer. Streaming each intermediate step to the UI as NDJSON while maintaining a clean React state model required careful buffering and incremental state updates.

Autonomous scenario determinism: Making the rainstorm and crowd spike scenarios reliably produce the right sequence of actions (inventory → campaign → signage → ticket → dispatch) required precise system prompt engineering and tool declaration ordering to guide the model without over-constraining it.

Gemini model availability: During development, gemini-2.5-flash occasionally hit capacity limits. We added a graceful fallback chain (gemini-2.0-flashgemini-1.5-flash) with exponential backoff so demos never fail on a rate limit.

Accomplishments that we're proud of

  • A genuinely autonomous agent that takes six coordinated real-world actions from a single event trigger, with zero additional human input.
  • A glass-box UI that makes the agent's full reasoning chain visible and understandable — not a black box.
  • An MCP integration that is real and primary, not bolted on — every agent data query flows through the MongoDB MCP server when the environment supports it, with the UI surfacing exactly which path was used.
  • A production-grade SaaS design system built from scratch in Tailwind CSS 4 — responsive, accessible, and visually polished enough to demo at a commercial level.
  • Shipping a complete, seeded, fully functional demo within the contest window.

What we learned

  • The MongoDB MCP server is a genuinely powerful integration point: having the agent query and write data through a structured protocol — rather than raw driver calls — makes the agent's behavior auditable and the data access layer replaceable.
  • Multi-agent orchestration is most effective when each agent has a narrow, well-defined scope. The Shopper and Ops agents share no tools, which makes each one more reliable and easier to reason about.
  • Streaming intermediate agent steps to the UI dramatically improves the demo experience — watching the agent reason in real time is far more compelling than waiting for a final answer.
  • Gemini's function-calling is robust for agentic loops but requires careful prompt engineering to ensure the model terminates cleanly after completing a multi-step plan.

What's next for Aura Mall Mind

  • Real sensor integration: Connect live footfall counters and weather APIs instead of dashboard-triggered mocks.
  • Vertex AI migration: Move from Google AI Studio to Vertex AI for enterprise-grade quotas, IAM, and auditability.
  • Tenant-facing portal: Let individual store managers query Aura directly ("What are my sales vs. foot traffic this week?").
  • Scheduled autonomous agents: Nightly campaign planning, weekly maintenance sweep, monthly footfall trend reports — all generated and actioned without human prompting.
  • Multi-mall support: Namespace all collections by mall ID so a single Aura instance serves a portfolio of properties.

Built With

  • google-generative-ai-sdk
  • model-context-protocol-(mcp)
  • mongodb-atlas
  • mongodb-mcp-server
  • next.js-16
  • react-19
  • tailwind-css-4
  • typescript
  • zod
Share this project:

Updates