# AlphaAvatar v0.6.2 Release Notes

AlphaAvatar **v0.6.2** focuses on a major runtime and configuration cleanup, introducing a unified provider layer and preparing the project for richer multi-user, multimodal, and session-aware workflows.

## Highlights

### Unified Provider Layer

This release introduces a new provider abstraction under `alphaavatar.agents.providers`, allowing AlphaAvatar plugins to call LLMs and embedding models through a unified task-based interface instead of directly depending on a specific provider client.

The provider layer now supports:

* Task-level LLM configuration
* Structured output invocation
* Provider usage normalization
* Prompt and response tracing
* Token usage and latency recording
* Provider-based embedding model creation

Memory and Persona extraction logic can now be configured through provider tasks such as:

```yaml
memory.conversation_delta
memory.tool_delta
persona.profile_delta
```

This makes it easier to switch between OpenAI, OpenRouter, Gemini, Claude, or other future providers without rewriting plugin internals.

### Provider Tracing and Usage Tracking

Provider calls now support structured tracing for debugging and analysis. Each task call can record:

* Task name
* Provider and model
* Prompt hash
* Prompt version
* Latency
* Token usage
* Cache / reasoning token metadata where available
* Error status
* Session metadata

Traces are organized by session and task name, making it easier to inspect and compare runtime behavior across Memory, Persona, and future runtime components.

### Provider-Based Embeddings

Embedding creation has been moved into the provider system. VDB-backed modules such as Memory, Persona, and MCP can now configure embeddings using a unified structure:

```yaml
embedding:
  provider: openai
  model: text-embedding-3-small
```

The old direct embedding factory path was removed in favor of explicit provider-based creation.

### Runtime Structure Refactor

This release separates runtime state from static configuration.

AlphaAvatar now introduces a dedicated runtime layer for:

* Session runtime
* Context runtime
* Participant/user runtime state
* Session paths
* User path migration

This prepares AlphaAvatar for multi-user room sessions where a single session may contain multiple participants, each resolved to a different user identity.

### Multi-Participant Session Foundation

The session runtime is now designed around participants instead of assuming a single `user_id` per session.

A session can now track:

* Session ID
* Primary participant
* Multiple participants
* Participant-to-user identity resolution
* User path updates
* Pending user path migrations

This lays the groundwork for future multi-speaker, multi-face, and multi-user memory flows.

### Cleaner Avatar Directory Layout

The runtime directory layout has been clarified:

```text
data/
  sessions/
  memory/
  graph/
  artifacts/

users/
  {user_id}/

env/
  ...
```

Session-level artifacts, provider traces, memory candidates, and future multimodal observations now belong under session or avatar-level data directories, while user directories are reserved for participant identity and runtime state.

### Nested Configuration Format

AlphaAvatar’s configuration format has been reorganized from flat keys into a nested, module-oriented structure.

For example:

```yaml
llm:
  plugin: openai
  model: gpt-4o-mini

voice:
  stt:
    plugin: openai
    model: gpt-4o-transcribe

memory:
  provider:
    conversation_delta_task: memory.conversation_delta
    tool_delta_task: memory.tool_delta
```

This makes configuration files easier to read, maintain, and extend as AlphaAvatar grows.

### Plugin Lifecycle Cleanup

Runtime plugin initialization has been cleaned up with a clearer lifecycle model.

Plugins can now separate:

* Object construction
* Session startup
* Session shutdown
* Save / cleanup behavior

This reduces the amount of initialization logic inside `AvatarEngine.on_enter()` and makes Memory, Persona, Vision, and future plugins easier to manage.

## Breaking / Migration Notes

This release includes internal configuration and runtime structure changes.

Existing flat YAML configs such as:

```yaml
llm_plugin: openai
llm_model: gpt-4o-mini
```

should be migrated to the new nested style:

```yaml
llm:
  plugin: openai
  model: gpt-4o-mini
```

Embedding config should now be explicit:

```yaml
embedding:
  provider: openai
  model: text-embedding-3-small
```

Older direct embedding model configuration paths are no longer recommended.

## Summary

AlphaAvatar v0.6.2 is an infrastructure-focused release. It improves provider abstraction, runtime state organization, provider tracing, embedding configuration, and plugin lifecycle boundaries.

These changes prepare AlphaAvatar for the next stage: a more robust multimodal memory runtime, session-level event storage, multi-user identity handling, and graph-based long-term context.
