This project is not covered by Drupal’s security advisory policy.
AI RAG Citations makes an AI chat assistant answer from your site's own content and show where each answer came from. Before the model answers, it looks up matching pages, gives them to the model as numbered sources, and returns the sources the answer cited.
Features
- Retrieves before the model runs and hands the model a numbered source list to cite.
- Two modes per assistant: grounded (an answer without sources is marked as such) or strict (the assistant says it found nothing and the model is not asked).
- Returns only the sources the answer actually cited, as response metadata, so a frontend can link them.
- Retrieval runs as the asking user, so the answer respects the access the source enforces.
- Retrievers are plugins. A Search API retriever ships with the module.
- Makes no assumptions about the site's content model, access model or chat client.
Use it when an assistant should answer questions about your content (documentation, a knowledge base, an intranet) and readers need to check the answer against the source.
Post-Installation
- Edit an AI Assistant (Configuration → AI → AI Assistants).
- Under Grounding, pick a retriever (for example a Search API index of entities) and a mode, and set the score gate and the number of sources.
- Optionally adjust the prompt texts under Prompt texts. All defaults are neutral.
To try it without a frontend, enable Also ground API Explorer chat calls on the assistant and ask a question in the AI API Explorer.
Additional Requirements
- Drupal 11.3 or later
- AI, with the AI Assistant API submodule and a configured AI provider
- Search API, with an entity-based index for the shipped retriever
Recommended modules/libraries
- Vercel AI SDK Chat: streams the citations to a chat frontend.
- AI Logging (part of AI): shows the exact prompt a turn ran with. Use it on development sites only, as it stores prompts.
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.
Project information
- Project categories: Artificial Intelligence (AI), Site search
- By jjchinquist on , updated
This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.

