JusticeQueueJUDGE MODE

Google Cloud Rapid Agent Hackathon

JusticeQueue — Autonomous Legal Operations Agent

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

INTAKEUploadGemini ExtractScoreAtlas Store→ then →DOCKETModel Decision$vectorSearchCourtListenerGemini RecsBrief
MongoDB AtlasGemini ProCourtListener APIReasoning Engine
1,247
Active cases analyzed
38
Critical matters surfaced
~25s
Agent execution time
~42h
Equivalent manual review time
AGENT EXECUTION TRACEscripted walkthrough · representative of live execution

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

TIMESTEPTOOLDURATIONEVIDENCE
✓ Completed in 0msReplaced ~42 hours of manual legal case review in ~21 seconds (1,247 cases × ~2 min each)
Cases Reviewed
1,247
Active intake records
Critical Surfaced
38
≤ 3 days to deadline
Urgent
71
≤ 7 days to deadline
Historical Matches
14
Via $vectorSearch (5 cases)
Missing Docs
7
Detected automatically
Time Saved
>99%
Time saved vs manual review
DECISION LOG

Every branching decision is logged with the evidence that drove it. Decisions marked model-driven were made by Gemini Flash evaluating the case profile.

MONGODB CHANGES OUTCOMES50-case demo dataset · score_without_retrieval persisted per case

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.

31
Cases where Atlas changed the score
of 50 demo cases
+18
Average score increase from retrieval
urgency points per case
4
Cases promoted to critical tier
would have been missed

EXAMPLE — RODRIGUEZ FAMILY (EVICTION, 2-DAY DEADLINE)

63
Without Atlas
would rank #4
Atlas $vectorSearch
found 3 similar eviction cases
91.2% cosine similarity → WON
88
With Atlas
CRITICAL — ranks #1
Δ +25 points
MongoDB Atlas retrieved a 2023 eviction case with 91.2% semantic similarity that was won by the tenant. The precedent match added 15 similarity points, promoting this family's case to critical priority.
MONGODB OPERATIONS
MongoDB Atlas
1,247
Active cases in MongoDB Atlas
Retrieved via MongoDB MCP Server → Atlas connection
MongoDB Atlas
14
Matches · 89.2% top similarity
Atlas $vectorSearch · index: description_embedding_index
MongoDB Atlas
9
Court opinions retrieved
CourtListener API · Free Law Project
MongoDB Atlas
Execution trace stored
Run #demo9x4k2a · 13 steps · 8 model decisions · Complete
JUDGING REVIEW

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

GOOGLE CLOUD INFRASTRUCTURE
Vertex AI

Gemini Pro

Recommendations & executive report

Steps 6 & 7

Vertex AI

Gemini Flash

Model decision — strategy selection

Step 4

Cloud Logging

justicequeue.agent

Structured run telemetry — Log Explorer

After Step 9

Cloud Monitoring

custom metrics

7 time series per run — Metrics Explorer

After Step 9

Firebase Auth

JWT verification

All authenticated API routes

Every request

OAuth 2.0

Bearer token

Vertex AI + Cloud Logging + Monitoring

Token refresh cache

AGENT VERIFICATION
Cases analyzed and ranked by urgency, vulnerability, and deadline
AI recommendations generated with supporting evidence and historical precedents
Executive brief prepared with operational action plan
Execution trace persisted to MongoDB Atlas (Run #demo9x4k2a)
Human review requested for 3 high-risk decisions
DEPLOYMENT READINESS

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.

Try the Live Product

Authenticate to run the live agent against real case data

Operations Center →Agent Activity →Executive Brief ↗