> For the complete documentation index, see [llms.txt](https://dev.guardian.hedera.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dev.guardian.hedera.com/api-reference-guardian/platform/ai-suggestions.md).

# AI Suggestions

AI-powered recommendations for policies, schemas, and workflows.

## Get methodology suggestion

> Returns AI response to the current question

```json
{"openapi":"3.2.0","info":{"title":"Guardian","version":"3.7.1-rc"},"tags":[{"name":"ai-suggestions","description":"AI-powered recommendations for policies, schemas, and workflows.","parent":"platform"}],"servers":[{"url":"/api/v1","description":"version 1.0"}],"paths":{"/ai-suggestions/ask":{"get":{"description":"Returns AI response to the current question","operationId":"AISuggestionsAPI_getAIAnswer","parameters":[{"name":"q","required":true,"in":"query","description":"The question of choosing a methodology","schema":{"type":"string"}}],"responses":{"200":{"description":"Successful operation. Returns a comma-separated list of suggested methodology codes.","content":{"application/json":{"schema":{"type":"string"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDTO"}}}}},"summary":"Get methodology suggestion","tags":["ai-suggestions"]}}},"components":{"schemas":{"InternalServerErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"]}}}}
```

## Rebuild AI vector

> Rebuilds vector based on policy data in the DB

```json
{"openapi":"3.2.0","info":{"title":"Guardian","version":"3.7.1-rc"},"tags":[{"name":"ai-suggestions","description":"AI-powered recommendations for policies, schemas, and workflows.","parent":"platform"}],"servers":[{"url":"/api/v1","description":"version 1.0"}],"paths":{"/ai-suggestions/rebuild-vector":{"put":{"description":"Rebuilds vector based on policy data in the DB","operationId":"AISuggestionsAPI_rebuildVector","parameters":[],"responses":{"200":{"description":"Successful operation. Returns true when vector rebuild is complete.","content":{"application/json":{"schema":{"type":"boolean"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDTO"}}}}},"summary":"Rebuild AI vector","tags":["ai-suggestions"]}}},"components":{"schemas":{"InternalServerErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"]}}}}
```

## Returns whether Glossary AI is enabled

> Lets the client know upfront whether it should show the Glossary AI schema-tagging UI at all.

```json
{"openapi":"3.2.0","info":{"title":"Guardian","version":"3.7.1-rc"},"tags":[{"name":"ai-suggestions","description":"AI-powered recommendations for policies, schemas, and workflows.","parent":"platform"}],"servers":[{"url":"/api/v1","description":"version 1.0"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"UnauthorizedErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"]},"ForbiddenErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"},"error":{"type":"string"}},"required":["statusCode","message"]}}},"paths":{"/ai-suggestions/schema-properties/enabled":{"get":{"description":"Lets the client know upfront whether it should show the Glossary AI schema-tagging UI at all.","operationId":"AISuggestionsAPI_getGlossaryAiEnabled","parameters":[],"responses":{"200":{"description":"Successful operation.","content":{"application/json":{"schema":{"type":"boolean"}}}},"401":{"description":"Unauthorized request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedErrorDTO"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenErrorDTO"}}}}},"summary":"Returns whether Glossary AI is enabled","tags":["ai-suggestions"]}}}}
```

## Suggest schema field properties

> Returns ranked IWA property candidates for each schema field

```json
{"openapi":"3.2.0","info":{"title":"Guardian","version":"3.7.1-rc"},"tags":[{"name":"ai-suggestions","description":"AI-powered recommendations for policies, schemas, and workflows.","parent":"platform"}],"servers":[{"url":"/api/v1","description":"version 1.0"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"PropertySuggestionRequestDTO":{"type":"object","properties":{"schemaId":{"type":"string","description":"Id of the schema the field(s) needing a suggestion belong to"},"fieldNames":{"description":"Names of the schema fields to return suggestions for","type":"array","items":{"type":"string"}}},"required":["schemaId","fieldNames"]},"PropertySuggestionResponseDTO":{"type":"object","properties":{"available":{"type":"boolean"},"results":{"type":"array","items":{"$ref":"#/components/schemas/PropertySuggestionResultDTO"}}},"required":["available","results"]},"PropertySuggestionResultDTO":{"type":"object","properties":{"fieldName":{"type":"string"},"candidates":{"type":"array","items":{"$ref":"#/components/schemas/PropertySuggestionCandidateDTO"}}},"required":["fieldName","candidates"]},"PropertySuggestionCandidateDTO":{"type":"object","properties":{"title":{"type":"string"},"confidence":{"type":"number"},"rationale":{"type":"string"}},"required":["title","confidence","rationale"]},"UnauthorizedErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"]},"ForbiddenErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"},"error":{"type":"string"}},"required":["statusCode","message"]},"InternalServerErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"]}}},"paths":{"/ai-suggestions/schema-properties":{"post":{"description":"Returns ranked IWA property candidates for each schema field","operationId":"AISuggestionsAPI_getPropertySuggestions","parameters":[],"requestBody":{"required":true,"description":"Schema fields to tag.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PropertySuggestionRequestDTO"}}}},"responses":{"200":{"description":"Successful operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PropertySuggestionResponseDTO"}}}},"401":{"description":"Unauthorized request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedErrorDTO"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenErrorDTO"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDTO"}}}}},"summary":"Suggest schema field properties","tags":["ai-suggestions"]}}}}
```
