ai_context
Context Examples
You can add whatever context makes sense for you website such as:
- Brand voice and tone
- Style guides
- Editorial standards
- Design systems and templates
- Regulatory requirements (HIPAA, FERPA, GDPR)
- Accessibility standards
Getting Support
- Check the issue queue first
- Join the #ai-context channel in Drupal Slack
- Add a support issue to the issue queue
Installation and Testing Steps
You can install using Drupal CMS or Drupal 11. Choose one.
Install dev branch on Drupal CMS
mkdir my-drupal-site && cd my-drupal-site
ddev config --project-type=drupal11 --docroot=web
ddev start
ddev composer create-project drupal/cms
ddev composer drupal:recipe-unpack
edit composer.json and change "minimum-stability": "stable" to "minimum-stability": "dev"
ddev composer require drupal/ai:dev-1.3.x
ddev composer require drupal/ai_context:dev-1.0.x
ddev composer require drupal/ai_agents_debugger
ddev launch
ddev drush en ai_context ai_agents_debugger -y
Then:
- Configure an ai provider
- Build mdxeditor (only needed for 1.3.x dev branch, not releases):
cd web/modules/contrib/ai/mdxeditor
npm install
npm run build
Install dev branch on Drupal 11
mkdir my-drupal-site && cd my-drupal-site
ddev config --project-type=drupal11 --docroot=web
ddev start
ddev composer create-project "drupal/recommended-project:^11"
ddev composer require drush/drush
edit composer.json and change "minimum-stability": "stable" to "minimum-stability": "dev"
ddev composer require drupal/ai_context:dev-1.0.x
ddev composer require drupal/ai_agents_debugger
ddev drush site:install --account-name=admin --account-pass=admin -y
ddev drush en ai_context ai_agents_debugger -y
ddev launch
# or automatically log in with:
ddev launch $(ddev drush uli)
Then, configure an AI provider.
Simple testing steps
- Go to: /admin/ai/context/overview
- Add context: /admin/ai/context/items/add
- Go to agent context settings: /admin/ai/context/settings/agents
- Update an agent to always include a context item (e.g. Content Type Agent)
- Test the agent using the debug option of the debugger: /admin/config/ai/agents
For example, if your context says "always add the word hello when you respond", and your prompt for the "Content Type Agent" is "list all the content types", then the response should have "hello" in it somewhere.
Working on issues
This is an official AI Initiative project. We welcome contributions from AI Makers as well as the wider community.
Some issue etiquette:
- Please do not work on an issue that is already assigned before first commenting on the issue and/or contacting the person assigned.
- Only assign yourself an issue if you will be able to work on it within the next couple of days. Exceptions can be made for project maintainers or those who have arranged something with the project maintainers.
- Since assigning an issue blocks others from working on the issue, it's important to unassign an issue as soon as you know you can't work on it. If an issue has been assigned for more than 3 days with no updates, we will assume it's not being worked on and may unassign it so others can take it on.
Issues that are tagged as AI Initiative Sprint are worked on during sprints run by the AI Initiative. Sprints run for two weeks. If you are not officially part of the AI Initiative, you can still work on these issues if you follow the guidelines above. When in doubt, DM Kristen Pol in Drupal Slack.