ai_answers
AI Answers turns an AI Assistant into a search answer engine: a visitor asks a question and gets a written answer built only from your own site content, with citations that link back to the source.
If your site already holds good content but people struggle to find the right page, AI Answers gives them one place to ask in plain language and read a direct answer, instead of scanning a list of search hits. Because every answer is drawn only from content you have indexed, and never from the model's general knowledge, the response stays true to your site and always shows where each fact came from. It is designed around a "Search Anywhere, Answer Here" pattern, so a search box in your header, a prompt on a landing page and a field in the sidebar can all feed the same shared answer region.
Features
The basic functionality is a question in, a grounded answer out. A Question block posts a visitor's question to the AI Answers API, which runs a fresh retrieval against your content and composes a written answer from what it finds. An Answer block renders that response together with its cited sources.
- Search Anywhere, Answer Here. Place any number of question input blocks across the site and point them at a single shared answer block.
- Grounded answers only. Responses are built strictly from sources retrieved through the assistant's RAG configuration. The assistant never answers without sources, because every new question runs a fresh retrieval first.
- Citations as rendered entities. Answers carry inline
[n]citations that resolve to the underlying content, rendered through a view mode you choose. - Reading content, not chat. Answers are presented as clean, readable output rather than a conversational bubble interface.
- Streaming or single response. The question endpoint can stream tokens as they arrive, or return one complete answer.
- Follow-up and feedback. Optional follow-up questions and thumbs feedback, persisted when logging is enabled, with optional trace scoring through Langfuse.
- Cacheable blocks. The blocks are lightweight, static shells that Drupal can cache. The answer itself arrives over the API via vanilla JavaScript.
Use it when your visitors have questions your content already answers but cannot easily locate: product and service documentation, support and knowledge bases, policy or HR portals, intranets, or any content-rich site where a direct answer beats a list of links.
Post-Installation
There is no new content type to create and no text-format changes to make. Configuration lives on the AI Assistant and on the two blocks. The typical flow is:
- Enable AI Answers and its required dependencies.
- Configure an AI Assistant (from the AI Assistants API) and give it a RAG action. Both the modern
ai_search:rag_searchagent tool and the legacyrag_actionare supported. This step is required: without a RAG action the assistant has no way to retrieve sources and will not answer. - On the assistant's edit form, open the AI Answers section and enable it. There you set the reference view mode, any extra guidance, the no-answer message shown when nothing relevant is found, the feedback toggle and the conversation TTL. Retrieval settings such as the index, score threshold, result count and context view mode are read from the RAG action, so you do not set them again here.
- Place the blocks: AI Answers: Question where visitors ask, and AI Answers: Answer where the response should appear. Point one or more Question blocks at a single Answer block to get the "Search Anywhere, Answer Here" behaviour.
- Grant the
use ai answerspermission to the roles that should be able to ask questions. Grantview ai answers tracesto trusted roles if you want log and trace IDs returned for debugging.
The blocks are static, cacheable shells; the answer is loaded over the module's API by JavaScript after the page renders.
Additional Requirements
Beyond Drupal core, this module requires:
- AI (
ai) - AI Assistant API (
ai:ai_assistant_api) - AI Search (
ai:ai_search) - Search API (
search_api)
You also need a configured AI Assistant with a working RAG action and a populated Search API index for it to retrieve from.
Recommended modules/libraries
- AI Logging (
ai:ai_logging): recommended. Without it, feedback has nowhere to persist. - Langfuse: optional. Adds trace scoring for feedback.
Similar projects
The AI Chatbot block that ships with the AI module provides a conversational chat widget. AI Answers takes a different approach: it presents answers as clean reading content rather than chat bubbles, and it lets many question inputs across the site feed one shared answer region rather than a single embedded conversation.
A standard Search API result page returns a list of matching pages and leaves the reader to open and read them. AI Answers instead returns a single written answer composed from those matches, with inline citations that link back to the source entities, so the reader gets the answer and can still verify and click through to the original content.