Castor for Psychiatry Practices: Offline AI That Manages Medication Records Without Cloud Risk
Psychiatric records sit at the intersection of HIPAA, DEA Schedule II, and state PDMP requirements. Castor runs fully offline on your own hardware — no cloud, no subscription — and handles medication tracking, prior auth deadlines, lab monitoring alerts, and PDMP workflows.
Psychiatric records are among the most sensitive files in medicine — DSM diagnoses, controlled substance prescriptions, prior authorization trails for antipsychotics. Yet most cloud-based EHRs store that data on servers a practice doesn't control, governed by privacy policies that change without warning.
Castor is an offline AI agent that runs entirely on your own hardware — no internet connection after setup, no subscription, no third-party servers. For psychiatry practices juggling HIPAA, DEA Schedule II requirements, state PDMP compliance, and insurance prior authorizations, running AI locally isn't just a privacy preference. It's risk management.
The Three Compliance Layers Psychiatry Practices Navigate Daily
Psychiatry sits at the intersection of three distinct regulatory frameworks, each with its own documentation burden.
HIPAA and 42 CFR Part 2
Standard psychiatric records are protected health information under HIPAA. But when records include a substance use disorder (SUD) diagnosis — common in practices treating depression comorbid with alcohol dependence, or ADHD with stimulant misuse — 42 CFR Part 2 applies additional restrictions. Under 42 CFR Part 2, SUD records cannot be disclosed without specific written consent that cannot be buried in a general HIPAA authorization. Cloud-based AI tools that process clinical notes may inadvertently commingle these records, creating disclosure liability every time a patient summary is generated.
DEA Controlled Substance Requirements
A psychiatry practice prescribing stimulants (Adderall, Vyvanse, Ritalin) and benzodiazepines (Xanax, Klonopin, Ativan) must maintain meticulous DEA compliance. Schedule II medications cannot be refilled — each prescription requires a new written or electronic script. Schedule IV medications allow refills but carry their own dispensing limits. Every prescription must be documented, and any deviation from DEA requirements can result in license revocation.
State PDMP Obligations
Forty-nine states now require prescribers to check the Prescription Drug Monitoring Program (PDMP) before prescribing Schedule II or III controlled substances. Some states extend this requirement to Schedule IV medications. PDMP checks must be documented in the clinical record. Missing documentation is a compliance gap that survives audit years after the prescription was written.

How Castor Fits Into a Psychiatry Practice Workflow
Castor doesn't replace an EHR. It acts as an AI layer on top of your existing workflow — processing documents, tracking deadlines, and surfacing information through a Telegram bot interface that works from any phone without exposing data to cloud servers.
Medication Management Memory
Castor's three-layer memory system stores structured facts about each patient's medication history: current medications, dosages, last fill dates, pharmacy, insurance formulary tier, and any documented allergies or adverse reactions. When a staff member asks "When is Mr. Okonkwo's lithium refill due?" through the Telegram bot, Castor retrieves the answer from local memory in seconds — no external API call, no data leaving the office.
For patients on lithium, valproate, or clozapine — medications requiring regular serum level monitoring — Castor tracks lab draw schedules and generates automated reminders. A lithium patient who hasn't had a level drawn in 90 days triggers an alert before the next appointment, not during it.
Prior Authorization Tracking for Psychiatric Medications
Insurance prior authorizations for brand-name psychiatric medications are a significant administrative burden. Insurers routinely require step therapy documentation before approving:
- Vraylar (cariprazine) — requires trial of at least two generic antipsychotics
- Latuda (lurasidone) — requires trial of first-generation antipsychotics or generic second-generation agents
- Abilify Maintena (aripiprazole extended-release injection) — requires documentation of oral antipsychotic trial and documented adherence issues
- Spravato (esketamine) — requires documented treatment-resistant depression with failed trials of at least two antidepressants
- Vyvanse (lisdexamfetamine) — most commercial plans require a failed trial of generic amphetamine salts
Castor ingests PA approval and denial letters as PDFs or scanned images, extracts the expiration date and any step therapy requirements, and stores them in patient memory. When a PA is about to expire, a scheduled reminder fires through the Telegram bot so staff can initiate renewal before coverage lapses — not after the patient shows up for a refill.

Controlled Substance Compliance Without Cloud Exposure
PDMP portal access is a daily task in psychiatry. Before prescribing a Schedule II stimulant or a benzodiazepine, the prescriber reviews the patient's prescription history across all pharmacies and all prescribers in the state. Most PDMP portals require a browser login and generate a printable report that gets scanned into the chart.
Castor's browser automation module (built on Playwright MCP) can handle structured portions of this workflow — navigating to the PDMP portal, pulling the report, saving it locally, and appending a timestamped note to the patient's local record indicating the check was completed and by whom. No cloud intermediary touches the PDMP report between the state database and the practice's own machine.
Schedule II Prescription Tracking
Because Schedule II medications cannot be refilled, every new prescription is a documentation event. Castor tracks active Schedule II prescriptions and their expected end dates based on the days-supply dispensed. When a patient is due for a new script, a reminder fires through the scheduled routines module — surfaced via Telegram with the patient name, medication, last fill date, and days remaining before the current supply runs out.
For practices using electronic prescribing for controlled substances (EPCS), Castor can maintain a complete local prescription log that is searchable by patient, medication, date range, or prescriber. If a DEA audit request arrives, the practice has a queryable local record rather than depending on an EHR vendor's export tools.
Lab Monitoring Protocols for High-Risk Medications
Several classes of psychiatric medications require routine lab monitoring. Missed draws create medical and legal exposure — particularly for clozapine, where REMS program requirements mandate specific ANC thresholds before dispensing.
| Medication | Required Labs | Monitoring Frequency |
|---|---|---|
| Lithium | Serum lithium, BMP (creatinine, eGFR), TSH | Every 3–6 months when stable |
| Valproate (Depakote) | Serum valproate, LFTs, CBC with platelets | Every 6 months |
| Clozapine (Clozaril) | ANC (absolute neutrophil count) | Weekly ×26 weeks, then monthly |
| Second-gen antipsychotics (Zyprexa, Seroquel) | Metabolic panel: weight, BMI, fasting glucose, HbA1c, lipids | Baseline, 3 months, then annually |
| Lamotrigine (Lamictal) | Serum level if adherence concern; LFTs | As clinically indicated |
Castor stores each patient's medication start date and last lab draw date in local memory. A daily scheduled routine — configured in natural language as "daily 08:30" — scans that memory and flags any patient where a lab draw is overdue. The output surfaces as a Telegram notification at the start of the clinical day: patient name, lab needed, days overdue. The team can triage the list before the first appointment without opening the EHR.

Setting Up Castor for a Psychiatry Practice
Castor runs on any Windows, macOS, or Linux machine with at least 8 GB of RAM and 6 GB of GPU VRAM — a standard office workstation or a capable laptop. The language model runs locally through LM Studio or Ollama; no internet connection is required after initial setup.
A typical psychiatry office configuration:
- Install Castor and load a small language model such as Qwen 3.5 9B or Gemma 4 E4B — both run well on 6–8 GB VRAM
- Configure the Telegram bot so front desk staff can query patient records and receive alerts from their phones without VPN access
- Seed patient memory by ingesting existing medication records — PDFs, scanned charts, or CSV exports from your current EHR
- Create scheduled routines for daily lab monitoring alerts, PA expiration reminders, and Schedule II refill flags — set in plain English
- Connect browser automation for PDMP portal workflows and insurance portal PA submissions
The entire setup runs behind the office firewall. No patient name, diagnosis, or prescription ever leaves the practice's own hardware.
What Castor Doesn't Replace
Castor is an AI assistant layer, not a prescribing system or EHR. It doesn't handle e-prescribing, insurance eligibility verification, or clinical decision support in the sense of contraindication checking. It works alongside existing systems — surfacing information, tracking deadlines, and processing documents — without replacing the prescriber's clinical judgment.
Practices exploring Castor for other clinical workflows may also find the mental health therapist use case useful for the note-writing and intake automation side, and the pain management clinic case for overlapping DEA compliance patterns.