> ## Documentation Index
> Fetch the complete documentation index at: https://docs.intelligence-management-platform.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Prompt library

> The prompt_library_item type stores a reusable prompt template that can be shared across agents and users.

export const EditionBadge = ({edition}) => <Tooltip tip={edition === "ee" ? "Requires an Enterprise Edition license." : "Available in the Community Edition."}>
    <span style={{
  fontFamily: "RobotoMono, monospace",
  fontSize: "12px",
  textTransform: "uppercase",
  letterSpacing: "0.04em",
  border: "1px solid var(--imp-hair-light)",
  padding: "2px 8px"
}}>
      {edition === "ee" ? "Enterprise" : "Community"}
    </span>
  </Tooltip>;

`prompt_library_item` records are named prompt templates available to users in the chat prompt picker and to administrators when configuring agent instructions. See [Building prompts](/building/prompts) for product context.

```graphql theme={null}
type prompt_library_item {
  name: String!
  description: String
  content: String!
  tags: JSON
  usage_count: Float
  favorite_count: Float
  assigned_agents: JSON
  history: JSON
  last_processed_at: Date
  embeddings_updated_at: Date
  rights_mode: String
  created_by: Float!
  createdAt: Date
  updatedAt: Date
  id: ID!
  RBAC: RBACData
}
```

## Field notes

| Field                   | Notes                                                                                                    |
| ----------------------- | -------------------------------------------------------------------------------------------------------- |
| `content`               | The prompt text; may include `{{variable}}` placeholders that are filled in at usage time.               |
| `tags`                  | JSON string array for categorisation and filtering in the prompt picker.                                 |
| `assigned_agents`       | JSON array of agent IDs this prompt is pre-assigned to; these agents display the prompt as a suggestion. |
| `history`               | JSON array of previous versions of `content`, maintained automatically on each save.                     |
| `usage_count`           | Incremented each time the prompt is sent from the chat picker.                                           |
| `favorite_count`        | Number of `prompt_favorite` records pointing at this item.                                               |
| `rights_mode`           | `"public"` or `"private"`; private prompts are scoped via `RBAC`.                                        |
| `created_by`            | Numeric ID of the creating user.                                                                         |
| `last_processed_at`     | Timestamp of the last knowledge-embedding pass over this record.                                         |
| `embeddings_updated_at` | Timestamp when vector embeddings were last regenerated.                                                  |

## Example query

```graphql theme={null}
query {
  prompt_libraryPagination(
    limit: 20
    filters: [{ tags: { contains: "support" } }]
    sort: { field: "usage_count", direction: DESC }
  ) {
    items {
      id
      name
      description
      content
      tags
      usage_count
    }
    pageInfo {
      currentPage
      hasNextPage
    }
  }
}
```
