Skip to main content

What is AveniECA?

AveniECA is a Python SDK for interacting with an AveniECA instance, enabling you to stream state data through Kafka and interact with the REST API. It implements the ECA (Episodic-Cybernetic-Agency) model, a framework for building intelligent systems that learn from experience and predict future states.

The ECA Model

The ECA model is built on three core principles:

Episodic

The system organizes experiences into episodes or sequences. Each sequence represents a series of state transitions that occurred over time, allowing the system to learn temporal patterns and context.

Cybernetic

The system uses feedback loops between perception and action. It continuously monitors state changes, evaluates them through valence (positive/negative assessment), and uses this information to improve predictions.

Agency

The system maintains autonomous digital representations (twins) that can predict future states based on past experiences. These twins act as intelligent agents that understand their own state evolution.

Core Concepts

The AveniECA framework consists of four fundamental concepts that work together:

Digital Twins

Digital twins are virtual representations of real-world entities or processes. Each twin:
  • Has a unique module_id that identifies its type (e.g., “air_conditioner”, “temperature”)
  • Maintains its own state history through ESS (Episodic State Space)
  • Can be streamed to via Kafka using sub_topics
  • Can exist as individual modules or be combined into aggregates
Learn more: Digital Twins

Signals

Signals are the fundamental data structure that represents the state of a digital twin at a point in time. Each signal contains:
  • state: A vector of float values representing the twin’s current state
  • valence: An optional emotional/evaluative assessment of the state
  • score: An optional numeric ranking or importance value
  • emb_inp: An optional reference to embedding inputs for semantic understanding
Learn more: Signals

Modules

Modules are organizational units that define different types of digital twins. They:
  • Group related twins together (e.g., all “temperature” sensors)
  • Can represent individual entities or aggregate combinations
  • Store their state history in the Episodic State Space (ESS)
  • Enable predictions through the Cortex API
Learn more: Modules

Sequences

Sequences represent ordered series of states that form episodic memories. They:
  • Link multiple ESS entries together to form temporal patterns
  • Enable the system to learn from past state transitions
  • Support prediction of future states based on historical sequences
  • Can have different statuses to categorize types of experiences

How the System Works

Data Flow

  1. Capture: Real-world state is captured and converted into a Signal
  2. Stream: Signals are published to Kafka topics associated with digital twins
  3. Store: The AveniECA instance stores signals as ESS entries with module_id
  4. Sequence: ESS entries are organized into sequences representing episodes
  5. Learn: The system identifies patterns in sequences of state transitions
  6. Predict: The Cortex API predicts likely next states based on learned patterns

Example Workflow

from avenieca.data import Signal
from avenieca.producers import Stream
from avenieca.config.broker import Broker
import os

# Define how to capture state
def capture_temperature():
    # In real application, read from sensor
    temp = 22.5
    return Signal(
        state=[temp],
        valence=10.0 if temp < 25 else -10.0,
        score=1
    )

# Configure connection to digital twin
config = Broker(
    url=os.environ["KAFKA_URL"],
    sub_topic="temperature_sensor_1",  # Twin's subscriber topic
    group="sensors",
    pub_topic=""
)

# Stream continuous state updates
stream = Stream(config=config, sync_rate=1.0)
stream.publish(capture_temperature)
This continuously:
  1. Captures temperature readings as Signals
  2. Publishes them to the “temperature_sensor_1” twin
  3. Builds up episodic memory in the ESS
  4. Enables prediction of future temperature states

Aggregates: Combining Multiple Twins

One of the powerful features of AveniECA is the ability to combine multiple individual module states into aggregate twins:
# Individual modules
temperature = ESSResponse(module_id="temperature", state=[28.0], valence=-90)
humidity = ESSResponse(module_id="humidity", state=[65.0], valence=-50)
air_quality = ESSResponse(module_id="air_quality", state=[85.0], valence=-70)

# Aggregate combines them
aggregate = ESSInsert(
    module_id="climate_aggregate",
    state=[28.0, 65.0, 85.0],  # Combined states
    aggregate_module_id=["temperature", "humidity", "air_quality"],
    aggregate_shape=[1, 1, 1],  # Size of each component
    # ... other aggregate metadata
)
Aggregates enable:
  • Multi-modal predictions: Predict how multiple related systems evolve together
  • Holistic understanding: Capture relationships between different aspects
  • Efficient querying: Get complete system state in one operation

Next Steps

Signals

Learn about the Signal data structure and state representation

Digital Twins

Understand how digital twins work in AveniECA

Modules

Explore module organization and aggregates

Quick Start

Start building with AveniECA

Build docs developers (and LLMs) love