# `Spectre.Subject`
[🔗](https://github.com/elchemista/spectre/blob/0.4.0/lib/spectre/subject.ex#L1)

Canonical person or entity identity owned by an Agent Instance.

A Subject is deliberately distinct from a channel sender, chat, phone
number, or conversation id. External identities reach a Subject only through
explicit `Spectre.SubjectLink` records.

# `t`

```elixir
@type t() :: %Spectre.Subject{id: String.t(), metadata: map()}
```

# `key`

```elixir
@spec key(t()) :: String.t()
```

Returns an opaque key for Instance and Subject Registry indexes.

# `new`

```elixir
@spec new(
  t() | term(),
  keyword()
) :: t()
```

Normalizes a portable application identity into a canonical Subject.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
