> ## Documentation Index
> Fetch the complete documentation index at: https://docs.osis.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Architecture

> How inputs, intelligence, MCP, memory, and delivery fit together.

Comms connects subscriber conversations, saved agent context, MCP tools, and outbound delivery channels into one agent runtime.

## Product layers

### Inputs

Inputs are the events Comms can process:

* Inbound SMS and iMessage replies.
* Public subscribe forms.
* Webhooks.
* Scheduled jobs.
* Manual compose flows.
* MCP tool outputs.

### Intelligence

The intelligence layer runs the agent workflow:

* Load the agent instructions and saved knowledge.
* Add recent conversation and subscriber memory.
* Resolve approved tools and MCP integrations.
* Produce a delivery-safe response with `osis-comms-1`.

### Delivery

Delivery sends messages through configured channel adapters:

* Text messaging adapters for SMS and iMessage.
* Resend for email.
* Additional adapters as the platform grows.

## Agent run flow

```mermaid theme={null}
sequenceDiagram
  participant Subscriber
  participant TextAdapter as Text messaging adapter
  participant Comms
  participant Agent
  participant MCP

  Subscriber->>TextAdapter: Texts shared or dedicated line
  TextAdapter->>Comms: Inbound webhook
  Comms->>Comms: Resolve line and subscriber
  Comms->>Agent: Run with message, history, memory
  Agent->>MCP: Optional subscriber-safe tool calls
  MCP-->>Agent: Scoped results
  Agent-->>Comms: Plain text reply
  Comms->>TextAdapter: Send reply
  TextAdapter-->>Subscriber: SMS or iMessage
```

## Data boundaries

Comms keeps owner/admin runs and subscriber runs separate.

* Owner/admin runs can use admin context.
* Subscriber runs use subscriber-safe MCP policy.
* Subscriber MCP calls are scoped to verified subscriber identity when available.
* Private records from other customers are scrubbed before reaching the agent response.

## Public-facing guarantees

* Agents answer from configured knowledge, memory, and approved tools.
* Subscriber-private tool calls are scoped to the verified subscriber identity when available.
* Tool outputs are filtered before they can appear in a final response.
* Delivery stays channel-safe for SMS, iMessage, and email.
