## AlphaAvatar v0.6.4 Release Notes

### Highlights

AlphaAvatar v0.6.4 introduces the first complete foundation for **realtime multimodal perception and online ENV memory**.

This release adds a transport-agnostic `avatar-core` media and perception runtime, unifies live visual input across Vision, Persona, and Memory, and moves session-scoped runtime dependencies into a shared `AvatarRuntime`.

The result is a cleaner full-duplex architecture where media is published once, enriched with annotations, aligned on a shared timeline, and consumed independently by multiple runtime plugins.

### What's New

* Added the new `avatar-core` perception architecture:

  * `env` defines `EnvObservation` and `EnvAnnotation`.
  * `media` defines `MediaPayload`, `PayloadFormat`, `PayloadView`, and generic video-frame representations.
  * `perception` provides typed streams, observation–annotation alignment, shared timelines, and consumer-specific windows.
  * Core media types no longer depend on LiveKit, model providers, or plugin implementations.

* Added multi-representation media payloads:

  * A single observation can carry raw, annotated, and derived representations.
  * Raw payloads remain unchanged when annotations are rendered.
  * Consumers explicitly request the payload format and view they need.
  * Video frames use AlphaAvatar-owned frame types instead of storing `rtc.VideoFrame` directly in core observations.

* Added `PerceptionRuntime`:

  * Provides independent video, audio, screen, event, and annotation streams.
  * Each consumer maintains its own stream cursor.
  * Observations and annotations are aligned by `observation_id` and `frame_id`.
  * `PerceptionWindowBuilder` creates ordered multimodal windows for Memory, Persona, Vision, and future routers.
  * Optional grace periods allow asynchronous annotations to arrive before downstream consumption.

* Added `AvatarRuntime`:

  * Aggregates `SessionRuntime`, `StateRuntime`, and `PerceptionRuntime`.
  * Makes the three runtimes explicit parallel components of an Avatar session.
  * Keeps `AvatarEngine` focused on orchestration, prompt assembly, status, and model turn flow.

* Simplified runtime plugin lifecycle:

  * Runtime dependencies are injected during plugin construction.
  * `on_start()` and `on_stop()` no longer receive runtime arguments.
  * Perception consumers start before RTC producers, while producers stop before consumers.
  * Persona now fully owns its face-stream lifecycle.

* Added transport-agnostic LiveKit video ingestion:

  * `LiveKitVideoInput` converts LiveKit frames into generic AlphaAvatar video payloads.
  * Raw video-frame and JPEG representations are published once into `PerceptionRuntime`.
  * Future RTC adapters can publish the same core payload types without changing Memory, Persona, or Vision.

* Added annotated visual payload views:

  * Persona FaceStream consumes raw JPEG observations for face detection and identity matching.
  * Face results are published as `EnvAnnotation` records.
  * Annotation renderers generate annotated video-frame and JPEG views without overwriting raw media.
  * Multiple annotation renderers can compose over the same observation.

* Added online ENV memory extraction:

  * Memory periodically consumes ordered observation windows from `PerceptionRuntime`.
  * ENV extraction prefers annotated JPEG evidence and falls back to raw JPEG evidence.
  * Configured multimodal providers can generate `EnvMemoryDelta` entries for `MemoryType.ENV`.
  * ENV memory is combined with conversation and tool memory during session updates.
  * `env_delta_task` remains optional and safely returns an empty delta when disabled.

* Updated Sampled Frame Vision:

  * Vision consumes observations asynchronously into a bounded local buffer.
  * Snapshots keep references to shared observations instead of copying resolved frames.
  * Late annotations can therefore be available when visual context is injected.
  * Generic core video frames are converted back to LiveKit frames only at the model adapter boundary.

### Notes

* LiveKit remains the default RTC backend, but the new core perception path is no longer coupled to LiveKit types.
* Audio, screen, events, and annotations already have dedicated stream foundations, while the first complete implementation focuses on live video.
* ENV retrieval in v0.6.4 provides the initial visual-history foundation; richer object-level and graph-aware visual search will continue in later releases.
* Existing integrations using `PerceptionBus`, `rendered_payload`, or `model_payload` must migrate to `PerceptionRuntime` and explicit payload views.

### Internal Direction

v0.6.4 establishes the new realtime perception path:

```text
RTC / Device Adapter
        ↓
EnvObservation + MediaPayload
        ↓
PerceptionRuntime
  ├── Typed Streams
  ├── Shared Timeline
  └── Window Builder
        ↓
Persona / ENV Memory / Sampled Frame Vision / Future Routers
```

The architectural responsibility is now clearer:

* RTC adapters normalize external media.
* `avatar-core` owns transport-agnostic observations, payloads, streams, timelines, and windows.
* `avatar-agents` owns runtime composition and orchestration.
* Plugins consume shared perception data without subscribing directly to RTC tracks.
* Providers receive explicit model-ready representations instead of runtime transport objects.
