ClinicPrepProvider Resources

Clinic Document Ingestion

Learn how ClinicPrep processes clinic brochures, checklists, and instructions into sensory-friendly patient roadmaps.

The Ingestion Pipeline Explained

ClinicPrep uses a Retrieval-Augmented Generation (RAG) architecture to ensure visit guides are strictly grounded in your actual clinic guidelines. We convert unstructured clinical PDF and text documents into structured patient briefings through four steps:

  1. Text Extraction: Raw files (PDF or plain text guides) are read by our background workers. Text blocks and schedules are extracted dynamically.
  2. Semantic Chunking: The text is split into chunks of approximately 500 tokens (~375 words) with overlapping boundaries. This maintains local context across chunk lines.
  3. Vector Embedding: Each chunk is processed using Gemini’s text-embedding-004 model to generate a 768-dimension vector. These vectors represent the semantic meaning of the text.
  4. HNSW Database Indexing: The text chunks and embeddings are stored in a PostgreSQL database with the pgvector extension. An HNSW index is built over the vector column, allowing instant context retrieval when a patient requests a briefing.

Command-Line Ingestion Tool

We are developing an open-source CLI to let healthcare IT administrators index document directories directly.

# ClinicPrep CLI (Roadmap – Not Yet Published)

npm install -g @clinicprep/cli

clinicprep ingest --clinic-id "your-clinic-uuid" --file "./meadowbrook_intake.pdf"

Roadmap Note: The command above is a visual demonstration. The CLI package is currently in design and has not yet been published to the npm registry. IT managers should use the web interface at /clinic-setup for document ingestion.

Why ClinicPrep is Open Source

Access barriers in healthcare should not be gatekept by proprietary APIs or corporate licensing. We believe clinical guide tailoring should be accessible to any hospital system, practitioner, or researcher.

By open-sourcing our database schemas, RAG pipelines, and frontend interfaces, we enable clinics to self-host secure, HIPAA-compliant instances of ClinicPrep. Healthcare providers can adopt, adapt, and scale the application independently within their existing intranet or cloud architecture, completely without our ongoing involvement, commercial dependencies, or subscription locks.