Inspiration
In the first minute of an emergency, a bystander may be frightened, imprecise, and unsure which nearby facility can help. A conventional chatbot can sound confident while inventing medical instructions, hospital capabilities, or acceptance. Pulse was built around a stricter question: how can an AI agent help coordinate without pretending to be a clinician or dispatcher?
What it does
Pulse turns a fictional voice or text report into an auditable coordination plan:
- The bystander reviews the report and location.
- Deterministic conservative guidance appears immediately.
- Qwen Cloud
qwen3.7-plusinterprets ambiguity and orchestrates four typed tools. - The tools select a bounded protocol, retrieve sourced nearby-care evidence, prepare a verified handoff, and submit a plan tied to real emitted IDs.
- The application stops for separate human approval before any controlled action.
- Every tool result, report, plan, facility and approval is bound with hashes and signed receipts.
Public facility listings are evidence, not proof of beds, readiness, clinical capability or acceptance. Public judging uses a sandbox outcome and never calls a hospital or emergency-service number.
How we built it
The agent backend is a FastAPI web function on Alibaba Cloud Function Compute in Singapore. It calls Qwen through the official Qwen Cloud OpenAI-compatible endpoint. Qwen owns interpretation and tool sequencing; deterministic Python owns safety protocols, facility allowlists, geospatial evidence, canonical JSON and SHA-256 hashes.
The tool loop is limited to five rounds, 40 seconds, temperature 0.1 and one retry for transient failures. Unknown tools, malformed arguments, invented facility IDs, unseen plan IDs and out-of-order calls are rejected server-side. There is deliberately no approval or calling tool.
A protected Next.js proxy validates the complete agent response and signs the report hash, plan hash, recommended facility and searched-facility allowlist. A separate approval endpoint issues a short-lived dispatch token bound to the same client, report, Qwen run, plan and facility.
Google Places is supported when configured. The no-billing public demo transparently uses a dated Singapore OpenStreetMap snapshot with real OSM IDs and source URLs.
Challenges
The hardest problem was not making Qwen sound intelligent; it was giving the model useful agency while preventing unsupported claims and unauthorized action. We also had to preserve traceability across Qwen Cloud, Function Compute, the web proxy and the human gate without exposing raw reports, exact coordinates, phone numbers or credentials.
Accomplishments
- Authentic Qwen and Function Compute request IDs are visible in the product.
- Five of five live cloud evaluation scenarios produced schema-valid four-tool runs.
- The evaluation recorded zero fabricated facility IDs and zero approval/call tools.
- Ten backend tests and seventeen mocked browser tests pass, together with lint and the production build.
- Modified plans, receipts and facilities fail verification; overrides require a written reason.
- The original Pulse repository and deployment remain untouched.
What we learned
Production-ready agents need explicit boundaries, not just better prompts. Qwen is most valuable where interpretation and adaptive sequencing matter; deterministic services and humans should retain ownership of safety facts, identity constraints and consequential approval.
What's next
Next steps are verified real-time availability partnerships, multilingual voice intake, stronger weak-network behavior, and pilots with controlled response desks. Pulse remains a fictional emergency exercise, not emergency services, medical advice or a medical device.
Existing-work disclosure
Pulse began from a pre-existing mobile bystander interface with voice intake, nearby-care search, provider calling, safety guidance and evidence-based outcome states. The hackathon work added the Qwen Cloud reasoning/tool loop, deterministic protocol boundary, Alibaba Function Compute backend, hashed tool trace, strict ID validation, signed agent receipts, plan/facility-bound human approval, new UI, deployment proof and evaluation suite.
Built With
- ai
- alibaba
- fastapi
- next.js
- openstreetmap
- python
- qwen
- react
- typescript
- vercel
Log in or sign up for Devpost to join the conversation.