# General Technical Guide

This guide provides technical documentation for setting up, understanding, and extending the **Digital Employee - Project Manager**.

The application have two main purposes:

* Automates **Minutes of Meeting (MoM)**. Below is the workflows:
  * **Minutes of Meeting (MoM)**
    * Reads meeting data from **Meemo** (Meemo MCP)
    * Sends MoM emails (Google Mail MCP)
    * Creates & shares Google Docs (Google Drive & Docs MCP)
    * Tracks processed meetings in Google Sheets (Google Sheets MCP)
  * **Meeting Scheduling**
    * Checks availability and creates events (Google Calendar MCP)
* Automates **Issue Reminder**. Below is the workflow:
  * Fetch Github issues from repository.
  * Send emails notification if the issue still open after due dates.
  * Escalate an issue to higher manager if it is still open after a period of time.
  * Track issue and email notification status.&#x20;

The MoM and Issue reminder worflow runs on a configurable **schedule** per project, while Meeting Scheduling is invoked on-demand.

***

## How to Setup

### **Prerequisites**

Before starting, ensure you have:

* **Python 3.11 or higher**
* **UV** package manager (**>= 0.6.15**) (required by `pyproject.toml`)
* **Google Cloud SDK** (optional; used by `Makefile` to authenticate to internal repositories when available)
* **Access to AIP** (for deployment) and the required MCP services (Meemo + Google MCPs)

### **Installation Steps**

1. **Clone the Repository:**

   <pre class="language-bash" data-line-numbers><code class="lang-bash">git clone https://github.com/GDP-ADMIN/digital-employee.git
   </code></pre>
2. **Go to the module directory**:

   <pre class="language-bash" data-line-numbers><code class="lang-bash">cd common/applications/digital-employee-pm
   </code></pre>
3. **Install dependencies**:

   <pre class="language-bash" data-line-numbers><code class="lang-bash">make install
   </code></pre>

   This runs `uv sync --extra dev`. If `gcloud` is installed, the Makefile also attempts to inject auth tokens for private package indexes.
4. **Configure environment variables**:

   Copy the example environment file and update with your MCP URLs, API keys, and per-project spreadsheet IDs. See [Environment Variables](#environment-variables) for detailed descriptions.

   <pre class="language-bash" data-line-numbers><code class="lang-bash">cp .env.example .env
   </code></pre>
5. **Run an agent locally (optional, for testing)**:

   <pre class="language-bash" data-line-numbers><code class="lang-bash"># Run a specific project agent
   make run AGENT=catapa

   # Other options
   make run AGENT=glair
   make run AGENT=dso
   make run AGENT=glc
   </code></pre>

### **Deployment**

1. **Agent deployment**\
   Agent deployment is handled by the Digital Employee team through Continuous Delivery (CD). This process registers the Digital Employee—along with its identity, tools, and configurations—on the AIP platform.
2. **Enable the agent in CATAPA Chat admin dashboard**

   1. Log in to the [CATAPA Chat](http://claudia.catapa.com/) admin dashboard
   2. Navigate to the [Application settings](https://claudia.catapa.com/admin/chatbot)
   3. Create or edit an application
   4. Add **DE Project Manager** as a supported agent in the application
   5. Click **Next** to save the configuration
   6. Manage user access to this application

   <figure><img src="https://2914931754-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXbRDlxflF58D1QG2tLmP%2Fuploads%2FyBPbEtU9L8JyAFABwoSn%2Fimage.png?alt=media&#x26;token=4d06e289-2163-472b-8921-7c5460692a26" alt=""><figcaption></figcaption></figure>
3. **Start using the agent**\
   You can now interact with the DE Project Manager via [CATAPA Chat](http://claudia.catapa.com/).

<figure><img src="https://2914931754-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXbRDlxflF58D1QG2tLmP%2Fuploads%2FvqgvjYLPzucxeKg4ULw1%2Fimage.png?alt=media&#x26;token=5f55bb41-f331-471e-b0d3-9275cf04122b" alt=""><figcaption></figcaption></figure>

***

## Agent Architecture Diagram

The Digital Employee PM uses a **single Digital Employee** per project. Each Digital Employee includes **3 sub-agents**:

* `mom_agent`
  * Custom tools for MoM handling (filtering meeting IDs, managing Drive permissions, converting Docs to HTML, filtering emails)
  * MCP connectors for **Meemo** and **Google Workspace**
  * One schedule that triggers the automated workflow.
* `scheduling_agent`
  * Custom tools for checking calendar availability and creating calendar events.
  * MCP connector for **Google Calendar**
* `issue_reminder_agent`
  * Custom tool to filter Github issues and sending email notification.
  * One schedule that triggers the automated workflow.

{% @mermaid/diagram content="flowchart TD
PM\["Project Manager Digital Employee"]
subgraph SubAgents\["Subagents"]
MomAgent\["mom\_agent"]
SchedulingAgent\["scheduling\_agent"]
IssueReminderAgent\["issue\_reminder\_agent"]
end
subgraph Tools\["Tools"]
FilterIdsTool\["filter\_unprocessed\_meeting\_ids\_tool"]
DrivePermTool\["create\_filtered\_drive\_permission\_tool"]
DocsToHtmlTool\["google\_docs\_to\_html\_tool"]
FilteredEmailTool\["send\_filtered\_email\_tool"]
IssueReminderTool\["issue\_reminder\_tool"]
TimeTool\["time\_tool"]
end
subgraph MCPs\["GL Connectors"]
Meemo\["meemo\_mcp"]
GCalendar\["google\_calendar\_mcp"]
GMail\["google\_mail\_mcp"]
GDocs\["google\_docs\_mcp"]
GDrive\["google\_drive\_mcp"]
GSheets\["google\_sheets\_mcp"]
end
Github\["Github REST API"]
Schedule\["Schedule"]
Cron\["Configurable cron schedules per project"]

PM --> SubAgents
PM --> MCPs
PM --> Schedule
PM --> DrivePermTool
PM --> DocsToHtmlTool
PM --> FilteredEmailTool
Schedule --> Cron
MomAgent --> Meemo
MomAgent --> FilterIdsTool
MomAgent --> TimeTool
SchedulingAgent --> GCalendar
SchedulingAgent --> TimeTool
IssueReminderAgent --> IssueReminderTool
FilteredEmailTool --> GMail
DrivePermTool --> GDrive
DocsToHtmlTool --> GDocs
IssueReminderTool --> GMail
IssueReminderTool --> GSheets
IssueReminderTool --> Github
PM --> GSheets" %}

The key idea is: **the “project” differences are configuration-only** (identity, email, environment suffix, custom cron schedules, and spreadsheet id).

## **Agent Description**

### **Project Manager Digital Employee (per project)**

* **Type**: Main deployed Digital Employee
* **Purpose**: Orchestrates three main workflows:
  * **Automated MoM workflow**: fetch → email → create docs → share → track processed meeting IDs
  * **Meeting Scheduling**: check calendar availability → create calendar events
  * **Remind Github Issue**: fetch github issues → check last reminder → send email reminder.
* **Model**: `GPT_5_2_MODEL_NAME` (from `digital_employee_core`)
* **Identity**: `Pamela✨ {full_project_name}`
* **Sub-agents**:
  * `mom_agent`: Retrieves meetings from Meemo and filters unprocessed IDs.
  * `scheduling_agent`: Checks calendar availability and creates calendar
  * `issue_reminder_agent`: Send an email reminder for unresolved GitHub issues.
* **Tools:**
  * `create_filtered_drive_permission_tool`: Creates Google Drive permissions with domain/email allowlist filtering.
  * `google_docs_to_html_tool`: Converts a Google Doc to HTML for downstream processing.
  * `send_filtered_email_tool`: send emails to recipients that fulfills the provided recipient email filters (e.g. only send to emails with `@gdplabs.id`).
  * `filter_unprocessed_meeting_ids_tool`: Filters out already processed meeting IDs.
  * `time_tool`: Provides time context if needed.
* **MCPs**:
  * `meemo_mcp`
  * `google_calendar_mcp`
  * `google_mail_mcp`
  * `google_docs_mcp`
  * `google_drive_mcp`
  * `google_sheets_mcp`
* **Schedules**:
  * One schedule item per deployed agent for MoM sub agent customized by `DEPM_SCHEDULE_*` env vars for that project.
  * One schedule item per deployed agent for Issue Reminder sub agent customized by `DEPM_GITHUB_ISSUE_REMINDER_SCHEDULE_*` env vars for that project.

#### **Tools Reference**

This project **composes** tools provided by `digital_employee_core` and MCP connectors:

<table data-full-width="false"><thead><tr><th width="341.3203125">Component</th><th>Purpose</th></tr></thead><tbody><tr><td><code>mom_agent</code></td><td>Uses Meemo + <code>filter_unprocessed_meeting_ids_tool</code> to retrieve unprocessed MoMs</td></tr><tr><td><code>scheduling_agent</code></td><td>Uses Google Calendar to check availability and create events</td></tr><tr><td><code>issue_reminder_agent</code></td><td>Uses <code>issue_reminder_tool</code> to check issue last reminder and send email reminder</td></tr><tr><td><code>send_filtered_email_tool</code></td><td>Uses Google Mail to send MoM emails</td></tr><tr><td><code>create_filtered_drive_permission_tool</code></td><td>Filters allowlisted domains and creates Docs folder permissions</td></tr><tr><td><code>google_docs_to_html_tool</code></td><td>Reads content in Google docs and formats it to HTML for email body</td></tr><tr><td><code>filter_unprocessed_meeting_ids_tool</code></td><td>Filters out already processed meeting IDs</td></tr><tr><td><code>time_tool</code></td><td>Provides time context if needed</td></tr><tr><td><code>meemo_mcp</code></td><td>Meeting data source (list meetings, details, summary/MoM)</td></tr><tr><td><code>google_calendar_mcp</code></td><td>Checking availability and scheduling meetings</td></tr><tr><td><code>google_mail_mcp</code></td><td>Sends email through Gmail</td></tr><tr><td><code>google_docs_mcp</code></td><td>Creates Google Docs for MoM documents</td></tr><tr><td><code>google_drive_mcp</code></td><td>Sharing permissions for created docs</td></tr><tr><td><code>google_sheets_mcp</code></td><td>Reads/writes processed meeting IDs in configured spreadsheet</td></tr></tbody></table>

***

#### Code Snippet

Below is the core function that creates a Project Manager Digital Employee instance (identity, configs, MCPs, schedule).

See the [full source code on GitHub](https://github.com/GDP-ADMIN/digital-employee/blob/main/common/applications/digital-employee-pm/digital_employee_pm/pm/agents/common.py).

```python
def create_digital_employee_pm(config: ProjectConfig) -> DigitalEmployee:
    _PM_JOB_INSTRUCTIONS = _PM_JOB_INSTRUCTIONS_FILE.read_text(encoding="utf-8")

    job = DigitalEmployeeJob(
        title=f"Pamela✨ {config.full_project_name}",
        description=f"A digital employee that is a Project Manager {config.full_project_name}",
        instruction=instructions,
    )

    identity = DigitalEmployeeIdentity(name=config.identity_name, email=config.email, job=job,)

    configurations = [
        DigitalEmployeeConfiguration(key="GOOGLE_CALENDAR_MCP_URL", value=GOOGLE_CALENDAR_MCP_URL),
        DigitalEmployeeConfiguration(key="MEEMO_MCP_URL", value=MEEMO_MCP_URL),
        *(DigitalEmployeeConfiguration(key=k, value=",".join(v)) for k, v in MCP_ALLOWED_TOOLS.items()),
        DigitalEmployeeConfiguration(key="MEEMO_MCP_X_API_KEY", value=get_meemo_api_key(config.project_key)),
        DigitalEmployeeConfiguration(key="GOOGLE_MAIL_MCP_URL", value=GOOGLE_MAIL_MCP_URL),
        DigitalEmployeeConfiguration(key="GOOGLE_DOCS_MCP_URL", value=GOOGLE_DOCS_MCP_URL),
        DigitalEmployeeConfiguration(key="GOOGLE_SHEETS_MCP_URL", value=GOOGLE_SHEETS_MCP_URL),
        DigitalEmployeeConfiguration(key="GOOGLE_DRIVE_MCP_URL", value=GOOGLE_DRIVE_MCP_URL),
        DigitalEmployeeConfiguration(key="GOOGLE_MCP_X_API_KEY", value=get_google_api_key(config.project_key)),
        DigitalEmployeeConfiguration(key="DEFAULT_RECIPIENT_FILTER", value=DEFAULT_RECIPIENT_FILTER),
    ]

    sub_agents = [
        create_mom_agent(name=f"mom_agent_{config.project_name}"),
        create_scheduling_agent(name=f"scheduling_agent_{config.project_name}", email=email),
        create_issue_reminder_agent(
            name=f"issue_reminder_agent_{config.project_name}",
            configuration={
                "github_pat": get_github_pat(config.project_key),
                "google_drive_mcp_url": GOOGLE_DRIVE_MCP_URL,
                "google_drive_mcp_x_api_key": get_google_api_key(config.project_key),
                "google_sheets_mcp_url": GOOGLE_SHEETS_MCP_URL,
                "google_sheets_mcp_x_api_key": get_google_api_key(config.project_key),
                "google_mail_mcp_url": GOOGLE_MAIL_MCP_URL,
                "google_mail_mcp_x_api_key": get_google_api_key(config.project_key),
                "repository_spreadsheet_id": get_repository_spreadsheet_id(config.project_key),
                "repository_spreadsheet_sheet_name": get_repository_spreadsheet_sheet_name(config.project_key),
                "organization_spreadsheet_id": get_organization_spreadsheet_id(config.project_key),
                "organization_spreadsheet_sheet_name": get_organization_spreadsheet_sheet_name(config.project_key),
                "state_spreadsheet_id": get_state_spreadsheet_id(config.project_key),
                "state_spreadsheet_sheet_name": get_state_spreadsheet_sheet_name(config.project_key),
                "depm_email": email,
                "project_name": config.project_name,
            },
        ),
    ]
    ]

    mom_schedule = ScheduleConfig(
        minute=get_schedule_minute(config.project_key),
        hour=get_schedule_hour(config.project_key),
        day_of_month=get_schedule_day_of_month(config.project_key),
        month=get_schedule_month(config.project_key),
        day_of_week=get_schedule_day_of_week(config.project_key),
    )

    mom_schedule_item = ScheduleItemConfig(
        schedule_config=mom_schedule,
        input=textwrap.dedent(
            f"""\
            Execute [Automated Workflow: MoM Generation with Google Sheets and Google Docs Integration]
            with the following parameters:
                spreadsheet_id: {spreadsheet_id}
            """
        ),
    )
    
    github_issue_reminder_schedule_item = ScheduleItemConfig(
        schedule_config=ScheduleConfig(**get_schedule_github_issue_reminder(config.project_key)),
        input=textwrap.dedent("Execute [Automated Workflow: GitHub Issue Reminder]"),
    )

    return DigitalEmployee(
        identity=identity,
        sub_agents=sub_agents,
        configurations=configurations,
        tools=[create_filtered_drive_permission_tool, google_docs_to_html_tool, send_filtered_email_tool],
        mcps=[
            google_calendar_mcp,
            google_drive_mcp,
            google_sheets_mcp,
            google_mail_mcp,
            google_docs_mcp,
            meemo_mcp,
        ],
        model=GPT_5_2_MODEL_NAME,
        schedules=[mom_schedule_item, github_issue_reminder_schedule_item],
        agent_config={
            "step_limit_config": StepLimitConfig(max_steps=AGENT_MAX_STEPS),
        },
    )
```

This function:

1. Validates required environment variables are set.
2. Loads job instructions from `pm_job.md` and dynamically formats it.
3. Builds a `DigitalEmployeeJob` and `DigitalEmployeeIdentity` (multi-language enabled).
4. Loads the required spreadsheet id from env (`MOM_SPREADSHEET_ID{_PROJECT}`).
5. Configures tool allowlists and attaches API keys to `DigitalEmployeeConfiguration`.
6. Configure `issue_reminder_agent`.
7. Attaches the `mom_agent`, `scheduling_agent`, and `issue_reminder_agent` sub-agents.
8. Create Schedule for sub-agents.
   1. Reads schedule parameters `DEPM_SCHEDULE_*` from environment variables to create the cron trigger for `mom_agent`.
   2. Reads schedule parameter `DEPM_GITHUB_ISSUE_REMINDER_SCHEDULE_*` from environment variables to create the cron trigger for `issue_reminder_agent`.
9. Returns an **undeployed** `DigitalEmployee` instance constrained by step limits.

**Usage Example**

Run a project agent module:

{% code lineNumbers="true" %}

```bash
uv run python -m digital_employee_pm.pm.agents.catapa
```

{% endcode %}

Or run via Makefile:

{% code lineNumbers="true" %}

```bash
make run AGENT=catapa
```

{% endcode %}

***

#### Environment Variables

This section describes all environment variables required to configure the Digital Employee PM.

**AIP Configuration**

GDP Labs [AI Agents Package (AIP)](https://gdplabs.gitbook.io/gl-aip/getting-started/quick-start-guide/local-vs-remote#remote-mode) is the platform where the Digital Employee is deployed.

| Variable      | Description                      |
| ------------- | -------------------------------- |
| `AIP_API_URL` | Base URL of the AIP platform API |
| `AIP_API_KEY` | API key for authenticating AIP   |

**MCP Base URLs (shared, no suffix)**

| Variable                  | Description                      |
| ------------------------- | -------------------------------- |
| `MEEMO_MCP_URL`           | Base URL for Meemo MCP           |
| `GOOGLE_CALENDAR_MCP_URL` | Base URL for Google Calendar MCP |
| `GOOGLE_MAIL_MCP_URL`     | Base URL for Google Mail MCP     |
| `GOOGLE_DOCS_MCP_URL`     | Base URL for Google Docs MCP     |
| `GOOGLE_SHEETS_MCP_URL`   | Base URL for Google Sheets MCP   |
| `GOOGLE_DRIVE_MCP_URL`    | Base URL for Google Drive MCP    |

**Project-Specific Keys (with suffix)**

`project_key` determines the suffix for env var names. For `project_key="CATAPA"` → suffix is `_CATAPA`

| Variable pattern                                            | Description                                                                                          |
| ----------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| `DEPM_EMAIL{_PROJECT}`                                      | **Required:** Employee email address (e.g. DEPM\_EMAIL\_CATAPA)                                      |
| `MEEMO_MCP_X_API_KEY{_PROJECT}`                             | Meemo MCP API key for the project                                                                    |
| `GOOGLE_MCP_X_API_KEY{_PROJECT}`                            | **Required**: Google MCP API key for the project                                                     |
| `MOM_SPREADSHEET_ID{_PROJECT}`                              | **Required:** Google sheets ID for processed meeting storage                                         |
| `GITHUB_PAT{_PROJECT}`                                      | **Required:** Github Personal Access Token with read access to issues.                               |
| `REPOSITORY_SPREADSHEET_ID{_PROJECT}`                       | **Required:** Google Spreadsheet ID with list of repository maintained by each project.              |
| `REPOSITORY_SPREADSHEET_SHEET_NAME{_PROJECT}`               | **Required:** Google Spreadsheet sheet name with list of repository maintained by each project.      |
| `ORGANIZATION_SPREADSHEET_ID{_PROJECT}`                     | **Required:** Google Spreadsheet ID with list of organization structure and Github username.         |
| `ORGANIZATION_SPREADSHEET_SHEET_NAME{_PROJECT}`             | **Required:** Google Spreadsheet sheet name with list of organization structure and Github username. |
| `STATE_SPREADSHEET_ID{_PROJECT}`                            | **Required:** Google Spreadsheet ID to store the notification state and history.                     |
| `STATE_SPREADSHEET_SHEET_NAME{_PROJECT}`                    | **Required:** Google Spreadsheet sheet name to store the notification state and history.             |
| `DEPM_SCHEDULE_MINUTE{_PROJECT}`                            | Schedule Minute setting for the `mom_agent` Cron                                                     |
| `DEPM_SCHEDULE_DAY_OF_WEEK{_PROJECT}`                       | Schedule Day of Week setting for the `mom_agent` Cron                                                |
| `DEPM_GITHUB_ISSUE_REMINDER_SCHEDULE_MINUTE{_PROJECT}`      | Schedule Minute setting for the `issue_reminder_agent` Cron                                          |
| `DEPM_GITHUB_ISSUE_REMINDER_SCHEDULE_HOUR{_PROJECT}`        | Schedule Hour setting for the `issue_reminder_agent` Cron                                            |
| `DEPM_GITHUB_ISSUE_REMINDER_SCHEDULE_DAY_OF_WEEK{_PROJECT}` | Schedule Day of Week setting for the `issue_reminder_agent` Cron                                     |

> There are also configuration sets for `HOUR`, `DAY_OF_MONTH`, and `MONTH` per `<PROJECT_KEY>` for scheduling.

Concrete examples (from `.env.example`):

* `MEEMO_MCP_X_API_KEY_CATAPA`
* `GOOGLE_MCP_X_API_KEY_GLAIR`
* `MOM_SPREADSHEET_ID_DSO`

**Tool Configs**

| Variable                   | Description                                           |
| -------------------------- | ----------------------------------------------------- |
| `DEFAULT_RECIPIENT_FILTER` | Default recipient filter for Send Filtered Email Tool |
| `AGENT_MAX_STEPS`          | Maximum steps allowed for the agent to execute        |

***

## References

* [DE Project Manager User Guide](https://gdplabs.gitbook.io/catapa/digital-employee/list-of-de/pamela-de-project-manager/user-guide)
* [GitHub Repository](https://github.com/GDP-ADMIN/digital-employee/tree/main/common/applications/digital-employee-pm)
