Virtual Assistant
Intelligent agent that analyzes emails and calendar, detects relevant information, and supplements with web searches to provide organization, context, and useful recommendations in real time.
graph TD
%%{init: {'theme': 'mc','layout': 'elk'}}%%
GmailMesageComponent-mkt7v[<div><img alt="logo" src="/_astro/gmail.CLxyIGOu.svg" style="height: 20px !important;width: 20px !important"/></div>enviar]
style GmailMesageComponent-mkt7v stroke:#a170ff
GmailMesageComponent-44crm[<div><img alt="logo" src="/_astro/gmail.CLxyIGOu.svg" style="height: 20px !important;width: 20px !important"/></div>obtener]
style GmailMesageComponent-44crm stroke:#a170ff
googlecalendarcomponent-i0fv3[crear evento]
style googlecalendarcomponent-i0fv3 stroke:#a170ff
googlecalendarcomponent-v01iy[obtener eventos]
style googlecalendarcomponent-v01iy stroke:#a170ff
googlecalendarcomponent-pljlu[actualizar evento]
style googlecalendarcomponent-pljlu stroke:#a170ff
googlecalendarcomponent-4abze[eliminar evento]
style googlecalendarcomponent-4abze stroke:#a170ff
CalculatorTool-8cm5k[Calculator]
style CalculatorTool-8cm5k stroke:#a170ff
DuckDuckGoSearch-m7u5j[DuckDuckGo Search]
style DuckDuckGoSearch-m7u5j stroke:#a170ff
GmailMesageComponent-fytbb[<div><img alt="logo" src="/_astro/gmail.CLxyIGOu.svg" style="height: 20px !important;width: 20px !important"/></div>responder]
style GmailMesageComponent-fytbb stroke:#a170ff
LanggraphSupervisorAgent-wsqta[Supervisor Agent]
style LanggraphSupervisorAgent-wsqta stroke:#a170ff
GmailMesageComponent-74mb7[<div><img alt="logo" src="/_astro/gmail.CLxyIGOu.svg" style="height: 20px !important;width: 20px !important"/></div>eliminar]
style GmailMesageComponent-74mb7 stroke:#a170ff
GmailMesageComponent-2umqp[<div><img alt="logo" src="/_astro/gmail.CLxyIGOu.svg" style="height: 20px !important;width: 20px !important"/></div>marcar_leído]
style GmailMesageComponent-2umqp stroke:#a170ff
AdvancedAgent-70psk[AgenteBúsqueda]
style AdvancedAgent-70psk stroke:#a170ff
AdvancedAgent-v75tq[AgenteGmail]
style AdvancedAgent-v75tq stroke:#a170ff
AdvancedAgent-91o8w[AgenteCalendario]
style AdvancedAgent-91o8w stroke:#a170ff
TelegramWebhook-u9hpu[Telegram Webhook]
style TelegramWebhook-u9hpu stroke:#a170ff
TelegramMessage-7x695[Telegram Message]
style TelegramMessage-7x695 stroke:#a170ff
OpenAIModel-w05yo[<div><img alt="logo" src="/_astro/openAI.BhmuxEs3.svg" style="height: 20px !important;width: 20px !important"/></div>OpenAI]
style OpenAIModel-w05yo stroke:#a170ff
OpenAIModel-lv5xv[<div><img alt="logo" src="/_astro/openAI.BhmuxEs3.svg" style="height: 20px !important;width: 20px !important"/></div>OpenAI2]
style OpenAIModel-lv5xv stroke:#a170ff
OpenAIModel-pfy9p[<div><img alt="logo" src="/_astro/openAI.BhmuxEs3.svg" style="height: 20px !important;width: 20px !important"/></div>OpenAI3]
style OpenAIModel-pfy9p stroke:#a170ff
OpenAIModel-cproi[<div><img alt="logo" src="/_astro/openAI.BhmuxEs3.svg" style="height: 20px !important;width: 20px !important"/></div>OpenAI4]
style OpenAIModel-cproi stroke:#a170ff
AdvancedAgent-v75tq -.- LanggraphSupervisorAgent-wsqta
linkStyle 0 stroke:#a170ff
GmailMesageComponent-2umqp -.- AdvancedAgent-v75tq
linkStyle 1 stroke:#a170ff
GmailMesageComponent-44crm -.- AdvancedAgent-v75tq
linkStyle 2 stroke:#a170ff
GmailMesageComponent-fytbb -.- AdvancedAgent-v75tq
linkStyle 3 stroke:#a170ff
GmailMesageComponent-74mb7 -.- AdvancedAgent-v75tq
linkStyle 4 stroke:#a170ff
GmailMesageComponent-mkt7v -.- AdvancedAgent-v75tq
linkStyle 5 stroke:#a170ff
AdvancedAgent-91o8w -.- LanggraphSupervisorAgent-wsqta
linkStyle 6 stroke:#a170ff
googlecalendarcomponent-i0fv3 -.- AdvancedAgent-91o8w
linkStyle 7 stroke:#a170ff
googlecalendarcomponent-pljlu -.- AdvancedAgent-91o8w
linkStyle 8 stroke:#a170ff
googlecalendarcomponent-v01iy -.- AdvancedAgent-91o8w
linkStyle 9 stroke:#a170ff
googlecalendarcomponent-4abze -.- AdvancedAgent-91o8w
linkStyle 10 stroke:#a170ff
CalculatorTool-8cm5k -.- AdvancedAgent-70psk
linkStyle 11 stroke:#a170ff
DuckDuckGoSearch-m7u5j -.- AdvancedAgent-70psk
linkStyle 12 stroke:#a170ff
AdvancedAgent-70psk -.- LanggraphSupervisorAgent-wsqta
linkStyle 13 stroke:#a170ff
TelegramWebhook-u9hpu -.- LanggraphSupervisorAgent-wsqta
linkStyle 14 stroke:#a170ff
LanggraphSupervisorAgent-wsqta -.- TelegramMessage-7x695
linkStyle 15 stroke:#a170ff
OpenAIModel-w05yo -.- LanggraphSupervisorAgent-wsqta
linkStyle 16 stroke:#a170ff
OpenAIModel-lv5xv -.- AdvancedAgent-v75tq
linkStyle 17 stroke:#a170ff
OpenAIModel-pfy9p -.- AdvancedAgent-91o8w
linkStyle 18 stroke:#a170ff
OpenAIModel-cproi -.- AdvancedAgent-70psk
linkStyle 19 stroke:#a170ff
🧩 Overview
The Virtual Assistant is an end‑to‑end intelligent workflow that listens for user queries on Telegram, interprets the intent with a GPT‑4.1 model, and orchestrates a set of specialised agents to act on Gmail, Google Calendar, web search, and basic arithmetic. Each agent runs its own LLM instance and uses dedicated tools to carry out the required actions, returning a concise, context‑aware response that is finally sent back to the user through Telegram.
⚙️ Main Features
- Telegram integration – receives messages and sends replies in real time.
- Supervisor agent – acts as a dispatcher that selects the appropriate worker agent based on the user’s intent.
- Gmail agent – can retrieve, send, reply, delete, and mark emails.
- Calendar agent – creates, updates, retrieves, and deletes calendar events.
- Búsqueda agent – performs web searches with DuckDuckGo and evaluates arithmetic expressions via a calculator tool.
- Multi‑step orchestration – coordinates several agent calls sequentially when a single request involves multiple actions.
- Batch and parallel execution – each component supports batch mode and can run several instances in parallel.
- Fine‑tuned LLMs – each agent uses an OpenAI model (GPT‑4.1) with configurable parameters (temperature, token limits, etc.).
- Extensible toolset – new tools can be added to any agent via the “Tools” field.
🔄 Workflow Steps
| Component Name | Role in the Workflow | Key Inputs | Key Outputs |
|---|---|---|---|
| Telegram Webhook | Captures incoming Telegram messages and provides them to the system. | Raw Telegram payload (JSON). | Message – user text. |
| Supervisor Agent | Interprets user intent with GPT‑4.1, decides which worker agents to invoke, and aggregates results. | User message text. | Final answer text. |
| Gmail Agent | Handles all email‑related tasks (get, send, reply, delete, mark). | Intent‑derived parameters (e.g., mail ID, subject, body). | Email‑action confirmation or retrieved data. |
| Calendar Agent | Manages calendar events (create, get, update, delete). | Event details (title, start/end, attendees). | Confirmation of event operation or event list. |
| Búsqueda Agent | Performs web searches or calculations. | Search query or arithmetic expression. | Search results or calculation result. |
| Telegram Message | Sends the assistant’s final response back to the user. | Response text. | Delivered message in Telegram chat. |
| OpenAI LLM (Supervisor) | Provides the core reasoning engine for the supervisor. | None (internally used). | Trained GPT‑4.1 model instance. |
| OpenAI LLM (Gmail) | Generates prompts for Gmail operations and processes tool outputs. | None. | GPT‑4.1 model instance. |
| OpenAI LLM (Calendar) | Generates prompts for calendar operations and processes tool outputs. | None. | GPT‑4.1 model instance. |
| OpenAI LLM (Búsqueda) | Generates prompts for web searches or calculations and processes tool outputs. | None. | GPT‑4.1 model instance. |
| Gmail Mesage Component | Executes Gmail API calls (Send, Get, Reply, Delete, Mark). | Parameters specific to the chosen operation. | Result of the API call (e.g., email ID, status). |
| Google Calendar Component | Executes calendar API calls (Create, Get, Update, Delete). | Event data and operation type. | Result of the API call (e.g., event ID, confirmation). |
| DuckDuckGo Search | Performs a web search with a limited number of results. | Query string, max results. | List of search result snippets. |
| Calculator Tool | Evaluates an arithmetic expression. | Expression string. | Numerical result. |
🧠 Notes
- All API credentials (Gmail, Google Calendar, Telegram Bot, OpenAI, DuckDuckGo) must be configured in the corresponding component settings.
- The supervisor agent’s fallback model and retry settings are optional; enable them only if you require high availability.
- Batch mode is available on all components but is disabled by default; enable it when processing multiple requests in parallel.
- The system can be extended with additional agents or tools by adding them to the supervisor’s “agents” or a worker’s “tools” list.
- The LLMs are configured to use a low temperature (0.1) for deterministic responses; adjust if more creative output is desired.
- The workflow handles multi‑step actions: for example, a single user request can trigger an email retrieval, a calendar event creation, and a web search in a single turn.