What are Digital Twins?
In AveniECA, a digital twin is a virtual representation of a real-world entity, process, or system that maintains its own state history and can predict future states based on past experiences. Digital twins are the core abstraction that enables the ECA model’s episodic learning and predictive capabilities.Key Characteristics
Every digital twin in AveniECA has:- Identity: A unique
module_idthat identifies what the twin represents - State History: An Episodic State Space (ESS) storing all past states
- Input Channel: A Kafka
sub_topicfor receiving real-time state updates - Memory: Sequences that organize states into temporal episodes
- Prediction: Ability to forecast future states through the Cortex API
Module IDs: Twin Identity
What is a Module ID?
Themodule_id is a string identifier that defines what type of entity a digital twin represents. It’s used throughout the system to:
- Route signals to the correct twin
- Store and retrieve state history
- Query predictions
- Group related twins together
Naming Conventions
Examples from Real Systems
From the README examples:- Individual sensors:
"temperature","air_conditioner","occupancy","purifier","air_quality_index" - Vehicles:
"left_wheel","right_wheel" - Aggregates:
"aggregate001","climate_aggregate","gwp_aggregate"
Twin Instances: Multiple Twins of Same Type
Whilemodule_id defines the type of twin, you can have multiple instances of the same type:
Using Sub-topics for Instances
Kafkasub_topic allows you to differentiate between multiple twins of the same type:
module_id="temperature" when storing in ESS, but stream to different topics.
Using Sequence Instance IDs
For tracking different instances in the API:Streaming to Digital Twins
Sub-topics: The Twin’s Input Channel
Every digital twin receives state updates through a Kafka topic called asub_topic (subscriber topic). This is the input channel through which real-world state flows into the twin.
Continuous vs Event-Based Updates
Episodic State Space (ESS)
What is ESS?
The Episodic State Space is where digital twins store their state history. Every signal sent to a twin is stored as an ESS entry, creating a complete record of the twin’s evolution over time.ESS Structure
Querying Twin History
Real-World Use Cases
Smart Building Climate Control
- Each component maintains its own history
- Aggregate learns relationships between components
- System predicts optimal AC settings based on temperature/humidity patterns
Autonomous Vehicle Fleet
- Track individual component wear and performance
- Predict maintenance needs before failures
- Optimize routes based on learned battery/motor patterns
- Detect anomalies by comparing to normal state sequences
Industrial Equipment Monitoring
- Continuous health monitoring
- Early detection of degradation patterns
- Predictive maintenance scheduling
- Quality control through state correlation
User Behavior Analytics
- Learn typical user behavior patterns
- Predict next likely actions
- Detect unusual behavior (security)
- Personalize experience based on learned preferences
Individual Modules vs Aggregates
Individual Modules
Purpose: Represent a single, specific aspect or component- Tracking a single sensor or metric
- Need independent history for a component
- Component may be part of multiple aggregates
Aggregate Modules
Purpose: Combine multiple modules to learn multi-modal patterns- Learning relationships between multiple components
- Predicting how multiple systems evolve together
- Need holistic understanding of complex system
- Want to query complete system state efficiently
Aggregate Metadata
Aggregates maintain rich metadata about their components:aggregate_id: Database IDs of component ESS entriesaggregate_module_id: Module IDs of each componentaggregate_shape: Dimensionality of each component’s stateaggregate_valence: Individual valence valuesaggregate_score: Individual score valuesavg_ess_valence: Average valence across componentsavg_ess_score: Average score across components
Predictions: Twin Intelligence
How Twins Predict Future States
Digital twins use their episodic memory (sequences of past states) to predict likely future states through the Cortex API:Prediction Use Cases
Anomaly Detection
Anomaly Detection
Compare actual next state with predictions. Large deviations indicate anomalies:
Preventive Maintenance
Preventive Maintenance
Predict when equipment will enter failure states:
Optimization
Optimization
Test different actions to find optimal outcomes:
Best Practices
Choose Appropriate Granularity
Choose Appropriate Granularity
Individual modules for components that:
- Need independent monitoring
- May fail separately
- Require individual history
- Related components that interact
- System-level predictions
- Holistic state queries
Maintain State Consistency
Maintain State Consistency
All signals for a
module_id should have:- Same state vector dimensionality
- Same component order
- Same units/scaling
Use Meaningful Sub-topics
Use Meaningful Sub-topics
Structure Kafka topics hierarchically:Makes management and debugging easier.
Include Temporal Context
Include Temporal Context
Use sequences and timestamps to maintain temporal relationships:
Next Steps
Modules
Deep dive into module organization
Sequences
Learn about episodic memory
Streaming Guide
Start streaming to twins
API Reference
Complete ESS API documentation