# aloktp/real-estate-ai-agent architecture

> Architecture diagram of the GitHub repository aloktp/real-estate-ai-agent, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aloktp/real-estate-ai-agent
- Repository: https://github.com/aloktp/real-estate-ai-agent

## Overview

This is a small Fastify service for automated real-estate outbound calls. The main workflow is an HTTP request to start a call, Twilio connecting the call to the service’s media stream, and a WebSocket relay carrying audio between Twilio and ElevenLabs. The README also documents Airtable lead handling and Make.com post-call automation, represented as documented capabilities rather than verified code paths. The supplied source excerpt does not show those integrations’ implementation; deployment options are omitted as hosting context, not product components.

Main entry points: [`Real Estate_Outbound/index.js`](https://github.com/aloktp/real-estate-ai-agent/blob/main/Real%20Estate_Outbound/index.js) (Fastify service), [`The prompt used in Elevenlabs ConvAI.txt`](https://github.com/aloktp/real-estate-ai-agent/blob/main/The%20prompt%20used%20in%20Elevenlabs%20ConvAI.txt) (Agent prompt), [`Make.com blueprint after phone call ends.json`](https://github.com/aloktp/real-estate-ai-agent/blob/main/Make.com%20blueprint%20after%20phone%20call%20ends.json) (Call-ended blueprint), [`Make.com blueprint for intiating phone call.json`](https://github.com/aloktp/real-estate-ai-agent/blob/main/Make.com%20blueprint%20for%20intiating%20phone%20call.json) (Call-start blueprint)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_call_control["Call control"]
  node_fastify_service["Fastify service<br/>[index.js]"]
  node_twilio["Twilio Voice"]
  node_call_webhook["Call webhook<br/>[index.js]"]
end

subgraph group_voice["Live voice"]
  node_media_stream["Media stream relay<br/>[index.js]"]
  node_elevenlabs["ElevenLabs AI"]
  node_agent_prompt["Agent prompt"]
end

subgraph group_crm_automation["CRM and automation"]
  node_airtable[("Airtable CRM")]
  node_make_service["Make.com"]
  node_call_ended_blueprint["Call-ended blueprint"]
  node_call_start_blueprint["Call-start blueprint"]
end

node_caller(("Call requester"))

node_caller -->|"requests call"| node_fastify_service
node_fastify_service -->|"creates call"| node_twilio
node_twilio -->|"requests TwiML"| node_call_webhook
node_call_webhook -->|"opens stream"| node_media_stream
node_media_stream -->|"relays audio"| node_elevenlabs
node_elevenlabs -->|"returns audio"| node_media_stream
node_airtable -.->|"provides leads"| node_fastify_service
node_fastify_service -.->|"logs call details"| node_airtable
node_make_service -.->|"runs workflow"| node_call_ended_blueprint
node_make_service -.->|"uses template"| node_call_start_blueprint
node_make_service -.->|"automates CRM"| node_airtable
node_agent_prompt -.->|"guides conversation"| node_elevenlabs

click node_fastify_service "https://github.com/aloktp/real-estate-ai-agent/blob/main/Real%20Estate_Outbound/index.js"
click node_call_webhook "https://github.com/aloktp/real-estate-ai-agent/blob/main/Real%20Estate_Outbound/index.js"
click node_media_stream "https://github.com/aloktp/real-estate-ai-agent/blob/main/Real%20Estate_Outbound/index.js"
click node_agent_prompt "https://github.com/aloktp/real-estate-ai-agent/blob/main/The%20prompt%20used%20in%20Elevenlabs%20ConvAI.txt"
click node_call_ended_blueprint "https://github.com/aloktp/real-estate-ai-agent/blob/main/Make.com%20blueprint%20after%20phone%20call%20ends.json"
click node_call_start_blueprint "https://github.com/aloktp/real-estate-ai-agent/blob/main/Make.com%20blueprint%20for%20intiating%20phone%20call.json"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_fastify_service,node_twilio,node_call_webhook toneBlue
class node_media_stream,node_elevenlabs,node_agent_prompt toneAmber
class node_airtable,node_make_service,node_call_ended_blueprint,node_call_start_blueprint,node_caller toneMint
```

## Components

### Call control

- [Fastify service](https://github.com/aloktp/real-estate-ai-agent/blob/main/Real%20Estate_Outbound/index.js): `Real Estate_Outbound/index.js`
- **Twilio Voice**
- [Call webhook](https://github.com/aloktp/real-estate-ai-agent/blob/main/Real%20Estate_Outbound/index.js): `Real Estate_Outbound/index.js`

### Live voice

- [Media stream relay](https://github.com/aloktp/real-estate-ai-agent/blob/main/Real%20Estate_Outbound/index.js): `Real Estate_Outbound/index.js`
- **ElevenLabs AI**
- [Agent prompt](https://github.com/aloktp/real-estate-ai-agent/blob/main/The%20prompt%20used%20in%20Elevenlabs%20ConvAI.txt): `The prompt used in Elevenlabs ConvAI.txt`

### CRM and automation

- **Airtable CRM**
- **Make.com**
- [Call-ended blueprint](https://github.com/aloktp/real-estate-ai-agent/blob/main/Make.com%20blueprint%20after%20phone%20call%20ends.json): `Make.com blueprint after phone call ends.json`
- [Call-start blueprint](https://github.com/aloktp/real-estate-ai-agent/blob/main/Make.com%20blueprint%20for%20intiating%20phone%20call.json): `Make.com blueprint for intiating phone call.json`

### Other components

- **Call requester**

## Connections

- Call requester → Fastify service: requests call (evidence: `README.md`)
- Fastify service → Twilio Voice: creates call (evidence: `Real Estate_Outbound/index.js`)
- Twilio Voice → Call webhook: requests TwiML (evidence: `Real Estate_Outbound/index.js`)
- Call webhook → Media stream relay: opens stream (evidence: `Real Estate_Outbound/index.js`)
- Media stream relay → ElevenLabs AI: relays audio (evidence: `Real Estate_Outbound/index.js`)
- ElevenLabs AI → Media stream relay: returns audio (evidence: `Real Estate_Outbound/index.js`)
- Airtable CRM → Fastify service: provides leads (evidence: `README.md`)
- Fastify service → Airtable CRM: logs call details (evidence: `README.md`)
- Make.com → Call-ended blueprint: runs workflow (evidence: `README.md`)
- Make.com → Call-start blueprint: uses template (evidence: `README.md`)
- Make.com → Airtable CRM: automates CRM (evidence: `README.md`)
- Agent prompt → ElevenLabs AI: guides conversation (evidence: `README.md`)
