💡 Inspiration

Learning to interpret an ECG means connecting small observations into a coherent explanation: where a wave begins, how long an interval lasts, and why a pattern matters.

I wanted to make that reasoning process interactive. TraceMind gives learners a real ECG to explore, tools to mark and measure evidence, and a tutor that helps them work through a case step by step.

One question shaped the project: How can an AI tutor welcome a student's curiosity while keeping a structured lesson on track?

🫀 What it does

TraceMind is an interactive AI tutor for ECG learning. It combines a 12-lead ECG workbench with guided practice and an independent question assistant.

  • Explore real recordings: View ECG cases, switch leads, and inspect an enlarged waveform.
  • Practice with evidence: Select waveform boundaries and use digital calipers to measure intervals.
  • Learn through guided reasoning: Work through observation, localization, measurement, explanation, and synthesis, with progressive hints and feedback.
  • Ask questions along the way: Open a separate assistant for clarification, then return to the same lesson step.
  • Review progress: Track completed evidence goals and revisit saved questions.
  • Choose a language: Use the interface and future agent replies in English or Chinese.

An authoring workspace supports waveform review, AI-assisted lesson planning, question generation, and explicit publication checks.

TraceMind is built for education and practice, not patient diagnosis or treatment.

🛠️ How we built it

I built the web application with Next.js, React, and TypeScript, using Canvas for waveform rendering, Zustand for client state, and Zod for structured data validation.

The ECG pipeline uses Python, WFDB, and NumPy to import digital recordings and annotations from LUDB. These become lead-specific waveform objects with timestamps and boundaries. Derived measurements and waveform summaries provide structured context for teaching. A separate NeuroKit2 workflow supports synthetic ECG case creation.

The teaching architecture separates three responsibilities:

  1. A lesson state machine controls the current step, action assessment, scoring, and progression.
  2. A teaching tutor provides instructional strategy, explanations, and feedback within the current task's constraints.
  3. A question assistant handles independent questions in its own conversation history without updating lesson progress.

AI-generated teaching plans and question contracts pass through automated validation and an authoring review workflow before publication. Vitest and Playwright support regression and interaction testing.

🧩 Challenges we ran into

Turning ECG signals into interactive learning material

The waveform needed to support precise interaction. A learner's selection had to correspond to a particular lead, wave, and time range.

I imported the original digital signals and available annotations, converted them into structured waveform objects, and added derived candidates for further review. The authoring tools let a reviewer accept, reject, or adjust candidates and their boundaries.

Grounding explanations in the displayed evidence

A fluent explanation can still refer to the wrong lead, an unsupported finding, or a conclusion the learner has not established.

I connected teaching steps to explicit evidence IDs, permitted leads, waveform types, and reviewed knowledge. The model receives structured measurements and relevant evidence summaries. Server-side rules assess submitted operations and constrain what the tutor can disclose at each stage.

Combining quality gates with human judgment

Generated lessons needed checks for schema validity, evidence references, answer leakage, question structure, and executable learning paths.

I added software quality gates and a human-in-the-loop review process. Reviewers can inspect candidate plans and questions, repair individual issues, and explicitly publish a draft. Selected question-quality heuristics can receive a recorded human acknowledgment; structural and evidence-boundary failures remain blocking. This makes review decisions visible and traceable.

Preserving the lesson when a student interrupts

This was the most important architectural challenge. In the earlier design, teaching and spontaneous questions shared a conversational flow. A follow-up question could divert the tutor, and returning to the original task became unreliable.

I separated the teaching tutor from the question-answering assistant. Each has its own conversation state. The question assistant receives lesson context but does not update the lesson's current step, score, or completion state. Its temporary waveform focus is cleared when the learner closes it, restoring the lesson view.

The learner can ask a question, explore the explanation, and continue from the same task. Regression tests check that question answering leaves lesson progress unchanged.

🏆 Accomplishments that we're proud of

  • Connecting real ECG recordings, interactive measurement tools, and guided teaching in one workspace.
  • Making spontaneous questions compatible with a persistent, structured learning path.
  • Building an inspectable authoring workflow with automated checks and human review.
  • Supporting English and Chinese across the interface and agent responses.
  • Testing failure scenarios, including interrupted lessons, model outages, and isolated question-generation failures.

📚 What we learned

An effective AI tutor needs clear boundaries between conversation, evidence, and learning progress. Keeping those responsibilities separate made the system easier to test and recover when something went wrong.

I also learned that usable ECG teaching depends on the details: lead identity, annotation boundaries, measurement units, and the order in which evidence becomes available. The interface and the teaching logic have to agree on all of them.

🚀 What's next for TraceMind

  • Expand the reviewed case collection and improve case-authoring tools.
  • Evaluate the learning experience with students and educators.
  • Refine personalized practice using learning history and recurring difficulties.
  • Improve accessibility and the experience on smaller screens.
  • Explore voice interaction while preserving the separation between lesson progression and open questions.

Built With

Share this project:

Updates

Submission history