Back to Examples

Healthcare AI

HIPAA-compliant patient context and medical history tracking with Memphora

Memphora provides a secure, HIPAA-compliant memory layer for healthcare AI applications. All PHI (Protected Health Information) is automatically encrypted and decrypted, ensuring patient data security while maintaining seamless integration with your healthcare workflows.

Key Features

🔒 Automatic Encryption

PHI data is automatically encrypted at rest using AES-256 encryption when metadata contains data_type: "phi" or compliance: "HIPAA"

📋 Patient Context

Maintain patient context across conversations and sessions, enabling personalized care delivery

💊 Treatment Tracking

Track treatment history with versioning and change tracking for complete audit trails

✅ HIPAA Compliance

Automatic compliance event recording for audit trails and regulatory compliance

API Code Examples with Metadata Types

💡 Important: Memphora is flexible - you decide the metadata types. The examples below are common patterns for healthcare, but you can define your own custom metadata types based on your application's needs. Memphora doesn't enforce any specific metadata structure.

Special Metadata Keys (Memphora recognizes these):

  • data_type: "phi" - Automatically encrypts content when this key is present
  • compliance: "HIPAA" - Triggers automatic encryption and compliance logging

All other metadata keys are user-defined and completely flexible. You can use any structure that fits your use case.

Simple Python examples showing how to store different types of healthcare memories using the Memphora SDK. Each example demonstrates the proper metadata structure for different healthcare data types.

Metadata Types

Common Healthcare Metadata Types (Examples)

type: "patient_registration"

Example: Stores patient registration information: name, age, patient_id, registration date

type: "medical_history"

Example: Stores medical conditions, diagnoses, ICD-10 codes, diagnosis dates, severity, status

type: "treatment"

Example: Stores treatments, medications, dosages, provider information, treatment dates

type: "preference"

Example: Stores allergies, medical preferences, special instructions, dietary restrictions

Security Features

  • ✓
    Automatic Encryption: When data_type: "phi" or compliance: "HIPAA" is in metadata, content is automatically encrypted using AES-256
  • ✓
    Transparent Decryption: Encrypted data is automatically decrypted when retrieved via API endpoints
  • ✓
    Compliance Logging: All PHI access is logged for HIPAA compliance audits and audit trails
  • ✓
    Access Control: Optional API key authentication for multi-tenant deployments and access management

✅ Tested & Verified Features

  • ✓Patient registration and context management
  • ✓Medical history tracking with ICD-10 codes
  • ✓Treatment recording with medications and dosages
  • ✓Allergy and preference management
  • ✓PHI encryption and automatic decryption
  • ✓HIPAA compliance event logging
  • ✓Patient history retrieval and semantic search
  • ✓Multi-patient management and context switching