Inspiration

Healthcare staffing decisions affect patient care, employee workload, and operational safety. I wanted to build an agentic workflow that helps prepare a staffing recommendation without allowing an LLM to make or commit a clinical operations decision on its own.

What it does

SafeStaff Agentic GCP generates a staffing plan for a selected shift date, validates it against deterministic safety rules, and pauses for an explicit human decision.

The workflow forecasts demand, produces a structured candidate plan, enforces staffing constraints, and records an approved live decision in Firestore with an audit ID.

How we built it

The protected live path runs on private Cloud Run. Google ADK calls Gemini 3.5 Flash through Vertex AI. Pydantic validates the model output before deterministic application rules become authoritative:

  • Direct-care staff must match forecast demand.
  • Supervisors are enforced at a 1:5 ratio.
  • A minimum of 10 registered nurses is enforced.
  • The rationale and validation status are corrected to match the enforced plan.

Only then does the workflow present Approve Plan and Reject Plan.

The public Cloud Run evaluator demo is intentionally labelled Safe Mock Mode. It preserves the full human-review workflow without calling Vertex AI or Firestore.

Built with Google ADK, Gemini 3.5 Flash, Vertex AI, Cloud Run, Firestore, Streamlit, Pydantic, and Python.

Challenges we ran into

The live path initially returned Gemini output as text rather than a typed application object. I added explicit schema coercion before deterministic validation.

I also found that Gemini 3.5 Flash needed Vertex AI's us multi-region endpoint rather than the Cloud Run region. The final design keeps Cloud Run in us-central1 while Vertex AI uses us.

Accomplishments that we're proud of

  • Built a real Gemini/Vertex AI planning path rather than only a mock UI.
  • Enforced deterministic staffing constraints independently of model output.
  • Added an explicit human approval barrier before Firestore writes.
  • Successfully committed an approved live plan to Firestore with an audit ID.
  • Deployed both a protected live Cloud Run service and a safe public evaluator demo.
  • Passed 12 local workflow, UI, and validation tests.

What we learned

Generative models are valuable for structured planning and explanation, but high-stakes operational constraints should remain deterministic and independently verifiable.

We also learned that a safe public demo should be separated from a credentialed live path: judges can explore the workflow without triggering uncontrolled model calls or database writes.

What's next for SafeStaff Agentic GCP

Next steps are role-based approval, authenticated audit-history review, integration with real hospital demand data, and configurable policy rules for different facilities.

Links

Built With

Share this project:

Updates