Inspiration

Therapists today spend up to half their time on administrative tasks like note-taking and scheduling, leaving less time and energy for actual patient care. We wanted to design an AI-powered assistant that doesn’t replace therapists, but instead empowers them by giving time, focus, and control back where it belongs: with the therapist.

What it does

Therapy Tracker is a multi-agent AI assistant built on TiDB vector search. It:

  • Generates concise summaries of past therapy sessions.
  • Seamlessly organizes and manages therapist schedules.
  • Provides research-backed recommendations using RAG (Retrieval Augmented Generation) and context-aware suggestions from similar cases.

How we built it

  • Data ingestion & vectorization: Patient session notes and research papers are embedded and stored in TiDB Serverless with vector search.
  • Multi-agent architecture: A swarm of specialized agents (summarization, scheduling, recommendation)
  • LLM integration: Used for summarization and contextual reasoning, combined with RAG to ground outputs in evidence-based sources.

Challenges we ran into

  • Designing a smooth workflow for multiple AI agents to coordinate without conflict.
  • Ensuring recommendations are clinically relevant and trustworthy, not just AI-generated.

Accomplishments that we're proud of

  • Successfully implemented a multi-agent architecture with TiDB vector search powering context retrieval.
  • Created a working assistant that can automate up to 50% of administrative load for therapists.
  • Built a system that highlights how AI can augment care quality without trying to replace human professionals.

What we learned

  • How to design and orchestrate multi-step, multi-agent AI workflows effectively.
  • The power of TiDB vector search for grounding LLM outputs in reliable data sources.
  • The importance of designing AI for empowerment, not replacement, especially in sensitive fields like healthcare.

What's next for Therapy Tracker

  • Expand support for more clinical workflows beyond therapy notes and scheduling.
  • Integrate voice-to-text transcription for live session note automation.

Data Flow and Integration

1) React Front End (Vercel)

  • Next.js/React app deployed on Vercel.
  • Chat + scheduling UI; data fetching via React Query/SWR.
  • Calls backend over HTTPS (REST API)

2) API Layer (Cloud Run).

  • Exposes endpoints (e.g., POST /chat)

3) Router Agent (LangGraph)

  • Classifies each request and routes to:
    • Information Agent (questions, summaries, recommendations)
    • Scheduling Agent (create/modify/cancel appointments)

4) Information Agent → Tools

  • Patient Summary: reads structured data from TiDB tables (Patient Session, Patient Survey).
  • Recommendations: runs RAG over domain docs via vector search (see §6), blends with patient context, returns cited answers.

5) Scheduling Agent → Tools

  • Create / Modify / Cancel Appointment tools operate on TiDB Appointments.

6) Vector Search (TiDB) with Text Embeddings

  • Ingestion pipeline (batch or on-demand):
    • Chunk source docs (guidelines, SOPs, FAQs).
    • Generate vectors using a Text-Embedding-Large model (e.g., text-embedding-3-large).
    • Upsert into TiDB vector columns with metadata {doc_id, chunk_id, source, tags}.
  • Retrieval:
    • Encode the user query with the same model.
    • Similarity search
    • Return top-k chunks to the Information Agent for synthesis and citation.

7) Datastores (TiDB)

  • OLTP tables: Patient Session, Patient Survey, Appointments.
  • Vector index: embedded document chunks.

8) Response Assembly

  • Agents package tool outputs, attach citations, and send structured answers to the API.
  • API streams tokens back to the React app for responsive UX.

9) Observability & Safety

  • End-to-end tracing (API → Router → Agents → Tools → DB).
  • PII/PHI logging rules; encryption in transit/at rest.
  • Rate limiting and abuse checks at the API edge.

10) Front-End UX - UI renders streamed tokens, citations, and appointment confirmations. - Optimistic updates for scheduling; reconciles when final server state arrives.

TiDB Cloud account Email: vanmisc12@gmail.com FrontEnd github: https://github.com/VanessaTong/therapytracker/tree/main

Built With

Share this project:

Updates