This project is not covered by Drupal’s security advisory policy.

Connects a JavaScript chat frontend built with the Vercel AI SDK to Drupal's AI assistants. The module adds one HTTP endpoint that runs an assistant and streams its answer in the format the AI SDK expects, for example for useChat.

Features

  • One endpoint, POST /vercel-ai/chat, streaming AI SDK UI-message parts as server-sent events.
  • The turn is a ChatProcessor plugin over the AI Assistant API, so it uses the assistant's provider, model and system prompt.
  • Tool calls before the answer: up to three rounds of Tool API tools, each call streamed to the client.
  • The request names the AI Assistant to run. Other modules (or site builders) provide the assistants.
  • Same-origin cookie authentication: the frontend forwards the Drupal session.

Post-Installation

  1. Create an AI Assistant (Configuration → AI → AI Assistants).
  2. Grant the permission use vercel ai sdk chat to the roles that may chat.
  3. From the frontend, POST to /vercel-ai/chat with agentId (the assistant's machine name) and messages, sending the session cookie.
  4. Optionally limit the tools an assistant may offer in its settings.

Additional Requirements

  • Drupal 11.1 or later
  • AI, with the AI Assistant API submodule and a configured AI provider
  • A frontend using the AI SDK
  • Tool API: provides the tools an assistant can call.
  • AI RAG Citations: grounds answers in site content and returns the cited sources.

Similar projects

AI Decoupled covers the same need with configurable endpoints, executor plugins and rate limiting. It does not speak the AI SDK stream format and does not accept same-origin cookie authentication on its write routes. The aim is to converge by contributing both there.

Developed as part of OpenKnowledgebase and released on its own so that other Drupal sites can use it without OpenKB.

Status: the code currently ships inside OpenKnowledgebase and will be moved here before the first release.

Supporting organizations: 

Project information

Releases