Skip to content

7kzaincode/toothfairy

Repository files navigation

🦷 toothfairy

One click. Every diagnosis. Zero tab switching.

toothfairy is a cursor-inspired, AI-powered dentistry assistant built for both sides of the chair. For dentists, it brings X-ray analysis, clinical notes extraction, and treatment planning into a single intelligent workspace, streamlining + syncing workflows (i.e. removing the need for doctors to grab physical documents). For patients, it replaces confusion and paper printouts with a visual, plain-language dashboard they can check from home. It remembers patient records across every visit, giving clinicians and clients the same complete picture: current findings, treatment history, and what comes next :)

Demo Images

What it Does

Dentists deal with way too many disconnected tools every day: practice management software, separate imaging viewers, static paper charts, CDT code references, insurance portals. None of them talk to each other and none of them remember the patient properly. There's no way to quickly see "tooth #36 had a cavity six months ago, we filled it, and now there's a periapical lesion forming."

But there's another problem nobody talks about: the patient has no idea what's going on. You go to the dentist, they point at a blurry X-ray and say "see that shadow?" and you just nod. Then you go home and couldn't tell someone what's wrong with your teeth if you tried.

For dentists: Upload an X-ray or highlight clinical notes, and toothfairy extracts findings, lights up affected teeth on an interactive chart, and builds a treatment timeline with CDT codes and costs. It pulls in history from past visits and handles the boring stuff so the dentist can focus on clinical judgment. Shorter appointments, more patients per day.

For patients: Color-coded teeth, plain descriptions, treatment timelines, cost estimates. Pull up your dental history at home and see how things have changed.

Architecture

Next.js React Tailwind CSS TypeScript Three.js

FastAPI Python Pydantic

Google Gemini    TensorFlow    OpenCV    Moorcheh AI    PharmacyMCP
Layer Service Purpose
Frontend Next.js 16, React 19, Tailwind CSS 4, Three.js Three-pane IDE layout, SVG tooth chart, 3D viewer
Backend FastAPI, Python, Pydantic Copilot orchestration, session management, API routing
LLM Google Gemini 2.5 Flash (google-genai SDK) Structured JSON extraction from clinical notes
Vision Google Gemini Vision Pathology detection in X-ray regions
Segmentation TensorFlow/Keras (U-Net), OpenCV (CCA + contour extraction) Semantic segmentation of panoramic X-rays, individual tooth isolation
Medication Lookup PharmacyMCP + Health Canada DPD API Real-time drug product and DIN lookup based on findings
Patient Memory Moorcheh AI SDK Per-patient namespaces, longitudinal history
Streaming SSE (sse-starlette) Real-time copilot log streaming
Image Processing Pillow, NumPy X-ray manipulation and region cropping

Getting Started

Prerequisites

  • Node.js 18+
  • npm
  • Python 3.10+
  • pip

1. Clone and install

git clone https://github.com/your-repo/tooth-fairy.git
cd tooth-fairy

Frontend:

cd frontend
npm install

Backend:

cd backend
pip install -r requirements.txt

2. Download the segmentation model

The U-Net model weights (~154 MB) are tracked via Git LFS. After cloning, run:

git lfs pull

The weights will download automatically to their correct location.

GitHub provides 1 GB of LFS storage free — the model (154 MB) fits comfortably within that.

4. Set up environment variables

Create backend/.env:

GOOGLE_API_KEY=your_gemini_api_key
MOORCHEH_API_KEY=your_moorcheh_api_key    # optional, works without it
DEMO_MODE=true                             # uses cached data for demo

5. Run the backend

cd backend
uvicorn main:app --reload --port 8000

6. Run the frontend

cd frontend
npm run dev

Open http://localhost:3000.

Demo Mode

Set DEMO_MODE=true in your .env to use pre-computed cached data for all copilots. This skips live API calls and gives you a reliable demo experience. Cached assets live in assets/cache/.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors