# Bayflow

- **Event:** [The Harness Engineering & Model Wrangling #SFTechWeek Hackathon](https://cerebralvalley.ai/e/mongodb-sftw-hackathon)
- **When:** Sun, Oct 11 at 9:00 AM – 10:00 PM (PDT)
- **Where:** San Francisco, CA
- **Team:** [Rae Jin](https://cerebralvalley.ai/u/raejin)
- **GitHub:** https://github.com/jin-dalrae/bayflow
- **Demo video:** https://youtu.be/oE6TcyYa9_c
- **Gallery:** https://cerebralvalley.ai/e/mongodb-sftw-hackathon/hackathon/gallery
- **Page:** https://cerebralvalley.ai/e/mongodb-sftw-hackathon/hackathon/gallery/5

BayFlow is a self-improving AI agent system for San Francisco transit. Operator agents for Muni, BART and Caltrain run a simulated commute on the real city network, built from official GTFS data with 3,292 stops and stations. They dispatch standby vehicles and coordinate service as riders build up at stops. A second team of harness agents improves how those operators work:
- a service monitor checks whether riders board within 10 minutes;
- a Gemini planner proposes one focused change to the operators' setup;
- a validator enforces a safety envelope;
- an evaluator races the change against the current version on five days it has never seen;
- a promotion gate keeps the change only if it measurably wins.

The problem: transit operations are tuned by hand, and AI systems that "optimize themselves" are rarely held to an honest, fixed scorecard. BayFlow makes self-improvement auditable. In our latest MongoDB Atlas run, the monitor flagged that only 70% of riders boarded within 10 minutes. Gemini, learning from earlier failed attempts, proposed dispatching standby buses sooner. The change won all five unseen days (+3%) and was promoted. The two changes Gemini tried next were rejected. Every agent message, version, test and decision is stored, and the interface shows the live map beside a diagram of who told whom what. Rider demand is synthetic.

## More from The Harness Engineering & Model Wrangling #SFTechWeek Hackathon

- [LILI](https://cerebralvalley.ai/e/mongodb-sftw-hackathon/hackathon/gallery/2)
- [RED QUEEN](https://cerebralvalley.ai/e/mongodb-sftw-hackathon/hackathon/gallery/3)
- [DrawTalk Harness](https://cerebralvalley.ai/e/mongodb-sftw-hackathon/hackathon/gallery/4)
- [Procurator](https://cerebralvalley.ai/e/mongodb-sftw-hackathon/hackathon/gallery/6)
- [AgentShield](https://cerebralvalley.ai/e/mongodb-sftw-hackathon/hackathon/gallery/7)
- [SuperBid](https://cerebralvalley.ai/e/mongodb-sftw-hackathon/hackathon/gallery/8)

---

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