SlideShare a Scribd company logo
1
© Babylon 2022
Lowering the
barrier to
stream
processing
with python, Faust and a "FaaS" approach
2
© Babylon 2022
Contents page
Other Features
Whats under the hood
Problem
Existing options for our customers
Use cases
Evaluating OOTB solutions
Our Solution | Health Graph
Functions
How our solution looks with each
use case
4
© Babylon 2022
5
© Babylon 2022
What’s the Problem? High barrier to entry
Slow to develop
More than 1 month on
average
Expensive
Compute and memory
requirements lead to high
cloud costs
Maintenance & Complexity Burden
Teams scared to build streaming apps
6
© Babylon 2022
Previous solutions at Babylon
Kafka Streams
Java & Scala
Stream processing
Kafka Client Libs
Java, Scala, Python, Ruby
Simple stream consumers and
producers
Faust
Python
Stream processing
Customise it Run on
Kubernetes as
Deployment
Choose a
microservice
template
7
© Babylon 2022
Use Cases
Enrich | Code Mapping
Requires:
● Internal API request
Infer | Risk Prediction
Requires:
● Internal API request
● Complex Logic
● Python Libraries
Alert | Early Detection Alerts
Requires:
● Internal API request
● Complex Logic
● Python Libraries
● External API request
● Internal State (for
debounce)
Enrich
Infer
Alert
Patient
Clinician
Health
Graph**
**Despite the name, Babylon’s Health
Graph is stream-first, graph-second!
8
© Babylon 2022
Evaluating OOTB solutions against our use cases
SQL Stream Processors
But we need:
● Complex logic
● Client
libraries/packages
● To make API calls
Existing FaaS with stream triggers
But we need:
● Batching
● Windowing
● Stream-based State Stores
Flink StateFun
But we did not need:
● Overhead of deploying and
managing a Flink cluster
● Cost and inefficiency of
running everything on the
JVM
9
© Babylon 2022
Our Solution | Health Graph Functions
class Context(BaseContext ):
terminology_client: AsyncRESTClientContext
async def code_mapping_function (
key: DFHIRKey,
value: DFHIRValue,
metadata: EventMetadata,
context: Context,
) -> t.Dict[ str, t.List[Event]]:
...
mapped_codes = context.terminology_client.post({“codes”: value.codes})
...
return {
“conditions” : condition_events,
“labs”: labs_events,
}
agents:
CodeMapping:
enabled: true
function: code_mapping.code_mapper
version: latest
error_handling: BLOCK
store: S3
input_topic:
name: domainevent.redox-cq-integration.clinical-summary
output_topics:
condition:
name: dfhir.reportedcondition.v1
labs:
name: dfhir.labs.v1
context:
terminology_client:
url: '{{ services }}/fast-ct/codeableconcept/convert'
auth: default
10
© Babylon 2022
What does it look like? Code Mapping
class Context(BaseContext):
terminology_client: AsyncRESTClientContext
async def code_mapping_function
(
key: DFHIRKey,
value: DFHIRValue,
metadata: EventMetadata,
context: Context,
) -> t.Dict[str, t.List[Event]]:
...
mapped_codes = context.terminology_client.post({“codes”:
value.codes})
...
return {
“conditions”
: condition_events,
“labs”: labs_events,
}
Auto-injected client.
Highly configurable.
11
© Babylon 2022
agents:
CodeMapping:
enabled: true
function: code_mapping.code_mapper
version: latest
error_handling: BLOCK
store: S3
input_topic:
name: domainevent.redox-cq-integration.clinical-summary
output_topics:
condition:
name: dfhir.reportedcondition.v1
labs:
name: dfhir.labs.v1
context:
terminology_client:
url: '{{ services }}/fast-ct/codeableconcept/convert'
auth: default
How the client is configured.
An “Agent” in this context is a
configured instance of a function
(enables us to run the same
function with different
configurations).
What does it look like? Code Mapping
12
© Babylon 2022
class Thresholds(BaseModel):
high: float
medium: float
class Context(BaseContext):
thresholds: Thresholds
model_version: SemanticVersion
healthIQ_client: AsyncRESTClientContext
async def risk_prediction_function
(
key: DFHIRKey,
value: DFHIRValue,
metadata: EventMetadata,
context: Context,
) -> t.Dict[str, t.List[Event]]:
...
mapped_codes = context.terminology_client.post({“codes”:
value.codes})
...
return {“predictions”: predictions}
Custom contexts can
be extended with your
own models.
Everything is
typed/validated with
pydantic.
This one is simple but
they can be super
powerful if required!
What does it look like? Risk Prediction
13
© Babylon 2022
agents:
AcuityScore:
... # skip some things for brevity
context:
model_version: “1.9.1”
thresholds:
high: 0.042
medium: 0.0138
healthIQ_client:
url: '{{ services }}/pottery/healthIQ'
auth: default
output_topics:
predictions:
name: dfhir.riskassessment.v1
Holds the configuration for the
thresholds part of the custom
context
What does it look like? Risk Prediction
14
© Babylon 2022
agents:
AcuityScore:
... # skip some things for brevity
context:
model_version: “1.9.1”
...
output_topics:
predictions:
name: dfhir.riskassessment.v1
ShadowAcuityScore:
... # skip some things for brevity
context:
model_version: “2.0.0alpha”
output_topics:
predictions:
name: shadow.dfhir.riskassessment.v1
This allows us to do trivial
“shadow deployments” of ML
models.
We can run the new model on
live data but the predictions
will go to a separate stream for
evaluation. (This is why we
don’t reference topics directly
in functions).
What does it look like? Risk Prediction
15
© Babylon 2022
class Context(BaseContext):
graphql_client: AsyncGraphQLClientContext
notification_client: AsyncRESTClientContext
debounce_table: TableContext
debounce_days: float
# IRL there’s lots more here!
async def early_detection_function
(
key: NotificationKey,
value: NotificationValue,
metadata: EventMetadata,
context: Context,
) -> t.Dict[str, t.List[Event]]:
last_alerted_subject = (time.now()-
context.debounce_table[key.subject.id].time)
...
if last_alerted_subject < timedelta(days=debounce_days):
return {“early_detection_alert_skipped”
: alert_event}
return {“early_detection”
: alert_event}
You can have multiple
clients if you want.
And stream-backed
state stores.
We means we can
avoid sending
unnecessary alerts!
(We do still return
an event in case we
want those to be
saved for auditing)
What does it look like? Early Detection
16
© Babylon 2022
agents:
EarlyDetection:
... # skip some things for brevity
context:
graphql_client: {}
notification_client:
url: {{ urls.trigger_workflow }}
auth:
type: oauth
url: {{ workflow.auth.url }}
id: {{ workflow.auth.id }}
secret: {{ workflow.auth.id }}
debounce_table:
settings:
name: debounce-subject
debounce_days: 10
Defaults for some clients for
simplicity (this is our federated
GraphQL API).
Multiple configurable auth
flows.
Stream-backed state store
settings.
What does it look like? Early Detection
17
© Babylon 2022
What else? Other features
Auto-generated Agent
Configuration UI
async def window_function
(events:
t.Sequence[Events], context: Context):
---
batching:
size: 200
timeout: 2
Windowing and batching
# define and configure input event
generators and expected output assertions
# these can be defined inline and will be
continuously tested in live environments
Built-in Test Harnesses
18
© Babylon 2022
What’s under the hood?
Agent
Configuration
Code Storage
UI (ClickOps)
or CI (GitOps)
Code
Config
19
© Babylon 2022
Code Storage
What’s under the hood?
Health Graph Functions
Operator
…
Agent
Configuration
UI (ClickOps)
or CI (GitOps)
Health Graph
Functions
Instance
…
Listens, scales
and configures
20
© Babylon 2022
Code Storage
What’s under the hood?
Health Graph Functions
Operator
…
Agent
Configuration
UI (ClickOps)
or CI (GitOps)
Fetches
Processes
Health Graph
Functions
Instance
…
21
© Babylon 2022
Code Storage
What’s under the hood?
Health Graph Functions
Operator
…
Agent
Configuration
UI (ClickOps)
or CI (GitOps)
Fetches
Processes
Health Graph
Functions
Instance
…
uses Faust
uses @kopf
Did you know we’re hiring?
Want to join a global organization?
Do you believe in Babylon’s mission to
bring affordable and accessible healthcare
to every human on earth?
We’re looking for
exceptional talent
across the technology organization.
Check out our Career Site to find your
next opportunity with Babylon.
babylonhealth.com/careers/technology
Thank you
© 2022 Babylon Inc. All rights reserved.
Thank you
© Babylon 2022

More Related Content

PDF
Hardening Kafka Replication
PDF
How do you handle renaming of a resource in RESTful way
PDF
ELB & CloudWatch & AutoScaling - AWSマイスターシリーズ
PDF
What the CRaC - Superfast JVM startup
PDF
20210127 今日から始めるイベントドリブンアーキテクチャ AWS Expert Online #13
PDF
Apache BookKeeper: A High Performance and Low Latency Storage Service
PDF
インフラCICDの勘所
PPTX
KubernetesでGPUクラスタを管理したい
Hardening Kafka Replication
How do you handle renaming of a resource in RESTful way
ELB & CloudWatch & AutoScaling - AWSマイスターシリーズ
What the CRaC - Superfast JVM startup
20210127 今日から始めるイベントドリブンアーキテクチャ AWS Expert Online #13
Apache BookKeeper: A High Performance and Low Latency Storage Service
インフラCICDの勘所
KubernetesでGPUクラスタを管理したい

What's hot (20)

PDF
AWS X-Rayによるアプリケーションの分析とデバッグ
PPTX
Boto3からの解放。python3の標準ライブラリのみでawsサービスを取り扱うには
PDF
[D34] Shared Nothingなのに、Active-Activeクラスタ? ~ 高いスケーラビリティを誇る日立国産DBMS「HiRDB」のクラス...
PDF
AWS Black Belt Tech シリーズ 2016 - Amazon CloudFront
PDF
AWS Black Belt Techシリーズ AWS Direct Connect
PDF
Scalaのコンパイルを3倍速くした話
PDF
クラウド上のデータ活用デザインパターン
PDF
Google Cloud Dataflow を理解する - #bq_sushi
PPTX
Effective Testing with Ansible and InSpec
PDF
VPC Reachability Analyzer 使って人生が変わった話
PDF
Performance Comparison of Mutex, RWLock and Atomic types in Rust
PPTX
負荷分散だけじゃないELBのメリット
PDF
初心者向けWebinar AWS上でのネットワーク構築
PDF
MySQL5.7 GA の Multi-threaded slave
PPTX
What is AWS?
PDF
AWS Black Belt Tech シリーズ 2016 - Amazon SQS / Amazon SNS
PDF
Data Lake,beyond the Data Warehouse
PDF
AWS Black Belt Online Seminar Amazon Aurora
PPTX
AWS Batch Fargate対応は何をもたらすか
PDF
오라클 클라우드 OCI 기초 개념 & 용어 정리
AWS X-Rayによるアプリケーションの分析とデバッグ
Boto3からの解放。python3の標準ライブラリのみでawsサービスを取り扱うには
[D34] Shared Nothingなのに、Active-Activeクラスタ? ~ 高いスケーラビリティを誇る日立国産DBMS「HiRDB」のクラス...
AWS Black Belt Tech シリーズ 2016 - Amazon CloudFront
AWS Black Belt Techシリーズ AWS Direct Connect
Scalaのコンパイルを3倍速くした話
クラウド上のデータ活用デザインパターン
Google Cloud Dataflow を理解する - #bq_sushi
Effective Testing with Ansible and InSpec
VPC Reachability Analyzer 使って人生が変わった話
Performance Comparison of Mutex, RWLock and Atomic types in Rust
負荷分散だけじゃないELBのメリット
初心者向けWebinar AWS上でのネットワーク構築
MySQL5.7 GA の Multi-threaded slave
What is AWS?
AWS Black Belt Tech シリーズ 2016 - Amazon SQS / Amazon SNS
Data Lake,beyond the Data Warehouse
AWS Black Belt Online Seminar Amazon Aurora
AWS Batch Fargate対応は何をもたらすか
오라클 클라우드 OCI 기초 개념 & 용어 정리
Ad

Similar to Lowering the Barrier to Stream Processing With Alex Morley | Current 2022 (20)

PPTX
Project Deimos
PPT
Omg co p proactive computing oct 2010
PDF
Overcoming Variable Payloads to Optimize for Performance
PDF
Patterns and anti patterns of streaming
PPTX
RDF Stream Processing: Let's React
PPT
Perpetual Analytics - Health in Motion
PDF
Stream Processing and Complex Event Processing together with Kafka, Flink and...
PDF
How to use probabilistic inference programming for application orchestration ...
PDF
Tech Talk @ Google on Flink Fault Tolerance and HA
PDF
Deep Visibility: Logging From Distributed Microservices
PDF
Object-Centric Processes - from cases to objects and relations… and beyond
PDF
Evolution of Real-time User Engagement Event Consumption at Pinterest
PDF
Continuous Intelligence - Intersecting Event-Based Business Logic and ML
PDF
Next generation alerting and fault detection, SRECon Europe 2016
PPTX
Observability - the good, the bad, and the ugly
PDF
A Call for Sanity in NoSQL
PDF
Complex event processing platform handling millions of users - Krzysztof Zarz...
PDF
MuCon London 2017: Break your event chains
PPTX
Flink Forward San Francisco 2018: David Reniz & Dahyr Vergara - "Real-time m...
PPTX
Improving Healthcare Operations Using Process Data Mining
Project Deimos
Omg co p proactive computing oct 2010
Overcoming Variable Payloads to Optimize for Performance
Patterns and anti patterns of streaming
RDF Stream Processing: Let's React
Perpetual Analytics - Health in Motion
Stream Processing and Complex Event Processing together with Kafka, Flink and...
How to use probabilistic inference programming for application orchestration ...
Tech Talk @ Google on Flink Fault Tolerance and HA
Deep Visibility: Logging From Distributed Microservices
Object-Centric Processes - from cases to objects and relations… and beyond
Evolution of Real-time User Engagement Event Consumption at Pinterest
Continuous Intelligence - Intersecting Event-Based Business Logic and ML
Next generation alerting and fault detection, SRECon Europe 2016
Observability - the good, the bad, and the ugly
A Call for Sanity in NoSQL
Complex event processing platform handling millions of users - Krzysztof Zarz...
MuCon London 2017: Break your event chains
Flink Forward San Francisco 2018: David Reniz & Dahyr Vergara - "Real-time m...
Improving Healthcare Operations Using Process Data Mining
Ad

More from HostedbyConfluent (20)

PDF
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
PDF
Renaming a Kafka Topic | Kafka Summit London
PDF
Evolution of NRT Data Ingestion Pipeline at Trendyol
PDF
Ensuring Kafka Service Resilience: A Dive into Health-Checking Techniques
PDF
Exactly-once Stream Processing with Arroyo and Kafka
PDF
Fish Plays Pokemon | Kafka Summit London
PDF
Tiered Storage 101 | Kafla Summit London
PDF
Building a Self-Service Stream Processing Portal: How And Why
PDF
From the Trenches: Improving Kafka Connect Source Connector Ingestion from 7 ...
PDF
Future with Zero Down-Time: End-to-end Resiliency with Chaos Engineering and ...
PDF
Navigating Private Network Connectivity Options for Kafka Clusters
PDF
Apache Flink: Building a Company-wide Self-service Streaming Data Platform
PDF
Explaining How Real-Time GenAI Works in a Noisy Pub
PDF
TL;DR Kafka Metrics | Kafka Summit London
PDF
A Window Into Your Kafka Streams Tasks | KSL
PDF
Mastering Kafka Producer Configs: A Guide to Optimizing Performance
PDF
Data Contracts Management: Schema Registry and Beyond
PDF
Code-First Approach: Crafting Efficient Flink Apps
PDF
Debezium vs. the World: An Overview of the CDC Ecosystem
PDF
Beyond Tiered Storage: Serverless Kafka with No Local Disks
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Renaming a Kafka Topic | Kafka Summit London
Evolution of NRT Data Ingestion Pipeline at Trendyol
Ensuring Kafka Service Resilience: A Dive into Health-Checking Techniques
Exactly-once Stream Processing with Arroyo and Kafka
Fish Plays Pokemon | Kafka Summit London
Tiered Storage 101 | Kafla Summit London
Building a Self-Service Stream Processing Portal: How And Why
From the Trenches: Improving Kafka Connect Source Connector Ingestion from 7 ...
Future with Zero Down-Time: End-to-end Resiliency with Chaos Engineering and ...
Navigating Private Network Connectivity Options for Kafka Clusters
Apache Flink: Building a Company-wide Self-service Streaming Data Platform
Explaining How Real-Time GenAI Works in a Noisy Pub
TL;DR Kafka Metrics | Kafka Summit London
A Window Into Your Kafka Streams Tasks | KSL
Mastering Kafka Producer Configs: A Guide to Optimizing Performance
Data Contracts Management: Schema Registry and Beyond
Code-First Approach: Crafting Efficient Flink Apps
Debezium vs. the World: An Overview of the CDC Ecosystem
Beyond Tiered Storage: Serverless Kafka with No Local Disks

Recently uploaded (20)

PDF
Electronic commerce courselecture one. Pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Cloud computing and distributed systems.
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Spectral efficient network and resource selection model in 5G networks
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Review of recent advances in non-invasive hemoglobin estimation
Electronic commerce courselecture one. Pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Dropbox Q2 2025 Financial Results & Investor Presentation
NewMind AI Weekly Chronicles - August'25 Week I
The Rise and Fall of 3GPP – Time for a Sabbatical?
sap open course for s4hana steps from ECC to s4
Agricultural_Statistics_at_a_Glance_2022_0.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Digital-Transformation-Roadmap-for-Companies.pptx
Cloud computing and distributed systems.
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Unlocking AI with Model Context Protocol (MCP)
Programs and apps: productivity, graphics, security and other tools
Spectral efficient network and resource selection model in 5G networks
“AI and Expert System Decision Support & Business Intelligence Systems”
Per capita expenditure prediction using model stacking based on satellite ima...
MIND Revenue Release Quarter 2 2025 Press Release
Review of recent advances in non-invasive hemoglobin estimation

Lowering the Barrier to Stream Processing With Alex Morley | Current 2022

  • 1. 1 © Babylon 2022 Lowering the barrier to stream processing with python, Faust and a "FaaS" approach
  • 2. 2 © Babylon 2022 Contents page Other Features Whats under the hood Problem Existing options for our customers Use cases Evaluating OOTB solutions Our Solution | Health Graph Functions How our solution looks with each use case
  • 4. 5 © Babylon 2022 What’s the Problem? High barrier to entry Slow to develop More than 1 month on average Expensive Compute and memory requirements lead to high cloud costs Maintenance & Complexity Burden Teams scared to build streaming apps
  • 5. 6 © Babylon 2022 Previous solutions at Babylon Kafka Streams Java & Scala Stream processing Kafka Client Libs Java, Scala, Python, Ruby Simple stream consumers and producers Faust Python Stream processing Customise it Run on Kubernetes as Deployment Choose a microservice template
  • 6. 7 © Babylon 2022 Use Cases Enrich | Code Mapping Requires: ● Internal API request Infer | Risk Prediction Requires: ● Internal API request ● Complex Logic ● Python Libraries Alert | Early Detection Alerts Requires: ● Internal API request ● Complex Logic ● Python Libraries ● External API request ● Internal State (for debounce) Enrich Infer Alert Patient Clinician Health Graph** **Despite the name, Babylon’s Health Graph is stream-first, graph-second!
  • 7. 8 © Babylon 2022 Evaluating OOTB solutions against our use cases SQL Stream Processors But we need: ● Complex logic ● Client libraries/packages ● To make API calls Existing FaaS with stream triggers But we need: ● Batching ● Windowing ● Stream-based State Stores Flink StateFun But we did not need: ● Overhead of deploying and managing a Flink cluster ● Cost and inefficiency of running everything on the JVM
  • 8. 9 © Babylon 2022 Our Solution | Health Graph Functions class Context(BaseContext ): terminology_client: AsyncRESTClientContext async def code_mapping_function ( key: DFHIRKey, value: DFHIRValue, metadata: EventMetadata, context: Context, ) -> t.Dict[ str, t.List[Event]]: ... mapped_codes = context.terminology_client.post({“codes”: value.codes}) ... return { “conditions” : condition_events, “labs”: labs_events, } agents: CodeMapping: enabled: true function: code_mapping.code_mapper version: latest error_handling: BLOCK store: S3 input_topic: name: domainevent.redox-cq-integration.clinical-summary output_topics: condition: name: dfhir.reportedcondition.v1 labs: name: dfhir.labs.v1 context: terminology_client: url: '{{ services }}/fast-ct/codeableconcept/convert' auth: default
  • 9. 10 © Babylon 2022 What does it look like? Code Mapping class Context(BaseContext): terminology_client: AsyncRESTClientContext async def code_mapping_function ( key: DFHIRKey, value: DFHIRValue, metadata: EventMetadata, context: Context, ) -> t.Dict[str, t.List[Event]]: ... mapped_codes = context.terminology_client.post({“codes”: value.codes}) ... return { “conditions” : condition_events, “labs”: labs_events, } Auto-injected client. Highly configurable.
  • 10. 11 © Babylon 2022 agents: CodeMapping: enabled: true function: code_mapping.code_mapper version: latest error_handling: BLOCK store: S3 input_topic: name: domainevent.redox-cq-integration.clinical-summary output_topics: condition: name: dfhir.reportedcondition.v1 labs: name: dfhir.labs.v1 context: terminology_client: url: '{{ services }}/fast-ct/codeableconcept/convert' auth: default How the client is configured. An “Agent” in this context is a configured instance of a function (enables us to run the same function with different configurations). What does it look like? Code Mapping
  • 11. 12 © Babylon 2022 class Thresholds(BaseModel): high: float medium: float class Context(BaseContext): thresholds: Thresholds model_version: SemanticVersion healthIQ_client: AsyncRESTClientContext async def risk_prediction_function ( key: DFHIRKey, value: DFHIRValue, metadata: EventMetadata, context: Context, ) -> t.Dict[str, t.List[Event]]: ... mapped_codes = context.terminology_client.post({“codes”: value.codes}) ... return {“predictions”: predictions} Custom contexts can be extended with your own models. Everything is typed/validated with pydantic. This one is simple but they can be super powerful if required! What does it look like? Risk Prediction
  • 12. 13 © Babylon 2022 agents: AcuityScore: ... # skip some things for brevity context: model_version: “1.9.1” thresholds: high: 0.042 medium: 0.0138 healthIQ_client: url: '{{ services }}/pottery/healthIQ' auth: default output_topics: predictions: name: dfhir.riskassessment.v1 Holds the configuration for the thresholds part of the custom context What does it look like? Risk Prediction
  • 13. 14 © Babylon 2022 agents: AcuityScore: ... # skip some things for brevity context: model_version: “1.9.1” ... output_topics: predictions: name: dfhir.riskassessment.v1 ShadowAcuityScore: ... # skip some things for brevity context: model_version: “2.0.0alpha” output_topics: predictions: name: shadow.dfhir.riskassessment.v1 This allows us to do trivial “shadow deployments” of ML models. We can run the new model on live data but the predictions will go to a separate stream for evaluation. (This is why we don’t reference topics directly in functions). What does it look like? Risk Prediction
  • 14. 15 © Babylon 2022 class Context(BaseContext): graphql_client: AsyncGraphQLClientContext notification_client: AsyncRESTClientContext debounce_table: TableContext debounce_days: float # IRL there’s lots more here! async def early_detection_function ( key: NotificationKey, value: NotificationValue, metadata: EventMetadata, context: Context, ) -> t.Dict[str, t.List[Event]]: last_alerted_subject = (time.now()- context.debounce_table[key.subject.id].time) ... if last_alerted_subject < timedelta(days=debounce_days): return {“early_detection_alert_skipped” : alert_event} return {“early_detection” : alert_event} You can have multiple clients if you want. And stream-backed state stores. We means we can avoid sending unnecessary alerts! (We do still return an event in case we want those to be saved for auditing) What does it look like? Early Detection
  • 15. 16 © Babylon 2022 agents: EarlyDetection: ... # skip some things for brevity context: graphql_client: {} notification_client: url: {{ urls.trigger_workflow }} auth: type: oauth url: {{ workflow.auth.url }} id: {{ workflow.auth.id }} secret: {{ workflow.auth.id }} debounce_table: settings: name: debounce-subject debounce_days: 10 Defaults for some clients for simplicity (this is our federated GraphQL API). Multiple configurable auth flows. Stream-backed state store settings. What does it look like? Early Detection
  • 16. 17 © Babylon 2022 What else? Other features Auto-generated Agent Configuration UI async def window_function (events: t.Sequence[Events], context: Context): --- batching: size: 200 timeout: 2 Windowing and batching # define and configure input event generators and expected output assertions # these can be defined inline and will be continuously tested in live environments Built-in Test Harnesses
  • 17. 18 © Babylon 2022 What’s under the hood? Agent Configuration Code Storage UI (ClickOps) or CI (GitOps) Code Config
  • 18. 19 © Babylon 2022 Code Storage What’s under the hood? Health Graph Functions Operator … Agent Configuration UI (ClickOps) or CI (GitOps) Health Graph Functions Instance … Listens, scales and configures
  • 19. 20 © Babylon 2022 Code Storage What’s under the hood? Health Graph Functions Operator … Agent Configuration UI (ClickOps) or CI (GitOps) Fetches Processes Health Graph Functions Instance …
  • 20. 21 © Babylon 2022 Code Storage What’s under the hood? Health Graph Functions Operator … Agent Configuration UI (ClickOps) or CI (GitOps) Fetches Processes Health Graph Functions Instance … uses Faust uses @kopf
  • 21. Did you know we’re hiring? Want to join a global organization? Do you believe in Babylon’s mission to bring affordable and accessible healthcare to every human on earth? We’re looking for exceptional talent across the technology organization. Check out our Career Site to find your next opportunity with Babylon. babylonhealth.com/careers/technology
  • 22. Thank you © 2022 Babylon Inc. All rights reserved. Thank you © Babylon 2022