Built With HIPAA Compliance

TheClinicalContextCompiler

TypeScript-first engine for building safe, transparent, and auditable inputs for clinical AI systems.

/playgrounds

Build intelligent clinical testing environments that execute tasks, access your FHIR data sources, and maintain safety persistently.

Live Testing Environment

Switch between AI providers by changing a single line of code using the AI SDK

FHIR Data Integration

Combine long-term memory with smart messages for more robust clinical recall

Safety Validation

Bootstrap, iterate, and eval prompts in a local playground with LLM assistance

Clinical Testing

Allow agents to call your functions, interact with other systems, and trigger real-world actions

playground.ts
// Live clinical testing environment
const clinicalAgent = new Agent({
name: 'Clinical Testing Agent',
instructions:
'You are Dr. Sarah, a practical and experienced'
'clinical AI that helps validate patient data.'
model: openai('gpt-4o-mini'),
memory,
tools: { fhirQuery, safetyCheck }
});
Live Testing
Real-time FHIR data validation with safety checks
discharge-agent.ts
// Autonomous multi-step clinical workflow
const agent = new DischargeSummaryAgent({
role: 'clinical-reasoner',
capabilities: [
'chart-review',
'medication-reconciliation',
'risk-assessment',
'quality-validation'
],
llmProvider: gpt4
});
await agent.execute(task, context);
Step 1: Chart Review (95% confidence)
Step 2: Med Reconciliation (92% confidence)
Step 3: Risk Assessment (88% confidence)
✓ Summary Generated (2.3s)

/agents

Autonomous clinical AI agents that execute multi-step workflows with quality assurance, safety guardrails, and human oversight.

Multi-Step Workflows

Agents execute complex clinical tasks autonomously through chart review, medication reconciliation, and quality validation.

Clinical Intelligence

Built-in medical knowledge and reasoning capabilities with confidence scoring and uncertainty detection.

Agent Collaboration

Multiple agents work together through sequential, parallel, and collaborative execution patterns.

Safety & Compliance

Comprehensive guardrails, audit trails, and human review triggers ensure clinical safety and regulatory compliance.

/knowledge-graph

Temporal and causal reasoning system that understands clinical relationships, drug interactions, and care pathways with advanced AI-powered insights.

Clinical Knowledge Mapping

Build comprehensive graphs of clinical relationships connecting patients, medications, diagnoses, procedures, and outcomes.

Temporal Reasoning

Understand time-based patterns, disease progression, treatment responses, and predict clinical trajectories.

Drug-Drug Interactions

Real-time detection of harmful medication combinations with evidence-based risk assessment and safety alerts.

Clinical Insights

AI-powered analysis generates actionable insights about care gaps, monitoring requirements, and treatment optimization.

clinical-reasoning.ts
// Real-time clinical reasoning and insights
const reasoner = new ClinicalReasoner(graph);
const interactions = await reasoner
.analyzeDrugInteractions(patient);
const patterns = await reasoner
.detectTemporalPatterns('kidney_function');
const insights = await reasoner
.generateInsights(context);
High-risk interaction
96.4%
Kidney decline detected
91.7%
Care gap identified
89.3%
safety-guards.ts
// Clinical safety validation workflow
workflow
.step('validate')
.step('checkCompliance')
.guard(renalSafety)
.step('success')
.step('retry')
.guard(({
labValues,
medications
})
.step('finalize')
.commit();
Safety Rules
Automated validation
Compliance
HIPAA & FDA ready

/guards

Durable graph-based safety validation with built-in clinical compliance, designed to execute complex sequences of medical operations.

Clinical Safety Flow

Simple semantics for branching, chaining, merging, and conditional execution, built on clinical standards.

.suspend() / .resume()

Pause execution at any step, persist state, and continue when triggered by a human-in-the-loop.

.watch() for real time validation

Stream safety validation events to users for visibility into long-running clinical tasks.

Clinical/safety orchestration

Create flexible architectures; embed your guards in a workflow; pass workflows as tools to your agents.

/compiler

Equip clinical agents with the right context. Sync data from FHIR sources. Scrape clinical records. Pipe it into a knowledge base and embed, query, and rerank.

Unified clinical store

Consistent API interface to upsert, index, and query data across FHIR providers

Metadata filtering

Narrow down your search space by querying on patient demographics, time periods, or other clinical properties

Clinical Context Compilation

Equip agents with a clinical query tool so they can search your knowledge base intelligently

.embed()
.query()
.rerank()

Data Processing Pipeline

Input
Clinical Data
Processing
Embedding Model
Output
Structured Data

Infrastructure Layer

Knowledge Base
Vector storage & retrieval
Embedding Model
Neural networks & AI
Clinical Stores
FHIR & EHR data

Frequently Asked Questions

Everything you need to know about the Clinical Context Compiler

What is Calyra?

Calyra is a TypeScript-first clinical context compiler - think of it as 'Webpack for clinical data.' It transforms raw EHR data from multiple sources (FHIR, DICOM, devices) into safe, auditable, size-budgeted context bundles that are perfect for LLMs and clinical AI systems.

How is Calyra different from other healthcare data tools?

Unlike rigid EHR integrations or generic data pipelines, Calyra provides a declarative ContextSpec DSL for defining what data to include, enforces clinical safety with built-in guards, maintains complete auditability through provenance tracking, and is HIPAA-compliant out of the box.

What is a ContextSpec?

A ContextSpec is a declarative YAML/JSON specification that defines which clinical data to compile, how to normalize it, what safety rules to apply, and size budgets to respect. It's similar to a tsconfig.json for TypeScript - you describe what you want, and Calyra handles the complex compilation process.

What are Clinical Guards?

Clinical Guards are type-safe safety functions that enforce domain-specific rules during compilation. They can assert required data (e.g., 'last creatinine must be included'), forbid sensitive content (PII redaction), and apply conditional logic (e.g., 'flag nephrotoxic medications for CKD patients').

Is Calyra HIPAA compliant?

Yes. Calyra is built with HIPAA compliance from the ground up, featuring encryption at rest and in transit, comprehensive audit logging, PII redaction through guards, row-level security for multi-tenancy, and immutable audit trails for every data access.

What is the Provenance DAG?

The Provenance DAG is an immutable directed acyclic graph that tracks every decision made during compilation. It records which data elements were kept or dropped and why, enabling complete auditability, time-travel debugging, and regulatory compliance.

How does the compilation process work?

Calyra uses a six-pass pipeline: Normalize (convert FHIR/DICOM to standard format), Dedupe (remove duplicates), Rank (score by relevance), Pack (fit into token budget), Guard (apply safety rules), and Emit (produce typed JSON output). Each pass is a pure function with clear contracts.

What data sources does Calyra support?

Currently: FHIR R4 (labs, medications, conditions, notes) and DICOM metadata for imaging. Coming soon: Real-time device streams (ECG, vitals), genomic data, and additional EHR systems through pluggable connectors.

Can I customize the safety rules?

Absolutely. Guards are organized into composable packs (renal, cardiac, core) that you can mix and match. You can also create custom guards for your specific clinical use cases using our TypeScript guard API.

What are token budgets?

Token budgets let you control the size of compiled contexts to match your LLM's limits (e.g., 24,000 tokens for GPT-4). Calyra intelligently packs the most relevant data within your budget using ranking and optimization strategies.

Who is Calyra built for?

Calyra is designed for AI-forward health systems building clinical AI applications, healthcare startups needing HIPAA-compliant infrastructure, and research institutions requiring auditable data pipelines. If you're building with clinical data and LLMs, Calyra is for you.

How does Calyra handle sensitive data?

All PHI is processed in-memory only with no logging, automatic PII redaction through guards, structured logging with PHI fields marked for scrubbing, and SHA-256 content hashing in provenance for integrity without exposing content.

Still have questions?

We're here to help you build the future of clinical AI

Ready to build the future of clinical AI?

Join thousands of healthcare developers building with Calyra