No description
Find a file
Daniel 8cca5a4796
Some checks failed
Forgejo Android APK / Root app tests (push) Successful in 50s
Forgejo Docker Build / Root app tests (push) Successful in 48s
Forgejo Android APK / Build signed APK (push) Successful in 2m4s
Forgejo Docker Build / Build Docker image (push) Successful in 12s
Forgejo Docker Build / Deploy to the host (push) Failing after 2s
feat: instructions can ask for the illustration; library scrolls and searches; Modify
Three things to My Resources.

Illustration was entirely the model's call: someone who wanted a figure of
something particular had no way to say so, because the instructions steered the
prose and nothing else. The illustration guidance now tells the model to follow
the author's instructions when they ask for a figure or name what it should
show, and to treat that as the decision already made. Verified live: "include a
diagram showing the age distribution and the simple-versus-complex distinction"
produced exactly that, both halves in one figure.

Exactly one image per generation is a real limit, not a wording choice — the
shared imageTool dispatcher rejects more than one tool call per request, and it
is used by the assistant and Learning Hub too. So the prompt says to draw the
single most useful one if several are asked for, and the screen says the same.

The library was an unbounded list that pushed everything below it off the page.
It is now a 360px scrolling box with a search over title and topic, filtered
locally because the rows are already in hand. "Nothing yet" and "nothing
matches" are different messages, because telling someone whose search missed
that they have never generated anything is wrong. Measured in a real render:
360px visible of 642px of content, and searching narrows 10 rows to 3.

Modify is new UI over the refine endpoint, which existed with no way to reach
it. Pick a resource, say what to change, and it is rewritten in place keeping
its id, its downloads and its References section. The picker is built from the
same library array, so it cannot drift, and a selection survives the refresh
that follows a generation. Verified live: "add a Key Takeaways slide before
References" inserted exactly that and left the other four slides alone.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dv6sqaY6Vq3ChZHMem3cnU
2026-09-11 17:49:27 +02:00
.forgejo/workflows feat: a deploy you can repeat, and prove afterwards 2026-09-11 00:41:11 +02:00
.github feat: ship reviewed prompt history, conversation limits and account protections 2026-09-07 04:01:01 +02:00
android Fix APK crash: replace XML splash with PNG, add real mipmap launcher icons 2026-03-29 11:07:10 +00:00
assets/learning feat: slides are built by pandoc from markdown, with a reference template 2026-09-11 13:25:24 +02:00
docs feat: PubMed search for My Resources, and an image tool that actually fires 2026-09-11 16:47:08 +02:00
e2e test(e2e): seed an admin account, and fix the sign-in that broke the browser suite 2026-09-11 17:24:32 +02:00
migrations feat: PubMed search for My Resources, and an image tool that actually fires 2026-09-11 16:47:08 +02:00
mobile Release v7.14.16 2026-07-31 01:12:47 +02:00
monitoring Add Loki + Grafana monitoring stack, ntfy notifications, biometric auth 2026-04-11 03:00:52 +02:00
public feat: instructions can ask for the illustration; library scrolls and searches; Modify 2026-09-11 17:49:27 +02:00
scripts test(e2e): seed an admin account, and fix the sign-in that broke the browser suite 2026-09-11 17:24:32 +02:00
src feat: instructions can ask for the illustration; library scrolls and searches; Modify 2026-09-11 17:49:27 +02:00
test feat: instructions can ask for the illustration; library scrolls and searches; Modify 2026-09-11 17:49:27 +02:00
.dockerignore feat: ship reviewed prompt history, conversation limits and account protections 2026-09-07 04:01:01 +02:00
.env.example feat: My Resources — anyone can generate teaching material, privately 2026-09-11 14:50:54 +02:00
.gitignore feat: add extension import preview 2026-05-08 22:26:53 +02:00
.gitmessage docs: add CONTRIBUTING.md + .gitmessage template for conventional commits 2026-04-14 23:51:09 +02:00
.node-pg-migraterc.json Add node-pg-migrate for versioned schema changes + better mobile UA labels 2026-04-14 05:06:19 +02:00
admin-cli.js v3.0.0: Auth, admin panel, security fixes, per-tab model selector 2026-03-21 19:25:51 -04:00
CONTRIBUTING.md feat: ship reviewed prompt history, conversation limits and account protections 2026-09-07 04:01:01 +02:00
docker-compose.e2e.yml test(e2e): seed an admin account, and fix the sign-in that broke the browser suite 2026-09-11 17:24:32 +02:00
docker-compose.local.yml feat: ship reviewed prompt history, conversation limits and account protections 2026-09-07 04:01:01 +02:00
docker-compose.monitoring.yml Update bilirubin to exact AAP 2022 values, add exchange transfusion 2026-04-11 05:50:19 +02:00
docker-compose.yml feat: My Resources — anyone can generate teaching material, privately 2026-09-11 14:50:54 +02:00
docker-entrypoint.sh feat: a deploy you can repeat, and prove afterwards 2026-09-11 00:41:11 +02:00
Dockerfile feat: slides are built by pandoc from markdown, with a reference template 2026-09-11 13:25:24 +02:00
grafana-dashboard.json feat: neonatal calculator, DOCX/PPTX/ODT/EPUB support, gateway-agnostic URL helper, TTS/STT fixes 2026-04-19 02:17:06 +02:00
package-lock.json fix: slides shrink to fit, and an article is never offered as slides 2026-09-11 15:34:16 +02:00
package.json fix: slides shrink to fit, and an article is never offered as slides 2026-09-11 15:34:16 +02:00
README.md feat: ship reviewed prompt history, conversation limits and account protections 2026-09-07 04:01:01 +02:00
server.js feat: My Resources — anyone can generate teaching material, privately 2026-09-11 14:50:54 +02:00
TODO.md config: the clinical assistant answers from 12 excerpts 2026-09-11 16:13:55 +02:00

Ped-AI

Ped-AI is a pediatric clinical documentation, education, and bedside decision-support app. This fork has moved well beyond the original scribe app: it now combines encounter documentation, clinical workflows, Learning Hub CMS, admin controls, MCP-backed clinical assistant integration, Redis-backed operational state, and hardened deployment defaults.

The app runs as an authenticated Express/Postgres service with a browser frontend and optional integrations for LiteLLM, Vertex/Gemini, AWS, OpenAI-compatible APIs, Nextcloud WebDAV, S3-compatible storage, OpenBao, Redis, OIDC, TOTP, and Cloudflare Turnstile.

Current Scope

Clinical Documentation

  • Live encounter capture with structured pediatric HPI generation.
  • Dictation cleanup for narrative notes.
  • SOAP, sick visit, well visit, hospital course, chart review, precharting, and ED encounter workflows.
  • Parent-facing education handouts generated from clinician notes, with diagnosis, medication, emergency-care guidance, and preferred-language support.
  • Pediatric developmental milestone tooling.
  • Templates, physician memory, and per-tab model overrides.
  • Server-side speech-to-text routing through configured providers.

Bedside Tools

  • Pediatric calculators and emergency dosing helpers.
  • PE guide and clinical reference content.
  • Vaccines, catch-up schedules, growth/vitals, bilirubin, BSA, GCS, equipment, and resuscitation helpers.
  • Mobile-friendly PWA layout for bedside use.
  • Per-user phone extension and pager directory with soft-delete, search, ZIP export, and JSON/ZIP import for handoff between users.

Learning Hub

  • CMS for articles, clinical pearls, quizzes, and presentations.
  • Tiptap article editor, quiz builder, category management, and draft/publish flow.
  • AI-assisted content generation from topic text, uploaded files, or connected Nextcloud WebDAV files.
  • Marp slide editing with preview and PPTX export.
  • Keyword, semantic, and hybrid search using Postgres/pgvector where configured.

Clinical Assistant

  • Optional MCP-backed clinical assistant integration.
  • Prompt suggestions backed by Redis operational cache.
  • No clinical answer response caching.
  • Designed to retrieve from indexed clinical material while keeping provider selection explicit.

Admin And Security

  • Local auth, role-based access, TOTP 2FA, OIDC/SSO, email verification, and optional Turnstile.
  • Admin panel for users, settings, prompts, models, logs, and Learning Hub content.
  • Audit, API, access, and client-error logs with redaction hardening.
  • OpenBao secret loading support at container startup.
  • S3-compatible document storage support.

Removed Browser STT

Browser Whisper has been removed from the runtime. The app should not ship browser Whisper workers, browser-local Whisper model downloads, Transformers.js browser STT, or Browser Whisper setup docs.

Speech-to-text is handled server-side through configured providers such as Google/Gemini, AWS Transcribe, LiteLLM, or OpenAI Whisper. Browser-native Web Speech remains gated behind an explicit user setting when present in the browser.

Quick Start

cp .env.example .env
./scripts/build-image.sh
docker compose up -d --no-build

The default compose exposes the app on 127.0.0.1:3552 and starts:

  • pediatric-ai-scribe for the Node app.
  • pedscribe-db for Postgres with pgvector.
  • ped-ai-redis for operational Redis state.

Health check:

curl -fsS http://127.0.0.1:3552/api/health

Prometheus metrics are exposed at GET /metrics with the ped_ai_ metric prefix.

The first registered user becomes an admin unless registration has already been configured differently.

Core Environment

Set real values in .env before production use.

APP_URL=https://your-domain.example
JWT_SECRET=<64-char-random-secret>
DB_PASSWORD=<strong-database-password>

AI_PROVIDER=litellm
LITELLM_API_BASE=https://your-litellm.example/v1
LITELLM_API_KEY=<key>

TRANSCRIBE_PROVIDER=litellm
LITELLM_STT_MODEL=whisper-1

REDIS_URL=redis://ped-ai-redis:6379

Supported text AI providers include LiteLLM, OpenRouter, AWS Bedrock, Azure OpenAI, and Google Vertex AI. Supported STT routing includes Google/Gemini, AWS Transcribe, OpenAI Whisper, and LiteLLM. Supported TTS routing includes Google Cloud TTS, LiteLLM/OpenAI-compatible audio, and ElevenLabs where configured.

Admin CLI

docker exec pediatric-ai-scribe node admin-cli.js list-users
docker exec pediatric-ai-scribe node admin-cli.js create-admin admin@example.com password123 "Dr. Admin"
docker exec pediatric-ai-scribe node admin-cli.js make-admin user@example.com
docker exec pediatric-ai-scribe node admin-cli.js reset-password user@example.com newpassword
docker exec pediatric-ai-scribe node admin-cli.js toggle-registration
docker exec pediatric-ai-scribe node admin-cli.js stats

Maintenance

The app checks Postgres collation drift on startup and can reindex text indexes after image or OS-library changes.

docker exec pediatric-ai-scribe npm run maint:check
docker exec pediatric-ai-scribe npm run maint:reindex

Run the reindex command after major Postgres image changes, restoring a dump from another distro, or seeing lookup behavior that suggests collation/index drift.

Testing

Run the Node test suite:

npm test

Run syntax checks for touched files when doing focused backend work:

node --check server.js
node --check src/routes/transcribe.js

Run the Playwright smoke suite against the e2e compose stack:

docker compose -f docker-compose.yml -f docker-compose.e2e.yml up -d pediatric-scribe-e2e
npm run e2e

Deployment Notes

  • Put the app behind HTTPS before clinical use.
  • Use only AI/STT/TTS providers covered by your BAA and data-processing requirements.
  • Configure OIDC/SSO and 2FA for production users.
  • Keep JWT_SECRET, database credentials, provider keys, S3 keys, SMTP credentials, and OpenBao tokens out of git.
  • Treat logs as sensitive operational data even with redaction enabled.
  • Use the Caddy/reverse-proxy layer to expose only intended public routes.

Documentation

Primary references:

  • docs/ARCHITECTURE.md for the current system map and service boundaries.
  • docs/DEVELOPMENT.md for day-to-day code-change workflow.
  • docs/SCALING.md for scaling priorities and readiness work.
  • docs/CLINICAL_ASSISTANT.md for MCP-backed assistant behavior and safety rules.
  • docs/MODULE_CONVENTIONS.md for CommonJS, ESM, globals, and rendering rules.
  • docs/architecture.md for high-level architecture.
  • docs/api-reference.md for API routes.
  • docs/authentication.md for auth, OIDC, and security configuration.
  • docs/ai-providers.md for model/provider setup.
  • docs/speech.md for server-side STT/TTS setup.
  • docs/learning-hub.md for the CMS and education workflow.
  • docs/configuration.md for environment variables.
  • docs/deployment.md for production deployment.
  • docs/mobile-build.md for the Capacitor wrapper and app-store build notes.
  • docs/logic/README.md for the deeper code walkthrough.

Some deep docs/logic/ files still describe historical implementation details. Prefer runtime code and tests when documentation conflicts with current behavior.

Clinical Safety

Ped-AI is documentation and education support software. It does not replace clinical judgment, local policy, medication verification, or attending review. Validate generated notes, calculations, and recommendations before use in patient care.