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

# Email-first agent

> Illustrative: an agent that lives in the inbox and calls when a conversation needs a voice. What runs today, and what it waits on.

**Illustrative.** An agent that lives in the inbox: it answers inbound
email, follows up on its own schedule, and places a call when a
conversation needs a voice. Built by SaaS teams and support operations.

## How it would work

**1. An email arrives**

It resolves to a person and to their open thread.

**2. The agent replies, or waits**

It answers now, or schedules a follow-up.

**3. No reply in two days**

The flow places a call, with the thread as context.

**4. The outcome is written back**

The thread, and the person, carry what happened on the call.

## The shape

```python Illustrative - not callable today theme={null}
thread = unpod.conversations.latest(person_id=person.id, channel="email")
unpod.messages.send(
    conversation_id=thread.id,
    channel="email",
    subject="Your renewal",
    text="Your plan renews on the 30th. Reply here to change it.",
)
unpod.flows.start("renewal-follow-up", person_id=person.id)
```

## What it waits on

| Piece | Status | Where |
| - | - | - |
| Email conversations (Gmail-connected flows; no SDK resource yet) | In build | [Channels](https://docs.unpod.ai/core-engine/channels.md) |
| Conversations API | In build | [Conversations](https://docs.unpod.ai/core-engine/conversations.md) |
| Journeys: waits and outcome branching | In build | [Flows & Journeys](https://docs.unpod.ai/core-engine/flows-journeys.md) |

## Build it today

Nothing email-native ships yet. The closest working version keeps email in
your own stack and puts the voice step on Unpod:

1. Your system sends and receives the email.
2. When a thread needs a voice, your system places a call and passes the
   thread summary as call data.
3. Attach an [analytics block](https://docs.unpod.ai/speech-stack/analytics.md) to the agent, read
   the outcome with `client.analytics.for_call(call.call_id)`, and write it
   back to the thread.

```python call_from_thread.py theme={null}
import asyncio
from unpod import AsyncClient

async def main() -> None:
    async with AsyncClient() as client:
        call = await client.calls.create(
            agent_id="renewals",
            to_number="+9198xxxxxx01",
            data={"thread_summary": "Asked about the renewal price twice; no reply since Monday."},
        )
        print(call.call_id, call.status)

asyncio.run(main())
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.