Inspiration

In India, 95% of small clinics run entirely on paper registers. When a patient visits a new clinic down the road, their critical medical history—allergies, past diagnoses, active medications—stays behind in a paper notebook. Nobody checks, and nobody knows. This lack of data sharing leads to millions of preventable drug interactions every year.

We wanted to bridge this gap instantly, without requiring rural clinics to buy expensive systems or hire IT teams. CliniqAI was inspired by a simple idea: if a doctor can snap a photo of a handwritten prescription on a cheap Android phone, they should have the power of a modern, safety-gated electronic health record in under 3 seconds.

What it does

CliniqAI is a mobile-first, multi-agent clinical safety system designed for paper-first clinics.

  1. Multilingual Handwriting OCR: The doctor snaps a photo of a prescription (written in English, Hindi, Bengali, Tamil, etc.).
  2. Cross-Clinic Memory: It instantly retrieves the patient's unified medical history across all clinics using only their mobile number as a universal key.
  3. Automated Safety Check: It cross-checks the new prescription against past history for drug conflicts or allergies (e.g., catching a penicillin allergy conflict).
  4. Hard Safety Gate: If a critical conflict is found, it triggers a blocking warning that prevents saving until the doctor acknowledges or changes it.

It takes 5 minutes to set up, is completely free, and works on any phone.

How we built it

We built CliniqAI on a true multi-agent supervisor architecture using the Google Agent Development Kit (ADK):

  • Supervisor (Orchestrator): Coordinates the pipeline and enforces strict Pydantic schema validation at each step to prevent silent data corruption.
  • ExtractionAgent (Gemini 2.0 Flash on Vertex AI): Handles multilingual OCR and structures handwritten text into validated JSON.
  • PatientContextAgent (MongoDB Atlas via MCP Server): Queries the global patient database to retrieve medication history. We mapped MongoDB as a Model Context Protocol (MCP) toolset.
  • SafetyAgent: Evaluates conflict logic and flags high-severity alerts.
  • RecordUpdateAgent: Writes the transaction to MongoDB and saves the visit history.

To make the workflow practical for busy doctors, we run the OCR extraction and MongoDB context fetching in parallel using asyncio.gather, bringing the entire process under 3 seconds. The backend is built with Python and FastAPI, deployed on Google Cloud Run, and stores prescription images in Google Cloud Storage.

Challenges we ran into

Our biggest hurdle was dealing with the unpredictable quality of handwritten prescriptions. Hindi prescriptions written on cheap paper with bad lighting from old Android phones are incredibly difficult for standard OCR models. We solved this by using Gemini 2.0 Flash with targeted few-shot schema prompting, forcing the model to output confidence scores. If the confidence drops below a threshold on critical fields, the ADK Supervisor intercepts and flags the record for manual doctor review instead of letting the system guess.

Another challenge was end-to-end latency. Running OCR and fetching databases sequentially was taking over 6 seconds. Rewriting the supervisor to handle these as parallel async calls cut that time in half, keeping doctors from waiting.

Accomplishments that we're proud of

We built a production-ready system that doesn't feel like a toy chatbot. It is a deterministic, safety-critical multi-agent system with hard validation gates. The parallel execution engine works flawlessly, allowing us to parse, cross-reference, and flag medication conflicts in under 3 seconds. The patient data sovereignty portal also gives patients absolute control over which clinics can access their records in real-time.

What we learned

We learned that multi-agent systems are much more powerful when structured deterministically. Instead of letting one large language model run free, separating responsibilities into isolated, traceable agents with strict schema handoffs makes the output robust enough for clinical environments. We also realized how powerful Model Context Protocol (MCP) is for giving agents direct, safe access to databases like MongoDB Atlas.

What's next for CliniqAI

  • WhatsApp Integration: Allowing doctors to simply WhatsApp a photo of a prescription to get safety alerts instantly.
  • Voice-First Interface: Adding localized Hindi voice support for doctors to navigate files hands-free.
  • Government Health ID Integration: Linking directly with Ayushman Bharat Health Accounts (ABHA) in India.

Built With

  • asyncio
  • fastapi
  • gemini-2.0-flash
  • google-agent-development-kit-(adk)
  • google-cloud
  • google-cloud-run
  • html5
  • model-context-protocol-(mcp)
  • mongodb-atlas
  • python
  • vanilla
  • vertex-ai
Share this project:

Updates