> For the complete documentation index, see [llms.txt](https://docs.snapfix.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.snapfix.com/engineering-reference/db/tables/ai_task_user_activity.md).

# ai\_task\_user\_activity

{% hint style="info" %}
Generated from the staging database schema, with descriptions drafted by agents ([how to read these docs](https://docs.snapfix.com/how-to-read.md)). [Source on GitHub](https://github.com/snapfix/docs/blob/main/spec/db/tables/ai_task_user_activity.md).
{% endhint %}

## Description

One user's newest task chat message time and newest sign-in time, which aitask\_pyserver's assignee suggestions pass to the model.

<details>

<summary><strong>Table Definition</strong></summary>

```sql
CREATE TABLE `ai_task_user_activity` (
  `uuid_tUser` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `last_active_at` datetime DEFAULT NULL,
  `last_login_at` datetime DEFAULT NULL,
  `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`uuid_tUser`) USING BTREE,
  KEY `idx_activity_last_active_at` (`last_active_at`) USING BTREE,
  KEY `idx_activity_last_login_at` (`last_login_at`) USING BTREE,
  KEY `idx_activity_updated_at` (`updated_at`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC
```

</details>

## Columns

| Name             | Type        | Default            | Nullable | Extra Definition                                | Comment                                                                                                                                                                                           |
| ---------------- | ----------- | ------------------ | -------- | ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| uuid\_tUser      | varchar(64) |                    | false    |                                                 |                                                                                                                                                                                                   |
| last\_active\_at | datetime    |                    | true     |                                                 | Time of the user's newest task chat message (tPri\_JobChat). 1,354 of the 1,773 staging rows hold a date before 2000, because the seeder copies millisecond timestamps into this DATETIME column. |
| last\_login\_at  | datetime    |                    | true     |                                                 |                                                                                                                                                                                                   |
| updated\_at      | datetime    | CURRENT\_TIMESTAMP | false    | DEFAULT\_GENERATED on update CURRENT\_TIMESTAMP |                                                                                                                                                                                                   |

## Viewpoints

| Name                                                                           | Definition                                                                                                                                             |
| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [ai](https://docs.snapfix.com/engineering-reference/db/tables/viewpoint-17.md) | Snapfix AI and AI suggestions: agent sessions and messages, brand documents, task insight and title-style data, token usage, the AI job log and queue. |

## Constraints

| Name    | Type        | Definition                |
| ------- | ----------- | ------------------------- |
| PRIMARY | PRIMARY KEY | PRIMARY KEY (uuid\_tUser) |

## Indexes

| Name                            | Definition                                                         |
| ------------------------------- | ------------------------------------------------------------------ |
| idx\_activity\_last\_active\_at | KEY idx\_activity\_last\_active\_at (last\_active\_at) USING BTREE |
| idx\_activity\_last\_login\_at  | KEY idx\_activity\_last\_login\_at (last\_login\_at) USING BTREE   |
| idx\_activity\_updated\_at      | KEY idx\_activity\_updated\_at (updated\_at) USING BTREE           |
| PRIMARY                         | PRIMARY KEY (uuid\_tUser) USING BTREE                              |

## Relations

```mermaid
erDiagram


"ai_task_user_activity" {
  varchar_64_ uuid_tUser PK
}
```

***

> Generated by [tbls](https://github.com/k1LoW/tbls)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.snapfix.com/engineering-reference/db/tables/ai_task_user_activity.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
