Project Info
Professional medical care in seconds, when the seconds matter
Inspiration
Natural disasters often put emergency medical responders (EMTs, paramedics, combat medics, etc.) in positions where they must assume responsibilities beyond the scope of their day-to-day job. Inspired by this reality, we created MedKnight, an AR solution designed to empower first responders. By leveraging cutting-edge computer vision and AR technology, MedKnight bridges the gap in medical expertise, providing first responders with life-saving guidance when every second counts.
What it does
MedKnight helps first responders perform critical, time-sensitive medical procedures on the scene by offering personalized, step-by-step assistance. The system ensures that even "out-of-scope" operations can be executed with greater confidence. MedKnight also integrates safety protocols to warn users if they deviate from the correct procedure and includes a streamlined dashboard that streams the responder’s field of view (FOV) to offsite medical professionals for additional support and oversight.
How we built it
We built MedKnight using a combination of AR and AI technologies to create a seamless, real-time assistant: Meta Quest 3: Provides live video feed from the first responder’s FOV using a Meta SDK within Unity for an integrated environment. OpenAI (GPT models): Handles real-time response generation, offering dynamic, contextual assistance throughout procedures. Dall-E: Generates visual references and instructions to guide first responders through complex tasks. Deepgram: Enables speech-to-text and text-to-speech conversion, creating an emotional and human-like interaction with the user during critical moments. Fetch.ai: Manages our system with LLM-based agents, facilitating task automation and improving system performance through iterative feedback. Flask (Python): Manages the backend, connecting all systems with a custom-built API. SingleStore: Powers our database for efficient and scalable data storage. SingleStore We used SingleStore as our database solution for efficient storage and retrieval of critical information. It allowed us to store chat logs between the user and the assistant, as well as performance logs that analyzed the user’s actions and determined whether they were about to deviate from the medical procedure. This data was then used to render the medical dashboard, providing real-time insights, and for internal API logic to ensure smooth interactions within our system. Fetch.ai Fetch.ai provided the framework that powered the agents driving our entire system design. With Fetch.ai, we developed an agent capable of dynamically responding to any situation the user presented. Their technology allowed us to easily integrate robust endpoints and REST APIs for seamless server interaction. One of the most valuable aspects of Fetch.ai was its ability to let us create and test performance-driven agents. We built two types of agents: one that automatically followed the entire procedure and another that responded based on manual input from the user. The flexibility of Fetch.ai’s framework enabled us to continuously refine and improve our agents with ease. Deepgram Deepgram gave us powerful, easy-to-use functionality for both text-to-speech and speech-to-text conversion. Their API was extremely user-friendly, and we were even able to integrate the speech-to-text feature directly into our Unity application. It was a smooth and efficient experience, allowing us to incorporate new, cutting-edge speech technologies that enhanced user interaction and made the process more intuitive.
Challenges we ran into
One major challenge was the limitation on accessing AR video streams from Meta devices due to privacy restrictions. To work around this, we used an external phone camera attached to the headset to capture the field of view. We also encountered microphone rendering issues, where data could be picked up in sandbox modes but not in the actual Virtual Development Environment, leading us to scale back our Meta integration. Additionally, managing REST API endpoints within Fetch.ai posed difficulties that we overcame through testing, and configuring SingleStore's firewall settings was tricky but eventually resolved. Despite these obstacles, we showcased our solutions as proof of concept.
Accomplishments we're proud of
We’re proud of integrating multiple technologies into a cohesive solution that can genuinely assist first responders in life-or-death situations. Our use of cutting-edge AR, AI, and speech technologies allows MedKnight to provide real-time support while maintaining accuracy and safety. Successfully creating a prototype despite the hardware and API challenges was a significant achievement for the team, and was a grind till the last minute. We are also proud of developing an AR product as our team has never worked with AR/VR.
What we learned
Throughout this project, we learned how to efficiently combine multiple AI and AR technologies into a single, scalable solution. We also gained valuable insights into handling privacy restrictions and hardware limitations. Additionally, we learned about the importance of testing and refining agent-based systems using Fetch.ai to create robust and responsive automation. Our greatest learning take away however was how to manage such a robust backend with a lot of internal API calls.
What's next
Our next step is to expand MedKnight’s VR environment to include detailed 3D renderings of procedures, allowing users to actively visualize each step. We also plan to extend MedKnight’s capabilities to cover more medical applications and eventually explore other domains, such as cooking or automotive repair, where real-time procedural guidance can be similarly impactful.
Cal Hacks 11.0
Amit Rand, Aman Desai, Allison Jiang, Jonathan Kim
Analysis
View
Metric
- 17
- 5
- 3
Figures cover GitHub contributors during the hackathon window. A co-authored commit counts in full for each author, so per-member totals add up to more than the whole-team figures.
Technology
- FlaskIn code
- HTMLIn code
- OpenAIIn code
- PythonIn code
- C#Claimed
4 of 5 appear in the indexed code. 1 claimed on Devpost could not be matched to code, which may simply mean the tool leaves no trace in the repository.
AI coding agents
No AI coding agent signals were found in this repository.
Detected from committed agent config files and commit authorship. Absence of a signal is not proof an agent was unused.
Codebase size
Source size
75 KB
Source files
21
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
amanpdesai/calhacks
30 files · 3.4 MB · @ 2959bcc
Structure
API & routing
5 files · 17%Request entry points: routes, handlers and controllers.
Application logic
14 files · 47%Domain rules, services and shared utilities.
Data & schema
2 files · 7%Schema definitions, migrations and data access.
Supporting
Layers are inferred from where files sit in the tree, not from reading the code. A project that names its directories unconventionally will read oddly here — open the file browser to check anything the diagram implies.
Languages
- Python93%
- HTML7%
- Markdown0%
Share of indexed source by file size. Binary and vendored files are excluded.
Dependencies
requirements.txt
pypi · 10- config
- cv2
- deepgram-sdk
- flask
- imgcat
- openai
- pillow
- PyMySQL
- python-dotenv
- uagents
Declared in the repository’s manifests at the indexed commit. A declared package is not proof it is used, and runtime dependencies are listed first.
Feature verification
Computer vision analysis of live camera feedVerified
Leveraging cutting-edge computer vision and AR technology to bridge the gap in medical expertise
Claimed on Devposthigh confidenceserver/image_description.py:33— get_in_depth_summary sends a frame image to GPT-4o-mini vision model to describe what's happening in the sceneserver/app.py:96— /grab-frame endpoint captures a single frame via OpenCV (cv2.VideoCapture) for analysis
Deepgram text-to-speechVerified
Deepgram enables text-to-speech conversion for human-like interaction
Claimed on Devposthigh confidencebackend/utils/text_to_speech.py:6— text_to_wav posts text to Deepgram's /v1/speak TTS API and saves the returned audio as a .wav filebackend/agents/assistant.py:185— assistant agent calls text_to_wav(assistant_response, ...) after generating each response
Fetch.ai LLM-based agents managing system with automated and manual-input agent typesVerified
Fetch.ai manages the system with LLM-based agents; two agent types built — one automatic, one responding to manual input
Claimed on Devposthigh confidencebackend/agents/assistant.py:17— assistant_agent built with uagents.Agent, exposes REST endpoint and message handlersbackend/agents/user.py:42— user_agent auto-advances through steps with a hardcoded confirmation ('Yes, proceed to the next step.')backend/agents/userinput.py:49— alternate user_agent variant waits for real user input() before sending the next message, matching the 'manual input' agent type
Flask backend connecting all systems via custom APIVerified
Flask (Python) manages the backend, connecting all systems with a custom-built API
Claimed on Devposthigh confidenceserver/app.py:17— Flask app defines routes for video streaming, transcript ingestion, instruction comparison, and forwarding data to the Fetch.ai agent via requests.post
Safety deviation warning systemVerified
MedKnight integrates safety protocols to warn users if they deviate from the correct procedure
Claimed on readmehigh confidenceserver/image_description.py:83— checkai_instr_vs_summaries compares instruction vs image/audio and returns Proceed/Do Not Proceed verdictbackend/agents/assistant.py:233— handle_user_message checks request_judgement for 'do not proceed' and sends a corrective prompt to the user
SingleStore database for chat logs and performance/deviation logsVerified
SingleStore stores chat logs between user and assistant, plus performance logs analyzing deviation from procedure, feeding the dashboard
Claimed on Devposthigh confidencebackend/agent2.py:5— connects to a SingleStore-hosted MySQL-compatible DB and creates Step_N tables plus a Transcript tablebackend/agents/assistant.py:44— insert_chat_log writes Speaker/Message rows (Chat, Judgement, User) into per-step SingleStore tablesserver/app.py:184— update_sql_base writes User and Judgement rows used for deviation detection into SingleStore
Step-by-step medical procedure guidance via LLM assistantVerified
MedKnight offers personalized, step-by-step assistance to first responders performing critical medical procedures
Claimed on readmehigh confidencebackend/agents/assistant.py:147— handle_user_message walks through instruction_list steps, calls get_openai_response with step-specific prompts, and advances current_stepbackend/agent2.py:55— steps list contains a full chest-tube/catheter thoracostomy procedure broken into 37 steps loaded into the DB as instructions
'Out-of-scope' operation support for non-specialist respondersCode-supported
The system ensures even out-of-scope operations can be executed with greater confidence by non-specialists
Claimed on readmelow confidencebackend/agent2.py:55— hardcoded procedure (chest tube/catheter thoracostomy, normally physician-performed) is the only procedure implemented, showing single-procedure proof-of-concept rather than general out-of-scope coverage
Dashboard streaming responder FOV to offsite professionalsCode-supported
A streamlined dashboard streams the responder's field of view to offsite medical professionals for oversight
Claimed on readmemedium confidenceserver/templates/index.html:160— Dashboard HTML has a webcam-section with a /video stream tag and a chat log sectionserver/app.py:92— /video route streams frames via generate_frames() using local OpenCV camera capture, and /stream route renders the dashboard template
Deepgram speech-to-textCode-supported
Deepgram enables speech-to-text conversion, including integration into the Unity application
Claimed on Devpostlow confidenceserver/app.py:223— /transcript POST endpoint receives a 'transcript' field and stores it as latest_transcript, implying an external STT client posts transcribed text here, but no Deepgram STT call or Unity integration code exists in this repo
AR / Meta Quest 3 headset integration via UnityClaimed only
Meta Quest 3 provides live video feed from the first responder's FOV using a Meta SDK within Unity
Claimed on Devposthigh confidenceDall-E generated visual referencesClaimed only
Dall-E generates visual references and instructions to guide first responders through complex tasks
Claimed on Devposthigh confidence
An AI agent derived these features from the project’s Devpost page and readme, then searched the code for each one. Verified features are backed by cited code; claimed-only features had no supporting code, which is not by itself proof a feature is missing.
Export this project's context (description, README, evidence, key source files) to chat with an AI agent elsewhere.