Voice AI for real-estate leads
Speculo.ai
Voice AI that calls, texts and emails real-estate leads, then hands the qualified ones to the client's human agents.
Read the architectureIt contributed to $2M+ in annual revenue.
Senior AI Communication Engineer at Speculo.ai
Work with me on voice AIMy part: the Python backend that times every call, text and follow-up.
Pub/Sub delivers at least once, so idempotency keys prevent duplicate sends.
A demo call with fictional names. Both voices are AI.
Transcript
AI assistant: Hi Leila! This is the AI assistant from Northbrook Homes.
AI assistant: So, you asked about the house on Maple Lane?
Leila: Yes! Is it still available?
AI assistant: Mm, it is! Saturday at eleven, or would two work better?
Leila: Eleven. Can you text me the details?
AI assistant: Great, done. I've sent the details. Ben will meet you there.
Follow one lead
An illustration with a fictional lead. The steps follow the published architecture; nothing here touches a real system.
- Lead inDone: Lead acceptedvalid, not a duplicate
- MessageUpdate: Draft passed the checkemail and call script
- Sent onceDone: Email sentkey: leila · email
- CallUpdate: Call answeredqualifying questions
- PersonDone: Handed to Benthe client's agent
Leila fictional lead
Asked about a house on Maple Lane
Not contacted yet
Normal flow
One lead from first contact to a person, the way the pipeline is meant to run.
Press Play story, or go one step at a time with Next step.
Provider unavailable
The same lead, but the email provider is down when her message is ready.
Press Play story, or go one step at a time with Next step.
Step 1 of 5
A new lead arrives
Leila asked about a house. The system checks her record, drops duplicates and scores the lead.
Step 2 of 5
A message written for her
An LLM writes her email and a call script. A quality check scores the draft, and a weak one is written again.
Step 3 of 5
Recorded, then sent
Before sending, the worker records a key for this lead and channel. If the queue delivers the message again, the key is already there and the copy is skipped.
Step 4 of 5
No reply, so the agent calls
The email gets no reply, so the voice agent calls her and works through the qualifying questions.
Step 5 of 5
Handed to a person
Leila is qualified, so the lead goes to Ben, the client's human agent, to take it from here.
Step 1 of 5
A new lead arrives
Leila asked about a house. The system checks her record, drops duplicates and scores the lead.
Step 2 of 5
A message written for her
An LLM writes her email and a call script. A quality check scores the draft, and a weak one is written again.
Step 3 of 5
The email provider refuses it
The provider is down and refuses the request before accepting it. Nothing went out, and the system knows that.
Step 4 of 5
Marked failed, back in the queue
The worker marks the send as failed, which frees the key to be claimed again, and gives the message back. Pub/Sub delivers it again later.
Step 5 of 5
The retry goes through
On redelivery the worker claims the key and sends. Leila gets one email, and the follow-up call and hand-off carry on as normal.
Finished Normal flow
Handed to a person
- What the system knew
- Each send was recorded before it went out, so a redelivered copy would have been skipped.
- What it did
- Checked, wrote, sent and followed up without anyone running the campaign by hand.
- Does a person step in?
- Yes, by design: a qualified lead goes to the client's human agent.
Finished Provider unavailable
The retry goes through
- What the system knew
- The provider refused the request, so nothing had gone out.
- What it did
- Marked the send failed and let the queue retry it, instead of dropping the lead.
- Does a person step in?
- Only if it keeps failing: a queue backlog that stays high raises an alert.
Design note: when is a retry safe?
In the failure story the provider refuses outright, so a retry is safe. A timeout is different: the provider may already have accepted the email, so resending without checking could send it twice, and that case needs a check first. This is a general point, not a description of Speculo's code.
Read both scenarios as text
Normal flow
- A new lead arrives. Leila asked about a house. The system checks her record, drops duplicates and scores the lead.
- A message written for her. An LLM writes her email and a call script. A quality check scores the draft, and a weak one is written again.
- Recorded, then sent. Before sending, the worker records a key for this lead and channel. If the queue delivers the message again, the key is already there and the copy is skipped.
- No reply, so the agent calls. The email gets no reply, so the voice agent calls her and works through the qualifying questions.
- Handed to a person. Leila is qualified, so the lead goes to Ben, the client's human agent, to take it from here.
Does a person step in? Yes, by design: a qualified lead goes to the client's human agent.
Provider unavailable
- A new lead arrives. Leila asked about a house. The system checks her record, drops duplicates and scores the lead.
- A message written for her. An LLM writes her email and a call script. A quality check scores the draft, and a weak one is written again.
- The email provider refuses it. The provider is down and refuses the request before accepting it. Nothing went out, and the system knows that.
- Marked failed, back in the queue. The worker marks the send as failed, which frees the key to be claimed again, and gives the message back. Pub/Sub delivers it again later.
- The retry goes through. On redelivery the worker claims the key and sends. Leila gets one email, and the follow-up call and hand-off carry on as normal.
Does a person step in? Only if it keeps failing: a queue backlog that stays high raises an alert.
