Google Cloud Rapid Agent Hackathon
A 13-step model-directed workflow that prepares tomorrow's legal docket: model-driven strategy selection, Atlas Vector Search retrieval, conditional CourtListener precedents, Gemini Flash recommendations, and attorney oversight — typically in under two minutes.
TWO WORKFLOWS — ONE SYSTEM
Demo trace — representative of live pipeline behavior · Run real agent at /agent to see actual execution with your data · Run #demo9x4k2a · May 30, 2026 · 09:41:02 — 09:41:27
Every branching decision is logged with the evidence that drove it. Decisions marked model-driven were made by Gemini Flash evaluating the case profile.
Atlas $vectorSearch retrieves historically similar cases. The score delta is computed by calling computeScore(extracted, []) vs computeScore(extracted, similarCases) and persisted on every Case document as score_without_retrieval. Numbers below are from the 50-case demo dataset; live stats available at /api/stats/public.
EXAMPLE — RODRIGUEZ FAMILY (EVICTION, 2-DAY DEADLINE)
Why is this an agent?
Does the model select tools?
Gemini Flash evaluates the live docket profile and selects an execution strategy — this decision determines whether and at what depth CourtListener runs.
Does execution branch?
Two branches: CourtListener depth is model-driven; documentation remediation is threshold-driven. Both are logged with evidence.
Is retrieval grounded?
Atlas $vectorSearch results are passed verbatim into the Gemini Flash recommendation prompt, directly influencing output.
Why MongoDB?
Why Atlas for storage?
The AgentRun document stores variable-length steps[], decisions[], and vector_search_results[] — shapes that require multiple joined tables in relational stores.
Why Atlas Vector Search?
$vectorSearch and document retrieval run in the same aggregation pipeline. No external vector DB, no synchronization lag.
Does retrieval always increase scores?
No — retrieval only increases urgency when a past case is both factually similar (≥0.55 cosine similarity) AND has a meaningful outcome. Won = up to 15 pts. Settled = up to 10 pts. Declined = up to 5 pts only at ≥0.70 similarity. Low-similarity matches and weak declined cases contribute zero — leaving score_without_retrieval === priority_score. The distribution is: min delta=0, max delta=15.
Why does a declined case increase urgency?
A highly similar declined case (cosine ≥0.70) is evidence the fact pattern is recognized in legal practice — even though the outcome was negative. It tells the attorney this is a real legal matter worth reviewing, not a frivolous claim. The signal is capped at 5 pts vs. 15 pts for a won case. Below 0.70 similarity, declined cases contribute zero.
Why Google Cloud?
Which GCP services run?
Vertex AI (Gemini Pro + Flash), Cloud Logging (structured run logs), Cloud Monitoring (7 custom time series per run), Firebase Auth (JWT). 5 distinct GCP integrations.
Why Vertex AI over API keys?
OAuth 2.0 Bearer token via aiplatform.googleapis.com — compatible with enterprise GCP org policies that block API key usage.
What goes to Cloud Monitoring?
Per-run custom metrics: run_duration_ms, cases_reviewed, critical_cases, vector_matches, recommendations, decisions_logged, adaptive_search. Visible in Metrics Explorer.
Why human review?
What requires authorization?
All critical-priority recommendations are flagged. No legal filing, court communication, or client contact is initiated without attorney sign-off.
What is autonomous?
Triage ranking, historical retrieval, recommendation drafting, and brief generation. Nothing with legal consequence.
How is oversight enforced?
Flagged items appear in the Human Oversight panel with checkbox UI. The audit trail in MongoDB records which items received attorney review.
LIVE INFRASTRUCTURE STATUS
Querying Atlas…
checked —
Gemini Pro
Recommendations & executive report
Steps 6 & 7
Gemini Flash
Model decision — strategy selection
Step 4
justicequeue.agent
Structured run telemetry — Log Explorer
After Step 9
custom metrics
7 time series per run — Metrics Explorer
After Step 9
JWT verification
All authenticated API routes
Every request
Bearer token
Vertex AI + Cloud Logging + Monitoring
Token refresh cache
Why not fully autonomous?
JusticeQueue does not autonomously file motions, contact clients, or take legal action. This is a deliberate design decision for bar association compliance and legal malpractice risk management. Every action with legal consequence requires attorney authorization first.
What makes this deployable?
Every decision is logged with evidence in MongoDB. Every recommendation is reviewed before action. Every run is auditable by run_id. A supervising attorney can inspect the full decision trail and override any recommendation. This architecture is compliant with the ABA Model Rules.
How does this compare to multi-agent systems?
Multi-agent systems that autonomously execute legal actions cannot be deployed to a legal aid clinic without bar association approval and malpractice insurance review. JusticeQueue can be deployed next month. The constraint is a feature, not a limitation.
What is the Google Cloud story?
Vertex AI for text generation (Gemini Pro + Flash) AND text embeddings (text-embedding-004). Cloud Logging for structured run telemetry. Cloud Monitoring for time series metrics. Firebase Auth for JWT verification. Five GCP services — all using the same OAuth 2.0 token.
Authenticate to run the live agent against real case data