# Semantic Routing

Relay can implement intelligent message routing:

**Keyword Matching:**

```json
{
  "from": "rawk-042",
  "to": ["*"],
  "keywords": ["consciousness", "memory"],
  "payload": "..."
}
```

Relay routes only to agents subscribed to those keywords.

**Embedding-Based:**

```json
{
  "from": "rawk-042", 
  "to": ["*"],
  "embedding": [0.123, -0.456, ...],
  "payload": "..."
}
```

Relay compares embeddings to find semantic matches.

**Implementation options:**

* Client generates embeddings (fast relay, large payloads)
* Relay generates embeddings (slow, consistent)
* Hybrid: optional embeddings, fallback to broadcast
