Muhammad Shahwaiz
  • Prototype

EmoSense AI

An LLM backend that keeps working when the model doesn't.

A text-analysis app built for the CREATE X 2026 AI App Development Challenge. My part was the Express backend: Gemini calls constrained to structured JSON, input validation, logging, and fallbacks that keep the app usable when the model is unavailable.

Scope & stage

A competition prototype with public source code. There is no hosted demo, and the emotion labels haven't been measured against a labelled dataset.

My role

  • I built the Express server: three endpoints, their validation, logging and fallbacks.
  • I defined the JSON schemas the model must answer in, so the interface can render results field by field.

Architecture

A React client talks to one Express server. The server is the only place that talks to Gemini.

Conceptual flow, simplified from the codebase.

  1. Validate

    Missing fields return a 400 with a readable message

  2. Constrain

    Gemini is called with a JSON MIME type and a response schema

  3. Fall back

    No key or a failed call returns a rule-based result, labelled as a fallback

  4. Render

    The client shows emotions, sentiment, urgency and suggested replies

Key decisions

  • Structured output over free text. A schema makes a response either usable or clearly failed.
  • Fallbacks say they are fallbacks. A failed model call returns a result that identifies itself, not something dressed up as model output.

Limitations

  • Emotion and risk labels haven't been evaluated against a labelled dataset.
  • It is a decision-support demo, not a clinical or safety tool.