> 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/log_ai_job.md).

# log\_ai\_job

{% 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/log_ai_job.md).
{% endhint %}

## Description

One AI suggestion event on a task, by category, with the suggested value or the value the user chose instead; aitask\_pyserver reads the title rows to learn title style.

<details>

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

```sql
CREATE TABLE `log_ai_job` (
  `id` int NOT NULL AUTO_INCREMENT,
  `uuid` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `uuid_tJob` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `category` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'group, title, assignee, tag-ex, tag-new, room, area',
  `suggestion` json DEFAULT NULL,
  `overwritten` json DEFAULT NULL,
  `fCreatedTs` bigint DEFAULT NULL,
  `fModifiedTs` bigint DEFAULT NULL,
  `fServerTs` bigint DEFAULT NULL,
  `uuid_tUser_CreatedBy` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `uuid_tUser_ModifiedBy` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_uuid_tJob` (`uuid_tJob`),
  KEY `idx_log_ai_job_category_id` (`category`,`id` DESC),
  KEY `idx_log_ai_job_category_id_job` (`category`,`id`,`uuid_tJob`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
```

</details>

## Columns

| Name                    | Type         | Default | Nullable | Extra Definition | Comment                                                                                                  |
| ----------------------- | ------------ | ------- | -------- | ---------------- | -------------------------------------------------------------------------------------------------------- |
| id                      | int          |         | false    | auto\_increment  |                                                                                                          |
| uuid                    | varchar(255) |         | true     |                  |                                                                                                          |
| uuid\_tJob              | varchar(255) |         | true     |                  |                                                                                                          |
| category                | varchar(255) |         | true     |                  | area, assignee, group, room, tag-ex, tag-new or title.                                                   |
| suggestion              | json         |         | true     |                  | JSON of what the AI suggested; NULL when the row records a user change.                                  |
| overwritten             | json         |         | true     |                  | JSON of the value the user set over an AI suggestion, such as the new area, room, tag or assignee UUIDs. |
| fCreatedTs              | bigint       |         | true     |                  |                                                                                                          |
| fModifiedTs             | bigint       |         | true     |                  |                                                                                                          |
| fServerTs               | bigint       |         | true     |                  |                                                                                                          |
| uuid\_tUser\_CreatedBy  | varchar(255) |         | true     |                  |                                                                                                          |
| uuid\_tUser\_ModifiedBy | varchar(255) |         | true     |                  |                                                                                                          |

## 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 (id) |

## Indexes

| Name                                 | Definition                                                                      |
| ------------------------------------ | ------------------------------------------------------------------------------- |
| idx\_log\_ai\_job\_category\_id      | KEY idx\_log\_ai\_job\_category\_id (category, id) USING BTREE                  |
| idx\_log\_ai\_job\_category\_id\_job | KEY idx\_log\_ai\_job\_category\_id\_job (category, id, uuid\_tJob) USING BTREE |
| idx\_uuid\_tJob                      | KEY idx\_uuid\_tJob (uuid\_tJob) USING BTREE                                    |
| PRIMARY                              | PRIMARY KEY (id) USING BTREE                                                    |

## Relations

```mermaid
erDiagram


"log_ai_job" {
  int id 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/log_ai_job.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.
