What are Modules?
In AveniECA, a module is an organizational unit that groups related digital twins together. Themodule_id serves as both an identifier and a namespace for storing and querying state data in the Episodic State Space (ESS).
Module Fundamentals
Module as Type Definition
Think of a module as a “type” or “class” of digital twin. Just as you might have multiple instances of a Python class, you can have multiple instances of a module:- The same
module_id - The same state vector structure
- The same ESS storage
- Access to the same prediction models
Module ID Structure
Amodule_id is a string that appears throughout the AveniECA system:
Module Types
Individual Modules
Purpose: Represent a single, atomic component or measurement. Characteristics:- Simple state vectors (often 1-3 dimensions)
- Independent state history
- Can be components of aggregates
- Focused prediction domain
- Component needs independent monitoring
- State is simple and well-defined
- May be part of multiple different aggregates
- Need granular history for specific component
Aggregate Modules
Purpose: Combine multiple individual modules to learn multi-modal patterns and relationships. Characteristics:- Complex state vectors (combination of component states)
- Rich metadata about components
- Enable holistic predictions
- Store relationships between components
- Components interact or influence each other
- Need to predict multi-variable outcomes
- Want to understand system-level behavior
- Need efficient queries for complete system state
Module Organization Patterns
Hierarchical Organization
Organize modules in a hierarchy from simple to complex:- Predictions at multiple levels of granularity
- Efficient queries at appropriate scope
- Clear organization and debugging
- Scalable to large systems
Functional Organization
Group modules by function or domain:- Clear separation of concerns
- Domain experts can focus on relevant modules
- Independent evolution of domains
- Easier maintenance and debugging
Creating and Using Modules
Defining a New Module
Creating Aggregates
Follow this pattern from the README to create properly structured aggregates:Querying Modules
Get All States for a Module
Search for Similar States
Get States from Sequences
Find Aggregates Containing a Module
Module Predictions
Requesting Predictions
The Cortex API predicts future states for modules:Raw Predictions
Get predictions as raw aggregate values:Best Practices
Consistent State Structure
Consistent State Structure
All ESS entries for a
module_id must have:- Same state vector dimensionality
- Same component order
- Same units and scaling
Meaningful Module Names
Meaningful Module Names
Choose descriptive names that indicate:
- What the module represents
- Its level of abstraction
- Its domain or context
Aggregate Composition
Aggregate Composition
When creating aggregates:
- Include related, interacting components
- Maintain component ordering consistency
- Validate aggregate metadata accuracy
- Use the helper function from README
aggregate_shapematches actual component dimensionsaggregate_idreferences exist in ESS- Metric calculations are correct
Module Scope
Module Scope
Design modules at appropriate scope:
- Too narrow: “temp_reading_1” (overly specific)
- Good: “temperature” (right level)
- Too broad: “all_sensors” (too general)
Common Patterns
Pattern: Sensor Array
Multiple identical sensors, different locations:Pattern: Multi-Level Aggregates
Build system understanding hierarchically:Pattern: Dynamic Module Creation
Create modules programmatically:Next Steps
Signals
Learn about the Signal data structure
Digital Twins
Understand digital twin concepts
ESS API
Complete ESS API reference
Cortex API
Prediction API reference