Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions content/configuration/translations.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ Throughout the Data Studio, click the :icon{name="material-symbols:translate"} i

![Translations interface showing text in American English and German.](/img/3e9a8108-169f-4df8-988b-e966b3809d1b.webp)

Content translations are used to translate the content of the database, which can be served via API to your external applications. The built-in translations interface handles much of the complexity in managing your data model for multilingual content.
Content translations are used to translate the content of the database, which can be served via API to your external applications. The built-in translations interface handles much of the complexity in managing your data model for multilingual content.

The `languages` collection will be automatically created when you add your first translations field. It contains each language you support, with a `code` and `direction` field (some languages are written right-to-left).
The recommended way to set up content translations is with the **Generate Translations** wizard in collection settings. It automatically creates the languages collection, translations junction collection, relationships, and alias field in one step. See the [Content Translations guide](/guides/content/translations#quick-setup-with-generate-translations) for a walkthrough.

The field will also create a new collection-specific collection for translated content, for example `articles_translations`. Add fields you wish to translate to this collection, and they will be displayed in the translations interface.
You can also set up translations manually. The `languages` collection will be automatically created when you add your first translations field. It contains each language you support, with a `code` and `direction` field (some languages are written right-to-left). The field will also create a new collection-specific collection for translated content, for example `articles_translations`. Add fields you wish to translate to this collection, and they will be displayed in the translations interface.

4 changes: 4 additions & 0 deletions content/guides/01.data-model/4.relationships.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,8 @@ Read our tutorial on using a Builder (M2A) to create reusable page components.

When you create a Translations interface in Directus, a translations O2M `Alias` field is created, as well as a `languages` collection and a junction collection between your main collection and `languages`. All translated text is stored in the junction collection.

::callout{icon="material-symbols:auto-fix-high" color="secondary" to="/guides/content/translations#quick-setup-with-generate-translations"}
Use the **Generate Translations** wizard in collection settings to automatically create the full translations infrastructure — languages collection, junction collection, relationships, and fields — in one step.
::

:video-embed{video-id="2d192e76-378b-4540-9d41-2506460a50af"}
46 changes: 42 additions & 4 deletions content/guides/02.content/7.translations.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,54 @@ You can also click ":icon{name="material-symbols:add-circle-rounded"} New Transl

:video-embed{video-id="0e2eaf09-d3e4-4cca-97c8-e38e833c731f"}

With Directus, you can localize your content into several languages using a [translations field](/guides/data-model/relationships) on a given collection.
With Directus, you can localize your content into several languages using a [translations field](/guides/data-model/relationships) on a given collection. Directus provides a built-in wizard to automatically generate the full translations infrastructure, or you can set it up manually.

### Quick Setup with Generate Translations

Directus can automatically create all the collections, fields, and relationships needed for content translations.

![Translations section in collection settings showing Enable Translations button](/img/generate-translations-enable-button.png)

1. Navigate to **Settings > Data Model** and select the collection you want to translate.
2. In the collection settings, find the **Translations** section.
3. Click **Enable Translations**.
4. In the dialog, select the fields you want to make translatable.
5. Click **Enable** to generate the translations infrastructure.

![Generate Translations dialog with field picker](/img/generate-translations-field-picker.png)

This will automatically create:

- A **languages** collection (if one doesn't already exist), pre-populated with common languages (English, Arabic, German, French, Russian, Spanish, Italian, and Portuguese).
- A **translations junction collection** (e.g. `articles_translations`) containing the selected fields.
- The necessary **relationships** and a **translations alias field** on the source collection.

::callout{icon="material-symbols:settings-outline"}
**Advanced Options**
Expand the advanced section in the dialog to customize the translations collection name, languages collection, and foreign key field names.
::

#### Adding More Translatable Fields

Once translations are enabled, you can add more fields at any time.

1. Return to **Settings > Data Model** and select the collection.
2. In the **Translations** section, click **Add Fields**.
3. Select additional fields and save.

![Adding more translatable fields to an existing translations collection](/img/generate-translations-add-fields.png)

### Manual Setup

You can also set up translations manually by creating the required collections and relationships yourself.

![Creating a translations field](/img/3097a653-da4f-449a-a5d5-4dcf62da73bd.webp)

Once this field is added to a collection, a few new collections will be created. One being a pre-populated `languages` collection, as well as a hidden `<colletion-name>_translations` collection.
Add a translations O2M alias field to your collection. This will create a pre-populated `languages` collection, as well as a hidden `<collection>_translations` collection.

In the "Data Model" section of the settings module, navigate into the `<colletion-name>_translations` collection and add the fields which you'd like to translate.
In the "Data Model" section of the settings module, navigate into the `<collection>_translations` collection and add the fields which you'd like to translate.

![Post translations collection showing it has a title and content field added](/img/ec059ce9-ece1-4353-8844-7e557a4556c4.webp)

Now, when [editing an item](/guides/content/editor) of that collection, you'll be able to add translations for those fields.

![Creating a post with a title in both Spanish and English](/img/774ac37b-1c9e-433b-80ba-deededd8e406.webp)
Expand Down
2 changes: 2 additions & 0 deletions content/guides/10.ai/1.assistant/0.index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Directus AI Assistant is an embedded conversational assistant that helps you int
- **Content Management**: Create, update, and organize items across your collections
- **Schema Operations**: Explore your data model, add new fields and collections
- **Flow Automation**: Create new Flows and trigger them manually
- **File Attachments**: Upload images, documents, audio, and video for AI analysis
- **Data Exploration**: Query your data and understand your schema structure

## Supported Models
Expand Down Expand Up @@ -64,6 +65,7 @@ Have feedback or feature requests? [Submit on our roadmap](https://roadmap.direc

- **Tool Approval**: All tools require approval by default. [Configure per-tool settings](/guides/ai/assistant/tools#tool-behavior).
- **Uses Your Permissions**: The AI operates with your existing Directus role and access policies.
- **File Attachments**: Upload files or select from your library. Supports images, PDFs, text, audio, and video up to 50MB.
- **Streaming Responses**: Responses stream in real-time. Stop or retry at any time.

::callout{icon="material-symbols:warning" color="warning"}
Expand Down
4 changes: 4 additions & 0 deletions content/guides/10.ai/1.assistant/1.setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ In addition to the built-in providers, Directus supports any OpenAI-compatible A
**For best results, use built-in cloud providers.** Local models vary significantly in their tool-calling capabilities and may produce inconsistent results. If using OpenAI-compatible providers, we recommend cloud-hosted frontier models over locally-run models on personal hardware.
::

::callout{icon="material-symbols:info" color="info"}
**File attachments are not supported with OpenAI-compatible providers.** [File uploads](/guides/ai/assistant/usage#files) require a built-in provider (OpenAI, Anthropic, or Google). The file attachment buttons are hidden when an OpenAI-compatible model is selected.
::

![OpenAI Compatible Provider Settings](/img/ai-settings-openai-compat.png)

### Configuration
Expand Down
46 changes: 45 additions & 1 deletion content/guides/10.ai/1.assistant/2.usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,49 @@ When using the [Visual Editor](/guides/content/visual-editor/studio-module), you
Visual element context persists while navigating within the Visual Editor but clears when leaving the module.
::

### Files

Upload files or select existing assets from your File Library to include as context. The AI can analyze images, read documents, and process audio and video.

![Context menu showing Upload File and File Library buttons](/img/ai-assistant-context-menu-files.png)

Two options are available when a built-in provider (OpenAI, Anthropic, or Google) is selected:

- **Upload File** — Select files from your local machine
- **File Library** — Browse and select existing assets from Directus

You can also drag and drop files directly onto the conversation area.

<video title="Drag and drop files onto the AI Assistant conversation" autoplay playsinline muted loop controls class="rounded-md">
<source src="/docs/video/ai-assistant-file-drag-drop.mp4" type="video/mp4" />
</video>

#### Supported File Types

| Category | Types |
|----------|-------|
| Images | JPEG, PNG, GIF, WebP |
| Documents | PDF, Plain Text |
| Audio | MP3, WAV |
| Video | MP4 |

Maximum file size is 50MB. Files are uploaded to your AI provider when the message is sent.

::callout{icon="material-symbols:info" color="info"}
**File attachments require a built-in provider.** OpenAI-compatible providers do not support file uploads. See [Setup](/guides/ai/assistant/setup#openai-compatible-providers) for details.
::

::callout{icon="material-symbols:warning" color="warning"}
**Google file uploads expire after approximately 24 hours.** If you start a new conversation, you may need to re-upload files previously sent to Google.
::

### Pending Context Bar

![Pending context bar with staged items](/img/ai-assistant-pending-context.png)

Selected context appears in a horizontal bar above the input. Each card shows an icon and display name—click the **x** to remove. You can add up to 10 context items per message.
![Pending context bar with staged items and file thumbnails](/img/ai-assistant-pending-context.png)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this image is a duplicate of the one directly above it. Maybe you meant to put /img/ai-assistant-context-menu-files.png here?


Selected context appears in a horizontal bar above the input. Each card shows an icon and display name—click the **x** to remove. Image files show a thumbnail preview, while other file types show a file icon. You can add up to 10 context items per message.

## Understanding Responses

Expand All @@ -97,6 +135,12 @@ When the AI performs an action, it displays a tool call card showing:
- Input parameters
- Results after execution

### File References

![AI response showing an uploaded image inline](/img/ai-assistant-file-response.png)

When the AI references uploaded files in its response, images display inline and can be clicked to open in a lightbox viewer. Non-image files appear as compact cards with a file icon and filename.

## Tool Approval

All tools require approval by default. When a tool needs approval, review the action then choose **Approve**, **Deny** (Esc), or **Always Allow**.
Expand Down
23 changes: 23 additions & 0 deletions content/guides/10.ai/1.assistant/4.tips.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ Context attachments help the AI understand what you're working with. See [Adding
- Comparing or batch-processing content
- Making AI-assisted edits in the Visual Editor
- Using prompts to maintain consistent formatting
- Asking the AI to analyze or describe images
- Providing reference documents (PDFs, text files) for content tasks
- Sharing audio or video files for transcription or analysis

**Keep in mind:**
- Maximum 10 context items per message
Expand All @@ -62,6 +65,12 @@ Context attachments help the AI understand what you're working with. See [Adding
- Hover context cards to verify you've selected the right elements
- Add elements from different pages—context persists while navigating

**File attachment tips:**
- Use drag-and-drop for quick uploads from your desktop
- Select from the File Library when referencing existing assets
- Image files show previews; other types show a file icon
- Files are uploaded to your AI provider — review [Security](/guides/ai/assistant/security) for data handling details

### Context Example Prompts

**With Prompts attached:**
Expand Down Expand Up @@ -98,6 +107,20 @@ Make this paragraph more concise while keeping the key points
Rewrite this heading to be more engaging
```

**With Files attached:**

```
Describe what's in this image
```

```
Summarize the key points from this PDF
```

```
Transcribe this audio recording
```

## Manage Costs

AI Assistant requires API keys from OpenAI or Anthropic — you cannot use a ChatGPT Plus or Claude Pro subscription. API access is billed per token, so costs scale with usage. Be mindful of this, especially with larger models.
Expand Down
7 changes: 5 additions & 2 deletions content/guides/10.ai/1.assistant/5.security.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,17 @@ The AI operates with your existing Directus permissions - if you can't access a

## Data Sent to AI Providers

Your messages, schema information, item data, and tool responses are sent to the configured provider (OpenAI or Anthropic).
Your messages, schema information, item data, and tool responses are sent to the configured provider (OpenAI, Anthropic, or Google).

**File uploads:** When you attach files to a conversation, they are uploaded directly to your configured AI provider's file storage. Google file uploads expire after approximately 24 hours. Review your provider's data retention policies for uploaded files.

**Review provider privacy policies:**
- [OpenAI Privacy Policy](https://openai.com/policies/privacy-policy) | [API Data Usage](https://platform.openai.com/docs/models/how-we-use-your-data)
- [Anthropic Privacy Policy](https://www.anthropic.com/privacy)
- [Google Privacy Policy](https://policies.google.com/privacy)

::callout{icon="material-symbols:warning" color="warning"}
**Be mindful of what you discuss.** Avoid sharing sensitive personal data, credentials, or confidential information in AI conversations.
**Be mindful of what you discuss.** Avoid sharing sensitive personal data, credentials, or confidential information in AI conversations. This includes files — do not upload documents containing sensitive data unless you trust your provider's data handling policies.
::

## Tool Approvals
Expand Down
Binary file added public/img/ai-assistant-context-menu-files.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/ai-assistant-file-response.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/ai-assistant-pending-files.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/generate-translations-add-fields.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/video/ai-assistant-file-drag-drop.mp4
Binary file not shown.