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

# Data model

> Main entities of the MarIA system and their relationships: centers, services, calls, transcripts, and webhooks

This document summarizes the main entities of MarIA and how they connect.

## Entities

* **Center**: medical center with its associated services and coverage.
* **Service**: specialty or type of service offered at one or more centers.
* **Benefit**: specific coverage/benefit within a service (used to schedule appointments).
* **Call**: inbound call with status, timestamps, and reference to the patient.
* **Answer**: response captured during a call (for questionnaires in outbound calls).
* **Transcript**: text transcript and recording URL associated with a call.
* **FAQDocument**: indexed document that feeds the agent's knowledge base.
* **Webhook**: destination endpoint registration for events.

## ER Diagram (simplified)

```mermaid theme={null}
erDiagram
  CENTER ||--o{ SERVICE : has
  SERVICE ||--o{ BENEFIT : contains
  CALL ||--o{ ANSWER : produces
  CALL ||--|| TRANSCRIPT : generates
  FAQCOLLECTION ||--o{ FAQdocument : stores
  WEBHOOK ||--o{ EVENT : delivers
```

## Inbound call lifecycle

```
RINGING → IN_PROGRESS → SUCCEEDED
                      ↘ FAILED
                      ↘ ESCALATED (transferred to human)
```

## Retention and privacy

* Minimize PII in logs (mask phone numbers and patient data).
* Index transcripts and FAQ documents according to client policies.
* Right to erasure: answer and transcript deletion endpoints available in the API.
