Inspiration
Emergency teams lose time waiting for reports to consolidate. By the time dashboards, PDFs, and approvals align, the crisis has often already moved.
We wanted to build for the moment before certainty — when signals are incomplete, risk is rising, and action still has a chance to prevent impact.
THRESHOLD was inspired by the idea of an AI command system that does not chat about a crisis, but reasons through it, debates tradeoffs, retrieves precedent, and prepares action under human oversight.
What it does
THRESHOLD is a live tactical command interface for crisis preemption.
An operator can trigger crisis mutations like Wind Shift or Bridge Collapse. The system retrieves prior incident memory from MongoDB Atlas, sends crisis context to Gemini, generates possible futures, creates a council-style debate, selects a judge decision, writes the result to Firestore, and updates the UI in real time.
The dashboard shows an Agent Stream, tactical map, SIMULACRA Futures, Council Debate, Decision Card, and human-in-the-loop Approve / Reject controls.
Each crisis run is stored in MongoDB Atlas as incident memory, so future runs can retrieve precedent before Gemini generates new response paths.
How we built it
We built THRESHOLD with Next.js, TypeScript, Firebase Firestore, Firebase Admin SDK, Gemini API, MongoDB Atlas, MongoDB MCP setup, and Vercel API routes.
Firestore acts as the real-time blackboard. The frontend listens to current_crisis_state/active. Vercel API routes act as server-side agent tools. When a scenario is triggered, the backend retrieves incident memory from MongoDB Atlas, calls Gemini to generate futures and debate, writes the new state to Firestore, and stores the run back into MongoDB as future precedent.
MongoDB MCP Server was configured locally with VS Code MongoDB Agent Skills to query and inspect the same incident_memory collection through an MCP-compatible workflow.
This creates the loop:
Operator → API Route → MongoDB Memory → Gemini Reasoning → Firestore Blackboard → Live UI → MongoDB Memory
Challenges we ran into
The hardest part was making the project feel like an agentic system instead of a chatbot. We had to design a workflow where Gemini did not just answer a prompt, but generated structured futures, debate messages, and decisions that could be written into live operational state.
We also had to coordinate multiple state layers: Firestore for real-time UI updates, MongoDB Atlas for incident memory, and Vercel API routes for secure backend writes. Another challenge was making Gemini reliably return structured JSON for the dashboard.
Finally, we had to keep the interface cinematic and operational while still making it understandable to judges in a short demo.
Accomplishments that we're proud of
We built a real-time multi-agent crisis command interface with Firestore updates, Gemini-generated simulations, MongoDB incident memory, and human-in-the-loop decision controls.
We are especially proud that the demo visibly adapts when a crisis variable changes. When Wind Shift or Bridge Collapse is triggered, the agents re-run the crisis reasoning loop, retrieve precedent memory, generate new futures, debate the response, and update the UI live.
We are also proud that THRESHOLD presents AI as a working command architecture rather than a chat interface.
What we learned
We learned that agent UX is very different from chatbot UX. The most powerful part of an agent system is not a conversation box — it is the visible chain of state changes, tool calls, memory retrieval, reasoning, and action.
We also learned how useful a blackboard architecture is for multi-agent systems. Firestore made it possible for the UI and agents to coordinate through shared state instead of direct point-to-point calls.
MongoDB Atlas also changed the system from one-off reasoning into memory-backed reasoning, where every crisis run becomes precedent for the next.
What's next for THRESHOLD
Next we want to deepen the MongoDB MCP integration, add richer incident memory retrieval, connect real emergency data feeds, add operator authentication, and support real alerting channels such as SMS, email, and dispatch APIs.
We also want to add post-event audit trails so operators can review why an agent chose a particular response and how prior incident memory influenced the decision.
Try it out / Instructions
Open the live demo URL.
- Confirm the dashboard shows Firestore Blackboard / Listening.
- Click Wind Shift or Bridge Collapse.
- Watch the Gemini reasoning state appear.
- Check the Agent Stream for MONGODB and GEMINI entries.
- Review SIMULACRA Futures, Council Debate, and Decision Card.
- Click Approve or Reject to write the operator decision back to the blackboard.
Keyboard shortcuts: 1 = Baseline 2 = Wind Shift 3 = Bridge Collapse A = Approve R = Reject 0 = Reset
MongoDB Track
MongoDB Atlas acts as THRESHOLD’s persistent incident memory layer. Every generated crisis run is stored with trigger type, tags, selected branch, judge decision, and debate summary. On future triggers, THRESHOLD retrieves relevant prior incident records and injects them into Gemini context before generating new futures and decisions.
MongoDB MCP Server was also configured locally with VS Code MongoDB Agent Skills, allowing an MCP-compatible agent workflow to inspect and query the same incident_memory collection.
What makes it unique
THRESHOLD is not a chatbot. It is a memory-backed command system where Gemini reasons through crisis futures, MongoDB stores operational precedent, Firestore coordinates live state, and the UI exposes the entire agent loop in real time.
Built With
- firebase-admin-sdk
- firebase-firestore
- gemini
- google-cloud
- gsap
- mongodb-atlas
- mongodb-mcp
- next.js
- typescript
- vercel
Log in or sign up for Devpost to join the conversation.