How Drupal Grounds AI Answers in a Site's Own Content

Where Code Enforces Grounding and Where AI Instructions Take Over
Tutorial graphic titled "What Makes an AI Answer Trustworthy?" featuring the Drupal AI Answers interface. A question about evening parking receives a cited answer referencing "Visiting the Harbour Lights Festival". Highlights source citations, retrieval thresholds and model instructions.

The contributed AI Answers module lets a Drupal site answer visitors' questions in prose written from the site's own pages, with a numbered source after each claim. Its newest release, 1.0.0-beta4, was published on 24 September 2026.1 Its supporting organisation on Drupal.org is Dropsolid, credited for "Initial development & active maintenance".

The DropTimes inspected the code of AI Answers 1.0.0-beta4 and tested it locally with OpenAI's gpt-4o-mini model. In testing, the block answered questions from indexed pages and linked each claim to its source card, while safeguarding out-of-scope replies depended on the response path. Its non-streaming JSON endpoint can replace a reply in PHP when retrieval finds no usable source, whereas the default front-end answer block streams its answers. On that path, once tokens start arriving, refusing a question the site cannot answer relies on prompt instructions.

AI Answers is one part of a retrieval-augmented generation (RAG) stack, in which the site searches its own content first and the model writes from the passages it finds. Three of the four contributed AI modules in this stack are in alpha or beta. AI Search has opted in to security advisory coverage, while AI Answers and the Postgres VDB Provider have not. None of the three has a stable release, so all three remain outside Drupal's security advisory coverage.2

In a related talk at DrupalCon Rotterdam 2026, Antonella Picarella (Squinternata) shared lessons from EPSY, the European Personnel Selection Office's AI assistant, in "From Drupal Content to AI Answers: Learnings from EPSY".

Three of the Four AI Modules Have No Stable Release

Four contributed projects do the work on top of the Search API indexing framework. AI Search, whose maintainers include Scott Euser, adds a vector Search API backend, while the Postgres VDB Provider stores those vectors in PostgreSQL with the pgvector extension. AI Agents, maintained by contributors including Marcus Johansson and James Abrahams, runs the model and its tools, and AI Answers turns an agent into a cited answer engine.

Only AI Agents and Search API combine a stable release with security advisory coverage.

ModuleRoleNewest releaseStatusSecurity advisory coverageSupporting organisations on the project page
AI AnswersAnswer engine, blocks and citations1.0.0-beta4 (24 September 2026)In development (beta)Not opted inDropsolid
AI AgentsRuns the agent and its tool calls1.3.5 (2 September 2026); 1.4.0-beta1 also publishedReleasedCovered (1.3.5)FreelyGive, Acquia
AI SearchVector search backend and retrieval tool1.3.0-alpha6 (28 October 2026); 2.0.0-alpha3 (28 October 2026) on a separate branchIn development (alpha)Opted in; alpha releases not coveredSoapbox, FreelyGive, Factorial.io, Velir
Postgres VDB ProviderStores vectors in PostgreSQL with pgvector1.0.0-alpha4 (10 September 2026)In development (alpha)Not opted inNumiko
Search APIIndexing framework8.x-1.43 (28 October 2026)ReleasedCoveredAcquia, Google Summer of Code, jobiqo, MD Systems, iO, DrupalBliss.com

Drupal's security advisory policy covers stable releases of opted-in projects; AI Answers, AI Search and the Postgres VDB Provider have no stable release, so none of the three is covered today.3

AI Answers 1.0.0-beta4 requires Drupal ^11.2, AI Search 1.3.0-alpha5 or later, the AI module from 1.4 and AI Agents from 1.3.4 Its live getting-started guide, which follows the development branch, lists Drupal ^10.5 and PHP 8.2 or later alongside the pgvector server and index, field roles, an agent with a fixed index and minimum score, and the question and answer blocks placed through Block Layout or Drupal Canvas.

Pages Are Split into Chunks, and pgvector Must Be Enabled Separately

Retrieval starts with a Search API index on an AI Search server. AI Search splits long text into chunks and embeds each chunk with the server's embeddings model, turning it into a vector: a list of numbers that lets the search compare passages by meaning. By default in AI Search 1.3.0-alpha6, chunks are 500 tokens long with a 100-token minimum overlap. The server form notes that questions are vectorised "in the same manner (i.e., using the same engine)" and that changing the embeddings model requires reindexing.5

Indexed fields take one of three roles:

  • "Main content" is chunked and embedded.
  • "Contextual content", such as a title, is prepended to every chunk.
  • "Filterable attributes" are structured fields used for pre-filtering.

The Postgres VDB Provider needs a PostgreSQL database with the pgvector (vector) extension enabled.6 The module's PHP code does not create the extension automatically, so the project's example Docker setup includes a one-line SQL file that enables vector. In testing, creating the vector collection failed with type "vector" does not exist until the extension was enabled in PostgreSQL.

The provider's other listed requirements sit in Drupal and on the web server:

WhereRequirement
DrupalSearch API (search_api), the AI module (ai), AI Search (ai_search) and the Key module (key)
Web serverThe PHP pgsql (pdo_pgsql) extension

A Minimum Score Decides Which Passages the Model Sees

An agent configured in AI Agents writes the answer using AI Search's "RAG/Vector Search" tool, which takes a search string, a result count and a minimum similarity score. In AI Search 1.3.0-alpha6, the tool defaults to ten results and a minimum score of 0.5, dropping lower-scoring matches before the model sees them.

AI Answers refuses to run an agent unless the tool's index is fixed in configuration. Its getting-started guide also instructs site builders to hide the index from the model, calling this "not optional" because a selectable index would be "a prompt-injection vector". The guide recommends fixing the minimum score at 0.4 to 0.5 as "a good place to start": lower values cite weak matches, while higher values can trigger the no-answer message even when a relevant page exists.

In AI Answers 1.0.0-beta4, for each new question the module runs its own search before calling the model. If the agent fixes no minimum score, that initial search applies no threshold, a minimum of 0.0. It asks for five results unless the agent fixes a count. The tool's 0.5 default applies only to searches the model initiates itself.

In local testing on a six-page index, a question about free evening parking returned a cited answer both with a 0.4 minimum score fixed on the agent and with none fixed: "Yes, parking at the harbour car park is free after 18:00 during the Harbour Lights Festival [1]."7 With no minimum set, all five pages from the initial search were passed to the model as candidate sources, down to a privacy page scoring 0.11, though the finished answer cited only the parking page.

Other agent tools can be added as source tools so questions that list or count items can be answered from a listing tool rather than from text chunks. Each agent also has a "Max loops" setting capping its tool-calling rounds (defaulting to 10 in AI Agents, with 3 suggested in the AI Answers guide).8 When the limit is reached, AI Agents returns its configurable step-limit message: "I was unable to fully answer your question within the allowed number of processing steps. Please try rephrasing or narrowing your question."

The Module Numbers the Sources, and the Model Is Told to Cite Them

AI Answers appends a fixed citation contract to the end of every agent's system prompt, after the agent's own instructions: "Answer using only the sources below. Cite each claim inline with its bracketed number, e.g. [1] or [2][3]." It instructs the model that if the sources do not contain the answer, it must say it lacks enough information and "never use outside knowledge."

The module numbers the retrieved passages and passes them to the model. If the model searches again in the same turn, existing sources keep their numbers so early citations stay accurate. Once the answer is written, the module drops uncited sources, renumbers the rest in citation order, and reloads each remaining source with an access check in the visitor's language when a translation exists.

On the Default Streaming Block, Refusals Rely on Prompt Instructions

Whether a visitor sees the configured no-answer message depends on the response path and on what retrieval returns. The endpoint POST /ai-answers/question, covered in the module's architecture documentation, returns JSON by default, or a server-sent event stream when called with Accept: text/event-stream.

In AI Answers 1.0.0-beta4, the configured no-answer message defaults to "I couldn't find sources to answer that." According to the architecture page, "the no-answer message is substituted for $text whenever nothing has actually reached the client yet: either the non-streaming path found no usable sources, or generation produced no text at all on either path."

On the live stream requested by the default front-end answer block, by contrast, "A streamed answer that already reached the client with some text is left alone, even with zero usable sources, since it may already be visible; the citation contract handles that case instead."

On the single-response path, the replacement depends on retrieval finding nothing, and the module counts every passage its search keeps, not only those cited in the answer. Without a fixed minimum score, a site with indexed content will usually retrieve some passage for any question, so the configured fallback rarely triggers. In testing with no minimum score fixed, the module's initial search passed five unrelated pages to the model for a question about the weather in Rotterdam on the JSON path. The reply was the model's own sentence ("I do not have that information") rather than the configured fallback, which appeared verbatim only when retrieval returned zero sources.

Follow-Ups Send Every Earlier Turn to the Model by Default

Conversations are kept on the server for 3,600 seconds by default so follow-up questions can refer back to earlier turns; on a follow-up, the agent either searches again or reuses the previous turn's sources. A separate maximum-history-turns setting controls how many earlier turns are threaded to the model. In 1.0.0-beta4, its default of zero sends every earlier turn, and a code comment describes the cap as "a cost control, since every threaded turn adds its full text as input tokens to each agent round".

In testing with the default setting, the logged request for a follow-up question included the visitor's first question.

What Leaves the Site: Pages, Questions and Conversation History

Three kinds of request leave the site by default:

Sent toWhat it receives
The embeddings modelIndexed chunks and contextual fields
The same embeddings modelVisitor questions, to be vectorised
The chat modelThe agent's instructions, citation contract, extra guidance, numbered source passages, conversation history and question

A fourth request, to a reranking model, runs only when a reranking provider is configured. Optional visitor ratings are saved locally when AI Logging is installed.

Three Documented Gaps to Plan Around

Three documented limitations in 1.0.0-beta4 bear on deployment:

  • No language filter on retrieval. Vector search results are not limited to the visitor's language, so on a multilingual site a passage in another language can be retrieved and given to the model. The suggested mitigation is a higher minimum score and an instruction to answer in the question's language. Fixes target AI Search 2.0.x rather than the 1.3.x branch AI Answers 1.0.0-beta4 requires. AI Search 2.0.0-alpha3, released on 28 October 2026, automatically adds a language field when a new index is created on a multilingual site, though AI Answers does not yet filter on it.
  • In-module rerank shows a different order than the LLM saw. The module runs its in-module reranking on the final result set after the language model has already generated its answer from the raw, unreranked tool order. The order the model saw therefore differs from the order in the reference list shown to the visitor, until the upstream ai_reranker Search API processor is adopted.
  • Bundled JavaScript libraries. The markdown-it and DOMPurify libraries that turn answers into safe HTML are copied into the module, with no automatic way to learn of new releases. DOMPurify is the layer that protects against malicious markup in model output.

Before Going Live

  • Fix and hide the search index: lock the agent's RAG/Vector Search index in configuration and hide it from the model to block index-selection prompt injection.
  • Set a minimum similarity score: leave it unset and AI Answers' initial search applies no threshold (0.0); fixing a value around 0.4 to 0.5 prevents weak unrelated passages from blocking the configured fallback.
  • Cap conversation history turns: change the default of 0 if long conversations should not send every earlier turn as input tokens on every round.
  • Choose between JSON and streaming: only the non-streaming JSON endpoint guarantees replacing a reply in PHP when retrieval finds zero usable sources; the default live stream relies on the citation contract once tokens reach the browser.

A stable release alone would not bring AI Answers or the Postgres VDB Provider into advisory coverage, because neither has opted in.

The DropTimes was a media sponsor of DrupalCon Rotterdam 2026, where Acquia, Dropsolid, Factorial.io, FreelyGive and iO were also sponsors.

Footnotes

Disclosure: This content is produced with the assistance of AI.

Note: The vision of this web portal is to help promote news and stories around the Drupal community and promote and celebrate the people and organizations in the community. We strive to create and distribute our content based on these content policy. If you see any omission/variation on this please reach out to us at #thedroptimes channel on Drupal Slack and we will try to address the issue as best we can.

Related Drupal Initiatives

Related People

Upcoming Events

Latest Opportunities