# Bodega

- **Event:** [Agents in Context Toronto: a MongoDB Hackathon](https://cerebralvalley.ai/e/mongodb-toronto-hackathon)
- **When:** Sat, Nov 14 at 9:00 AM – 9:00 PM (EST)
- **Where:** Toronto, Canada
- **Team:** [Mahyar Jaberi](https://cerebralvalley.ai/u/Mahyar), [Kasra Bashizadeh](https://cerebralvalley.ai/u/Kasrabshz)
- **GitHub:** https://github.com/mahyar-jbr/Bodega
- **Demo video:** https://youtu.be/1yWAWO6mxAE
- **Gallery:** https://cerebralvalley.ai/e/mongodb-toronto-hackathon/hackathon/gallery
- **Page:** https://cerebralvalley.ai/e/mongodb-toronto-hackathon/hackathon/gallery/2

# Bodega — Herd Immunity for AI Agents

What if one AI agent could learn from being scammed and automatically protect every other agent in its network?

Bodega is a network of three AI-powered convenience stores that demonstrates how AI agents can learn from mistakes, share verified protections, and govern their own memory.

Customers interact with AI shopkeepers through text or voice to purchase products, apply discounts, and request refunds. Initially, these agents are intentionally vulnerable to fake discount codes, fraudulent refunds, and social-engineering attacks.

When a scam succeeds, Bodega detects the unauthorized transaction and records a privacy-conscious incident summary. MongoDB Atlas Agent Memory and Vector Search identify related attacks, even when they are reworded.

An AI learner then generates new guardrail rules. Before deployment, each candidate is evaluated against 120 previously unseen cases, including 60 legitimate customer interactions, using the exact same AI model and prompt. Only rules that pass the evaluation criteria are promoted across all three stores.

Our live hackathon results:

- Scam success dropped from 60% to 0% on the held-out evaluation.
- All three stores became protected approximately 41 seconds after the initial attack.
- Guardrail propagation across individual stores took approximately 320 milliseconds.
- One-click rollback reversed the learned protection across the network in approximately **250 milliseconds.
- During a flash sale, 100 simultaneous buyers competed for 10 hoodies. Exactly 10 purchases succeeded, with zero overselling and fully consistent financial records.
- We also measured the impact on legitimate shoppers: refusals changed from 2 of 60 before learning to 3 of 60 afterward.

Memory governance is central to Bodega.

Stores share verified protective rules, never private customer conversations or identities. Raw conversations expire after 24 hours, while MongoDB schema validation prevents sensitive text from entering incident memory.

Operators can require human approval before deploying new rules, inspect the evidence behind each decision, delete a shopper's chat history and anonymize their incidents, or roll back protections when necessary.

Bodega also demonstrates recovery when stores go offline, real-time security monitoring, and an **ElevenLabs-powered voice shopkeeper** that lets customers speak naturally with AI agents.

Technology: MongoDB Atlas, Atlas Agent Memory, Vector Search, Change Streams, ACID transactions, schema validation, TTL indexes, Claude, ElevenLabs, TypeScript, React, and Express.

Built during Agents in Context Toronto 2026.

Bodega doesn't just give AI agents memory. It makes that memory measurable, governable, reversible, and safe to share.

## More from Agents in Context Toronto: a MongoDB Hackathon

- [PayProof](https://cerebralvalley.ai/e/mongodb-toronto-hackathon/hackathon/gallery/1)
- [One Lesson](https://cerebralvalley.ai/e/mongodb-toronto-hackathon/hackathon/gallery/3)
- [Solo Spades](https://cerebralvalley.ai/e/mongodb-toronto-hackathon/hackathon/gallery/4)
- [Sharleen Chebet](https://cerebralvalley.ai/e/mongodb-toronto-hackathon/hackathon/gallery/5)
- [Stephen/Soham](https://cerebralvalley.ai/e/mongodb-toronto-hackathon/hackathon/gallery/97)
- [Day One](https://cerebralvalley.ai/e/mongodb-toronto-hackathon/hackathon/gallery/98)

---

Markdown version of https://cerebralvalley.ai/e/mongodb-toronto-hackathon/hackathon/gallery/2. Site index for agents: https://cerebralvalley.ai/llms.txt · full text: https://cerebralvalley.ai/llms-full.txt
