AI Agent: Google Calendar Assistant
A secretary-type assistant that manages your events, gives you summaries, and stores your agenda in Sheets.
đź§© Overview
The workflow is an AI‑powered “Secretary Assistant” that automatically retrieves Google Calendar events, summarizes them, records the information into a Google Sheet, and delivers the result through a chat interface. By integrating prompt engineering, LLM reasoning, vector‑search, and spreadsheet manipulation, it streamlines event management and reduces manual entry.
⚙️ Main Features
- Retrieves events from a specified Google Calendar.
- Transforms event data into natural‑language summaries.
- Searches a vector database for relevant event context.
- Generates a concise, user‑friendly response via chat.
- Records event details in Google Sheets with a predefined header layout.
🔄 Workflow Steps
| Component Name | Role in the Workflow | Key Inputs | Key Outputs |
|---|---|---|---|
| Momento a comprobar | Provides the user‑specified moment (e.g., “mañana”) that scopes the event search. | Text “mañana” | Text “mañana” |
| Tema a comprobar | Provides the event category (e.g., “Daily”) used in the prompt template. | Text “Daily” | Text “Daily” |
| Instrucciones (Prompt) | Builds a dynamic prompt containing the moment, theme, and event data extracted from the calendar. | Moment, Theme, Event Text | Prompt message |
| Google Calendar Assistant (Obtener Eventos) | Fetches events from the selected Google Calendar. | Calendar selection, operation “Get” | Calendar event data |
| Obtener Datos de evento (ParseData) | Formats raw calendar data into a structured document. | Calendar event data | Structured event data |
| Language Recursive Text Splitter | Splits event documents into chunks suitable for embeddings. | Structured event data | Chunked data |
| Subir a DB (Chroma) | Stores chunks in a vector database, creating embeddings for future search. | Chunked data, embeddings | Stored vector entries |
| OpenAI Embeddings | Generates embeddings for the event chunks. | Chunked data | Embedding vectors |
| Cargar de DB (Chroma) | Retrieves relevant event chunks from the vector store using a search query. | Search query, embeddings | Retrieved event chunks |
| Obtener Texto (ParseData) | Formats retrieved event chunks into plain text for the prompt. | Retrieved chunks | Plain‑text event description |
| OpenAI Model (OpenAI) | Provides the LLM used by the agent. | Model name, system prompt | LLM instance |
| Langgraph React Agent | Orchestrates the conversation, invokes the LLM and any tools, and produces a chat reply. | Prompt message, LLM, tools | Chat response |
| Registrar en Agenda de Citas (GSheetCellComponent) | Adds a new row to the Google Sheet with event details (name, date, status). | Chat response, event data | Spreadsheet update |
| Chat Output | Displays the agent’s reply to the user. | Chat response | Chat message displayed |
The components are executed in the sequence shown above, with data flowing from left to right according to the edge connections.
đź§ Notes
- The Google Calendar component requires a valid OAuth 2.0 credential configured for the
googleCalendarprovider. - The Google Sheet component expects the target sheet to contain a header row with the columns “Info de la cita”, “Fecha”, and “Estado”.
- The Chroma vector store is configured with the collection name
nappaiand persists in thecalendar_assistantdirectory. - Embedding generation uses the
text-embedding-3-smallmodel by default; this can be tuned for higher‑dimensional vectors if required. - The prompt template limits responses to only the required fields, prompting the LLM for clarification if the input is ambiguous.
- The workflow assumes that the user’s “moment” and “theme” inputs are coherent with the calendar’s event data to avoid empty search results.
- Debugging can be performed by enabling verbose logging on the Langgraph agent (
Verbose = true). - All components respect the Mapping Mode flag; batch processing is supported if the flag is set, though the current layout uses single‑record mode.
This documentation provides a concise, functional view of the AI assistant’s workflow while keeping the technical details abstracted.