/abridge-pack:abridge-performance-tuningfrom abridge-pack
Optimizes Abridge clinical AI integration performance for high-volume health system deployments. Reduces note generation latency, improves audio streaming throughput, and scales FHIR push operations.
Ships in abridge-pack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Performance optimization for high-volume Abridge deployments. Large health systems process thousands of encounters daily — latency in note generation directly impacts clinical workflow throughput.
| Metric | Target | Critical Threshold |
|---|---|---|
| Audio stream → first transcript | < 2s | > 5s |
| Encounter → completed note | < 30s | > 60s |
| Note → EHR push | < 3s | > 10s |
| Patient summary generation | < 10s | > 30s |
| Concurrent sessions per org | 100+ | < 50 |
// src/performance/audio-optimizer.ts
// Optimize audio chunk size and streaming for lowest latency
interface AudioStreamMetrics {
chunkSize: number;
sendInterval: number;
bufferUtilization: number;
latencyP50: number;
latencyP99: number;
}
class OptimizedAudioStream {
private buffer: Buffer[] = [];
private metrics: AudioStreamMetrics = {
chunkSize: 3200, // 100ms at 16kHz 16-bit mono = 3200 bytes
sendInterval: 100, // Send every 100ms
bufferUtilization: 0,
latencyP50: 0,
latencyP99: 0,
};
constructor(
private ws: WebSocket,
private sampleRate: number = 16000,
) {}
// Optimal chunk size: 100ms for low latency, 500ms for bandwidth efficiency
processAudioChunk(chunk: Buffer): void {
this.buffer.push(chunk);
const totalSize = this.buffer.reduce((sum, b) => sum + b.length, 0);
if (totalSize >= this.metrics.chunkSize) {
const combined = Buffer.concat(this.buffer);
this.buffer = [];
if (this.ws.readyState === WebSocket.OPEN) {
const start = performance.now();
this.ws.send(combined);
this.recordLatency(performance.now() - start);
}
}
}
private recordLatency(ms: number): void {
// Track P50/P99 for monitoring
this.metrics.latencyP50 = ms; // Simplified — use histogram in production
}
getMetrics(): AudioStreamMetrics {
return { ...this.metrics };
}
}
// src/performance/note-pipeline.ts
// Pre-warm note generation and parallelize post-processing
interface PipelineStage {
name: string;
durationMs: number;
parallel: boolean;
}
async function optimizedNotePipeline(
api: any,
sessionId: string,
): Promise<{ note: any; metrics: PipelineStage[] }> {
const stages: PipelineStage[] = [];
// Stage 1: Finalize session (triggers AI processing)
const t1 = performance.now();
await api.post(`/encounters/sessions/${sessionId}/finalize`);
stages.push({ name: 'finalize', durationMs: performance.now() - t1, parallel: false });
// Stage 2: Poll with exponential backoff (adaptive polling)
const t2 = performance.now();
let pollInterval = 500; // Start fast
let note = null;
for (let i = 0; i < 30; i++) {
const { data } = await api.get(`/encounters/sessions/${sessionId}/note`);
if (data.status === 'completed') {
note = data.note;
break;
}
await new Promise(r => setTimeout(r, pollInterval));
pollInterval = Math.min(pollInterval * 1.5, 3000); // Back off gradually
}
stages.push({ name: 'note_generation', durationMs: performance.now() - t2, parallel: false });
if (!note) throw new Error('Note generation timed out');
// Stage 3: Parallel post-processing
const t3 = performance.now();
const [patientSummary, ehrResult] = await Promise.allSettled([
api.post(`/encounters/sessions/${sessionId}/patient-summary`, { language: 'en' }),
pushNoteToEhr(note),
]);
stages.push({ name: 'post_processing', durationMs: performance.now() - t3, parallel: true });
return { note, metrics: stages };
}
// src/performance/connection-pool.ts
import axios from 'axios';
import https from 'https';
// Reuse TCP connections for FHIR endpoint
const fhirAgent = new https.Agent({
keepAlive: true,
keepAliveMsecs: 30000,
maxSockets: 20, // Max concurrent FHIR connections
maxFreeSockets: 5,
minVersion: 'TLSv1.3',
});
const fhirClient = axios.create({
baseURL: process.env.EPIC_FHIR_BASE_URL,
httpsAgent: fhirAgent,
timeout: 10000,
});
// Batch FHIR pushes for multi-encounter processing
async function batchFhirPush(notes: Array<{ docRef: any }>): Promise<void> {
// FHIR Bundle for batch operations
const bundle = {
resourceType: 'Bundle',
type: 'batch',
entry: notes.map(n => ({
resource: n.docRef,
request: { method: 'POST', url: 'DocumentReference' },
})),
};
await fhirClient.post('/', bundle, {
headers: { 'Content-Type': 'application/fhir+json' },
});
}
// src/performance/monitor.ts
interface PerformanceSnapshot {
timestamp: string;
activeSessions: number;
avgNoteLatencyMs: number;
p99NoteLatencyMs: number;
fhirPushSuccessRate: number;
audioStreamDropRate: number;
}
class PerformanceMonitor {
private noteLatencies: number[] = [];
private fhirPushResults: boolean[] = [];
recordNoteLatency(ms: number): void {
this.noteLatencies.push(ms);
if (this.noteLatencies.length > 1000) this.noteLatencies.shift();
}
recordFhirPush(success: boolean): void {
this.fhirPushResults.push(success);
if (this.fhirPushResults.length > 1000) this.fhirPushResults.shift();
}
getSnapshot(activeSessions: number): PerformanceSnapshot {
const sorted = [...this.noteLatencies].sort((a, b) => a - b);
return {
timestamp: new Date().toISOString(),
activeSessions,
avgNoteLatencyMs: sorted.length ? sorted.reduce((a, b) => a + b, 0) / sorted.length : 0,
p99NoteLatencyMs: sorted.length ? sorted[Math.floor(sorted.length * 0.99)] : 0,
fhirPushSuccessRate: this.fhirPushResults.length
? this.fhirPushResults.filter(Boolean).length / this.fhirPushResults.length
: 1,
audioStreamDropRate: 0, // Populated by audio stream metrics
};
}
}
| Issue | Cause | Solution |
|---|---|---|
| High note latency | Complex encounter | Pre-segment long encounters |
| FHIR push timeout | EHR server overloaded | Use connection pool; batch pushes |
| Audio drops | Network jitter | Buffer 500ms; reconnect on drop |
For cost optimization, see abridge-cost-tuning.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
abridge, healthcare, clinical-ai, latency-optimization, high-volume
18 skills in this plugin
/abridge-ci-integrationConfigure CI/CD pipeline for Abridge clinical AI integrations with GitHub Actions.
Use when setting up automated testing, FHIR validation, HIPAA compliance checks,
or deployment pipelines for healthcare AI applications.
Trigger: "abridge CI", "abridge GitHub Actions", "abridge pipeline",
"abridge automated testing", "abridge CI/CD".
/abridge-common-errorsDiagnose and fix common Abridge clinical AI integration errors.
Use when encountering EHR connectivity failures, note generation errors,
audio streaming issues, or FHIR validation problems with Abridge.
Trigger: "abridge error", "abridge not working", "abridge debug",
"fix abridge issue", "abridge troubleshoot".
/abridge-core-workflow-aImplement Abridge ambient clinical documentation capture-to-note pipeline.
Use when building the primary encounter workflow: audio capture, real-time
transcription, AI note generation, and EHR note insertion.
Trigger: "abridge clinical workflow", "abridge encounter pipeline",
"ambient documentation workflow", "abridge note generation".
/abridge-core-workflow-bImplement Abridge patient-facing documentation and after-visit summary generation.
Use when building patient portal integration, generating plain-language summaries,
multi-language translations, or after-visit instructions from clinical encounters.
Trigger: "abridge patient summary", "after-visit summary", "patient portal abridge",
"abridge patient-facing", "abridge multilingual".
/abridge-cost-tuningOptimize Abridge clinical AI costs through tier selection, session management,
and usage monitoring for healthcare organizations.
Use when analyzing Abridge billing, optimizing encounter volume,
or right-sizing your Abridge contract for provider count.
Trigger: "abridge cost", "abridge pricing", "abridge billing",
"abridge budget", "abridge ROI".
/abridge-debug-bundleCollect Abridge debug evidence for support tickets and troubleshooting.
Use when filing Abridge support tickets, collecting diagnostic data,
or preparing evidence for escalation to Abridge engineering.
Trigger: "abridge debug bundle", "abridge support ticket",
"abridge diagnostics", "collect abridge evidence".
npx claudepluginhub flight505/skill-forge --plugin abridge-packOther plugins' skills for the same job