The EHR Agent analyzes comprehensive electronic health records — labs, conditions, medications, imaging, genetics, and vital signs — to deliver evidence-based insights for both patients and clinicians.
When to Use
EHR Agent Best for:
Comprehensive health analysis
Multi-system assessment
Complex cases with imaging/genetics
Pre-visit preparation
Input: Full EHR data bundle
Lab Results Agent Best for:
Lab result interpretation
Post-visit lab review
Routine monitoring analysis
Direct lab-to-patient communication
Input: Lab results + optional patient context
Endpoint
POST https://api.heliosai.health/api/v1/agent
Agent Modes
The EHR Agent supports two modes:
Mode Processing Time Cost Best For Light 5-8 minutes $0.65 Routine health summaries, standard cases Deep 10-13 minutes $3.50 Complex cases, multi-step literature research
Deep Agent runs include researchTasks in the response — an array of the specific research queries executed during the multi-step literature review. Light Agent responses do not include this field.
{
"webhookUrl" : "https://your-server.com/webhook/helios" ,
"agentType" : "light" ,
"data" : {
"patientInfo" : {
"age" : 45 ,
"gender" : "male"
},
"recentAbnormalLabs" : [
{
"date" : "2025-01-15" ,
"display" : "Hemoglobin A1c" ,
"value" : "7.2" ,
"unit" : "%" ,
"referenceRange" : "4.0-5.6" ,
"interpretation" : "High"
}
],
"recentNormalLabs" : [
{
"date" : "2025-01-15" ,
"display" : "Sodium" ,
"value" : "140" ,
"unit" : "mEq/L" ,
"referenceRange" : "136-145"
}
],
"pastMedicalHistory" : [
{
"display" : "Type 2 Diabetes Mellitus" ,
"clinicalStatus" : "active" ,
"onsetDate" : "2020-03-15"
}
],
"medications" : [
{
"medication" : "Metformin 500mg" ,
"status" : "active" ,
"dosage" : "500mg" ,
"frequency" : "twice daily"
}
],
"vitalSigns" : [
{
"display" : "Blood Pressure" ,
"value" : "138/88" ,
"unit" : "mmHg" ,
"date" : "2025-01-15"
}
]
}
}
Required Fields
Field Type Description webhookUrlstring HTTPS URL to receive results agentTypestring "light" or "deep"dataobject Health data to analyze
Health Data Fields
All fields in data are optional, but you should provide at least some health information for meaningful analysis:
Field Type Description patientInfoobject Age, gender (no PHI — see below) recentAbnormalLabsarray Abnormal lab results recentNormalLabsarray Normal lab results labTrendsarray Historical lab values over time pastMedicalHistoryarray Conditions and diagnoses medicationsarray Current and recent medications familyHistoryarray Family medical history imagingStudiesarray Imaging reports and findings geneticDataarray Genetic test results vitalSignsarray Recent vital sign measurements additionalContextstring Free-text clinical notes userInstructionsstring Custom instructions for the analysis
Patient Info
Field Type Description agenumber Patient age (de-identified, no DOB) genderstring "male", "female", "other", or "unknown"
No PHI allowed in patientInfo. Do not include name, date of birth, address, or any other personally identifiable information. Only de-identified demographic data (age, gender) is accepted.
Lab Result Fields
Used for both recentAbnormalLabs and recentNormalLabs:
Field Type Required Description displaystring Yes Lab test name (e.g., “Hemoglobin A1c”) valuestring Yes Result value (e.g., “7.2”) unitstring Yes Unit of measurement (e.g., ”%”, “mg/dL”) datestring No Date of test (ISO 8601). Strongly recommended referenceRangestring No Normal range (e.g., “4.0-5.6”) interpretationstring No Abnormality flag (e.g., “High”, “Low”, “Normal”) idstring No Unique identifier codestring No LOINC or other standard code
Lab Trends
Track how a lab value has changed over time:
Field Type Required Description codestring Yes Standard code for the lab test displaystring Yes Lab test name valuesarray Yes Array of historical values values[].datestring Yes Date of measurement values[].valuestring Yes Result value values[].unitstring Yes Unit of measurement values[].interpretationstring No Abnormality flag
Condition Fields
Field Type Required Description displaystring Yes Condition name (e.g., “Type 2 Diabetes Mellitus”) clinicalStatusstring Yes "active", "inactive", "resolved", etc.onsetDatestring No When the condition started recordedDatestring No When the condition was recorded verificationStatusstring No "confirmed", "provisional", etc.idstring No Unique identifier codestring No ICD-10 or SNOMED code
Medication Fields
Field Type Required Description medicationstring Yes Medication name and strength statusstring Yes "active", "completed", "stopped"dosagestring No Dosage amount frequencystring No How often taken startDatestring No When the medication was started endDatestring No When the medication was stopped sourcestring No "statement" or "request"idstring No Unique identifier
Family History Fields
Field Type Required Description relationshipstring Yes Relationship (e.g., “Father”, “Mother”) conditionstring Yes Condition name onsetAgestring No Age at onset idstring No Unique identifier
Imaging Study Fields
Field Type Required Description typestring Yes Study type (e.g., “CT Scan”, “MRI”) descriptionstring Yes Description of the study datestring No Date of study. Strongly recommended modalitystring No Imaging modality findingsstring No Radiology findings conclusionstring No Radiologist’s conclusion reportTextstring No Full report text idstring No Unique identifier
Genetic Data Fields
Field Type Required Description geneCodestring Yes Gene code (e.g., “BRCA1”) geneDisplaystring Yes Gene display name interpretationstring Yes Result interpretation valuestring No Raw value methodstring No Testing method datestring No Date of test idstring No Unique identifier
Vital Sign Fields
Field Type Required Description displaystring Yes Vital sign name (e.g., “Blood Pressure”, “Heart Rate”) valuestring Yes Measurement value unitstring Yes Unit (e.g., “mmHg”, “bpm”) datestring No Date of measurement referenceRangestring No Normal range interpretationstring No Abnormality flag idstring No Unique identifier
Element Limits & Sorting
To ensure optimal analysis quality and prevent context overflow, the API applies limits to each data category. Elements are sorted by date (most recent first) before limits are applied.
Category Max Elements Date Field Date Importance Abnormal Labs 50 dateExpected — labs almost always have datesNormal Labs 15 dateExpected — labs almost always have datesConditions 100 onsetDate or recordedDateRecommended Medications 30 startDateRecommended Family History 15 N/A N/A (no dates) Imaging Studies 15 dateExpected — imaging always has datesGenetic Data No limit dateRecommended Vital Signs No limit dateRecommended
Dates are critical for accurate analysis. The API sorts data by recency to prioritize the most recent findings. Without dates:
Lab results may be analyzed in the wrong order, potentially missing critical recent changes
Older, less relevant data may be included instead of recent findings
Trend analysis and temporal reasoning will be impaired
While dates are technically optional (per FHIR), lab results and imaging studies should always include dates in practice. Data without dates will be deprioritized during element limiting.
Error Responses
400 Bad Request — Validation Error
{
"error" : "Validation error" ,
"details" : [
{ "path" : "webhookUrl" , "message" : "Invalid URL format" }
]
}
401 Unauthorized
{
"error" : "Unauthorized" ,
"message" : "Invalid or missing API key"
}
429 Too Many Requests
Returned when your company has reached its concurrent request limit. Includes a Retry-After header.
{
"error" : "Too many concurrent requests" ,
"message" : "You have 7 active light agent requests. Maximum is 7." ,
"activeCount" : 7 ,
"limit" : 7
}
500 Internal Server Error
{
"error" : "Internal server error" ,
"message" : "An unexpected error occurred"
}
{
"runId" : "550e8400-e29b-41d4-a716-446655440000" ,
"status" : "accepted" ,
"message" : "Request accepted. Results will be delivered to your webhook."
}
Header Description Example X-Concurrent-LimitMaximum concurrent requests for this agent type 7X-Concurrent-ActiveActive requests (including this one) 3X-Concurrent-RemainingAvailable slots 4
Webhook Delivery
Results are delivered to your webhook URL (5-8 min for Light, 10-13 min for Deep):
Light Agent response:
{
"runId" : "550e8400-e29b-41d4-a716-446655440000" ,
"status" : "completed" ,
"agent" : "light" ,
"timestamp" : "2025-01-15T12:01:30.000Z" ,
"sequenceNumber" : 7 ,
"result" : {
"selectedElements" : [
{
"item" : "Hemoglobin A1c" ,
"category" : "Laboratory Value" ,
"patient_value" : "7.2%" ,
"matching_reason" : "Elevated HbA1c indicates suboptimal glycemic control"
}
],
"patientResponse" : "Your recent lab results show that your HbA1c level is 7.2%..." ,
"clinicianResponse" : "The patient presents with elevated HbA1c (7.2%) indicating suboptimal glycemic control..." ,
"citations" : {
"patient" : {
"1" : {
"url" : "https://pubmed.ncbi.nlm.nih.gov/12345678/" ,
"title" : "Glycemic Control in Type 2 Diabetes" ,
"metadata" : { "type" : "pubmed" }
}
},
"clinician" : {
"1" : {
"url" : "https://pubmed.ncbi.nlm.nih.gov/87654321/" ,
"title" : "ADA Standards of Care 2025" ,
"metadata" : { "type" : "pubmed" }
}
}
}
}
}
Deep Agent response (includes researchTasks):
{
"runId" : "550e8400-e29b-41d4-a716-446655440000" ,
"status" : "completed" ,
"agent" : "deep" ,
"timestamp" : "2025-01-15T12:15:30.000Z" ,
"sequenceNumber" : 9 ,
"result" : {
"selectedElements" : [ ... ],
"patientResponse" : "Your recent lab results show..." ,
"clinicianResponse" : "The patient presents with..." ,
"researchTasks" : [
"Research current ADA guidelines for glycemic control in Type 2 Diabetes" ,
"Investigate SGLT2 inhibitor cardiovascular benefits in patients with CKD" ,
"Analyze optimal statin therapy for diabetic patients with elevated LDL"
],
"citations" : {
"patient" : { "1" : { "url" : "..." , "title" : "..." , "metadata" : { "type" : "pubmed" } } },
"clinician" : { "1" : { "url" : "..." , "title" : "..." , "metadata" : { "type" : "pubmed" } } }
}
}
}
Result Fields
Field Description selectedElementsHealth elements selected for analysis (see below) patientResponsePatient-friendly summary in Markdown clinicianResponseClinical report with citations in Markdown citationsCitation metadata for both responses researchTasksResearch queries executed (Deep Agent only)
Selected Elements
The selectedElements array contains the health data elements that the AI identified as most clinically relevant:
Field Description ehr_element_idUnique ID (e.g., “Lab 1”, “Condition 3”) ehr_element_descriptionHuman-readable description categoryElement category (Laboratory Value, Diagnosed Disease, etc.) patient_valueThe patient’s actual value or status relevanceWhy this element was selected matching_reasonWhy this element is clinically interesting
Processing Steps
Status update webhooks are sent during processing:
Light Agent Steps:
Step Name 1 Processing started 2 Analyzing health data 3 Selecting relevant elements 4 Researching medical literature 5 Generating patient response 6 Generating clinician response 7 Finalizing results 8 Delivering final results
Deep Agent Steps:
Step Name Description 1 Processing started Request received and validated 2 Analyzing health data Extracting insights from EHR data 3 Selecting relevant elements AI selecting important health elements 4 Routing to Deep Agent Handing off to research agent 5 Starting research tasks Beginning parallel literature research 6 Research complete All research tasks finished 7 Generating responses Creating clinician and patient reports 8 Finalizing results Preparing final output
For Deep Agent, steps 1-4 are sent by the initial API server. Steps 5-8 and the final result are sent by the Deep Agent research processor. This architecture allows the Deep Agent to run for up to 16 minutes without timeout constraints.
Example Requests
curl -X POST https://api.heliosai.health/api/v1/agent \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"webhookUrl": "https://your-server.com/webhook/helios",
"agentType": "light",
"data": {
"patientInfo": {
"age": 45,
"gender": "male"
},
"recentAbnormalLabs": [
{
"date": "2025-01-15",
"display": "Hemoglobin A1c",
"value": "7.2",
"unit": "%",
"referenceRange": "4.0-5.6",
"interpretation": "High"
}
],
"pastMedicalHistory": [
{
"display": "Type 2 Diabetes Mellitus",
"clinicalStatus": "active",
"onsetDate": "2020-03-15"
}
],
"medications": [
{
"medication": "Metformin 500mg",
"status": "active",
"dosage": "500mg",
"frequency": "twice daily"
}
],
"vitalSigns": [
{
"display": "Blood Pressure",
"value": "138/88",
"unit": "mmHg",
"date": "2025-01-15"
}
]
}
}'
Pricing
Mode Cost Light $0.65 per request Deep $3.50 per request
Next Steps