Skip to content

maxmilneaus/clinical-notes-ai

Repository files navigation

On-Device Case Notes

A privacy-first experiment in clinical documentation

A local AI system for automating clinical case notes. All processing happens on your machine—no data leaves your computer.

Read the full story behind this project


Overview

This tool automates the formatting of clinical case notes using on-device LLMs. Instead of recording sessions live (which creates privacy concerns and shifts the therapeutic dynamic), you record your own reflections after the session and have them structured by a local AI.

The pipeline:

  1. Record your post-session reflections as an audio file
  2. Transcribe using on-device transcription (Mac Whisper)
  3. Process through a local LLM prompt chain (LM Studio)
  4. Review the structured case note in your Obsidian vault

Why Local?

  • Privacy: Client data never leaves your machine
  • Security: No supply-chain vulnerabilities from cloud APIs
  • Therapeutic Integrity: No "AI in the room" during sessions
  • File Over App: Your data stays in universal formats (Markdown) that you control

Requirements

  • macOS (for Quick Action integration)
  • Python 3.8+
  • LM Studio running locally
  • requests and PyYAML libraries

Tested with:

  • Model: Gemma 3 27B (via LM Studio)
  • Hardware: MacBook Pro M1 Max, 32GB RAM

Installation

  1. Clone this repository
  2. Install Python dependencies:
    pip install requests pyyaml
  3. Configure LM Studio to run locally on http://localhost:1234
  4. Edit config_example.yaml and save as config.yaml
  5. Customize the prompts in Prompts/ to match your clinical voice

Folder Structure

Organise client files within an encrypted Obsidian vault:

/Volumes/Clients/                 # Encrypted macOS volume
└── Client Name/                  # Template for each client
    ├── Documents/                # Intake forms, assessments
    ├── Representations/          # Client-created content
    ├── Transcriptions/           # Voice-recorded summaries
    │   ├── S1 - Transcription.md  # ← Input
    │   └── S2 - Transcription.md
    ├── S1 - Case Note.md         # ← Output
    └── S2 - Case Note.md

Usage

  1. Do the session (no recording, no AI present)
  2. Immediately after: Voice-record a rough summary using Mac Whisper
  3. Drop the transcription into your Obsidian vault at S1 - Transcription.md
  4. Right-click → Quick Actions → Generate Case Note (runs the Python script)
  5. Review and edit the output in S1 - Case Note.md

The Prompt Chain

The system uses a 2-step prompt chain:

  1. Main Body (Prompts/main_body.md): Generates the narrative case note
  2. Dot Points (Prompts/dot_points.md): Extracts themes, goals, and next session plans

Chunking prompts to specific tasks improves output quality, adherence, and speed. You'll need to tailor these to your own clinical voice—expect to iterate 3-5 times before landing on something usable.


The Philosophy

AI can manage the formatting. Not the reflecting.

The act of recalling and verbalising the session is where clinical synthesis happens. This tool automates what comes after—the administrative slog that pulls you out of clinical headspace.


Limitations

  • Requires comfort with local LLM setup
  • macOS-specific Quick Actions integration
  • Prompts tuned to a collaborative, non-directive, Australian English therapeutic voice
  • No error handling to speak of
  • Working prototype, not production software

Important: This is not a medical device. You are responsible for reviewing all output for clinical accuracy.


License

MIT — use freely, modify, share.


How this was made: This code was "vibe coded"—written through conversation with AI assistants (Roo Code and Claude Code). My contribution is the structure and prompt chains, which I hand-wrote and tested against my preferred clinical outcomes. The AI handled the Python syntax.

Built by a therapist using AI tools, not a coder learning therapy. Expect rough edges and thoughtful intentions.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors