Transform your Directus CMS with intelligent automation, smart data interpretation, and natural language processing

:robot: AI Agent for Directus

Transform your Directus CMS with intelligent automation, smart data interpretation, and natural language processing.

:sparkles: Features

  • :speech_balloon: Natural Language Commands
    Interact with your Directus CMS using plain English prompts.

  • :bar_chart: Data Insights & Querying
    Use AI to read, analyze, and summarize collections, relations, and metadata.

  • :brain: Semantic Understanding
    AI understands schema, relationships, and context β€” allowing you to insert, update, and link data intelligently.

  • :gear: Smart Automation
    Automate workflows based on AI decision trees.

  • :counterclockwise_arrows_button: Prompt-to-Action
    Instantly convert prompts into structured actions and queries within Directus.


TESTED WITH OPENAI GPT-4o MODEL

AI can make mistakes use it with your own risk.


:puzzle_piece: Extension Type

This is a Bundle Extension that includes:

  • Module β†’ Frontend UI (Chat interface, Settings, and Help)
  • Endpoint β†’ Backend AI agent server (OpenAI / OpenRouter-based)

:package: Installation

1. Install via npm

npm install directus-extension-ai-agent

Or clone manually:

https://github.com/Uncw3b-Software/directus-extension-ai-agent

:gear: Configuration

No need for .env editing.
The extension creates a settings collection after install.

  • Enter your OpenAI / OpenRouter API key
  • Choose provider (openai, openrouter, etc.)
  • Adjust model, temperature, and stream settings

Settings panel is embedded in the UI.


:test_tube: How to Use

Open the AI Agent module in Directus. Use prompts like:

  • Show me the total sales from last month
  • Add a new user named John with role editor
  • Summarize all feedback from last 7 days
  • Create 3 product entries with dummy values
  • What is the average age of users in Germany?

AI will process the prompt and return or execute it with context awareness.


:locked: Security & Sandbox

  • :shield: 100% compatible with Directus Cloud sandbox
  • :white_check_mark: No direct file system access
  • :white_check_mark: All remote calls routed via sandbox-safe fetch
  • :white_check_mark: Uses openai and openrouter public endpoints only

:camera_with_flash: Screenshots





:man_technologist: About the Developer

This extension is built by Uncw3b Software, a boutique AI & Web3 development agency.

Looking for custom AI integrations or Directus development? Reach out to us.


:page_facing_up: License

MIT License Β© Uncw3b Software

1 Like

Awesome, I was already wondering if someone working on an integrated AI chat.

Is this capable producing visual representations like charts for example?

Hey, I could not find it on the GitHub

Hello,

I installed the extension using a Dockerfile like this:

FROM directus/directus:11.8.0

USER root
RUN corepack enable

USER node
RUN pnpm install directus-extension-ai-agent

But it’s not working as expected. Here’s what I see in the terminal:

directus-1  | 2025-06-24T16:39:43: PM2 log: App [directus:0] online
directus-1  | πŸ”§ Creating settings table...
directus-1  | ❌ Table creation error: Invalid payload. Collection "ai_agent_settings" already exists.
directus-1  | [16:39:55.559] INFO: Extensions loaded
directus-1  | [16:39:55.571] INFO: Loaded extensions: directus-extension-ai-agent, directus-extension-custom-search-okam

Hello, it is not working, see the log

User Prompt: hello
βœ… Settings loaded
πŸ”„ Starting MCP connection...
πŸ”§ MCP connecting with URL: https://5dd1-103-211-43-213.ngrok-free.app, Token: SET (xxxxxxx-U...)
πŸš€ Initializing MCP...
MCP Request: {
  jsonrpc: '2.0',
  id: 1,
  method: 'initialize',
  params: {
    protocolVersion: '2024-11-05',
    capabilities: {},
    clientInfo: { name: 'directus-extension-ai-agent', version: '1.0.0' }
  }
}
[17:59:23] GET /users/me?fields=id 304 23ms
[17:59:28] GET /fields 200 37ms
[17:59:29] GET /relations 200 12ms
MCP stderr: No prompts collection configured, skipping prompt fetching
MCP Response: {
  result: {
    protocolVersion: '2024-11-05',
    capabilities: { tools: {}, resources: {}, prompts: {} },
    serverInfo: { name: 'Directus MCP Server', version: '0.0.1' }
  },
  jsonrpc: '2.0',
  id: 1
}
βœ… MCP initialized successfully
βœ… MCP connection ready
--- AI Iteration 1 ---
πŸ”₯ Error: Error: OpenAI API error: 404
    at b.chat (file:///directus/extensions/directus-extension-ai-agent/dist/api.js?t=1750787763269:1:6015)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async file:///directus/extensions/directus-extension-ai-agent/dist/api.js?t=1750787763269:1:14578
[17:59:30] POST /mcp-server/prompt 500 13.2s

My config