ai-aside
Purpose
This plugin holds LLM related blocks and tools, initially the summary XBlock aside but eventually more options.
Getting Started
Developing
One Time Setup
# Clone the repository
git clone git@github.com:openedx/ai-aside.git
cd ai-aside
# Set up a virtualenv using virtualenvwrapper with the same name as the repo and activate it
mkvirtualenv -p python3.12 ai-aside
Local testing
To test your changes locally, you will need to install the package from your local branch into edx-platform. For example, if using devstack, copy or clone your branch into <devstack-parent>/src/ai-aside. Bring up the LMS and CMS containers in devstack, and run this make target in the ai-aside directory:
make install-local
You should see it uninstall any existing ai-aside in and install your local source, for both the CMS and LMS.
The plug-in configuration will automatically be picked up once installed. Changes will be hot reloaded after the next LMS or CMS restart.
If you would like to manually install ai-aside, go to your lms or cms shell and run:
pip install -e /edx/src/ai-aside
Run Migrations
You will also need to run migrations for local testing. Using the same lms or cms shell as before, run:
./manage.py lms migrate ai_aside
Testing in Docker with AI-spot
If you are running both devstack and a local instance of the supporting ai-spot in docker, you need two pieces of special setup to let ai-spot call the aside handler and retrieve content.
The first is to connect ai-spot to the devstack network with a docker command:
docker network connect devstack_default ai-spot-server-1
The second is to change the handler URLs generated by ai-aside to a URL that is accessible by ai-spot in the same docker. This is already set up for you in summaryhook_aside/settings/devstack.py. If your AI service is running locally outside of docker, you will need to change that setting.
Enabling the Aside
For the summary aside to work, you will have to make two changes in the LMS admin:
You must create an XBlockAsidesConfig (admin URL: /admin/lms_xblock/xblockasidesconfig/). This model has a list of blocks you do not want asides to apply to that can be left alone, and an enabled setting that unsurprisingly should be True.
You must enable a course waffle flag for each course you want to summarize. summaryhook.summaryhook_enabled is the main one, summaryhook_enabled.summaryhook_staff_only can be used if you only want staff to see it.
You must enable a course waffle flag if you want to use the feature for enabling/disabling the summary by its settings. summaryhook.summaryhook_summaries_configuration. If this flag is enabled, you can enable/disable the courses and the blocks by its settings.
Aside Settings API
There are some endpoints that can be used to pinpoint units to be either enabled or disabled based on their configs. The new settings work as follows: - If a course is enabled, the summary for all the blocks for that course are enabled by default. - If a course is disabled or the setting does not exists, then the summary for all the blocks from that course are disabled by default. - If a block has its own settings, it will override any other setting with the one that is saved. - If a block does not have any settings saved, then the enabled state will fall back to the course’s enabled state mentioned above.
The new endpoints for updating these settings are:
Fetch settings
Method |
Path |
Responses |
|---|---|---|
GET |
ai_aside/v1/:course_id |
|
GET |
ai_aside/v1/:course_id/:unit_id |
Update settings
Method |
Path |
Payload |
Responses |
|---|---|---|---|
POST |
ai_aside/v1/:course_id |
{ "enabled": true|false } |
|
POST |
ai_aside/v1/:course_id/:unit_id |
{ "enabled": true|false } |
Delete settings
Method |
Path |
Responses |
|---|---|---|
DELETE |
ai_aside/v1/:course_id |
|
DELETE |
ai_aside/v1/:course_id/:unit_id |
Every time you develop something in this repo
# Activate the virtualenv
workon ai-aside
# Grab the latest code
git checkout main
git pull
# Install/update the dev requirements
make requirements
# Run the tests and quality checks (to verify the status before you make any changes)
make validate
# Make a new branch for your changes
git checkout -b <your_github_username>/<short_description>
# Using your favorite editor, edit the code to make your change.
vim ...
# Run your new tests
pytest ./path/to/new/tests
# Run all the tests and quality checks
make validate
# Commit all your changes
git commit ...
git push
# Open a PR and ask for review.
Deploying
This plugin is deployed on edx.org following How to add private requirements to edx-platform.
License
The code in this repository is licensed under the AGPL 3.0 unless otherwise noted.
Please see LICENSE.txt for details.
Contributing
Contributions are very welcome. Please read How To Contribute for details.
This project is currently accepting all types of contributions, bug fixes, security fixes, maintenance work, or new features. However, please make sure to have a discussion about your new feature idea with the maintainers prior to beginning development to maximize the chances of your change being accepted. You can start a conversation by creating a new issue on this repo summarizing your idea.
The Open edX Code of Conduct
All community members are expected to follow the Open edX Code of Conduct.
People
The assigned maintainers for this component and other project details may be found in Backstage. Backstage pulls this data from the catalog-info.yaml file in this repo.
Reporting Security Issues
Please do not report security issues in public. Please email security@tcril.org.
Change Log
Unreleased
3.9.0 - 2026-09-29
Added Python 3.12 support, per the org-wide Python 3.12 upgrade process (libraries keep both 3.11 and 3.12): tox/CI now run the full py{311,312}-django{42,52} matrix, the weekly requirements-upgrade workflow now compiles with Python 3.12, and setup.py declares python_requires = >=3.11 with 3.11/3.12 classifiers.
Regenerated requirements/*.txt from scratch with Python 3.12 (make upgrade). Three pins had to be held back in requirements/constraints.txt to keep Python 3.11 and Django 4.2 support: code-annotations<3.0.0 (3.0.0 requires Python >=3.12) and djangorestframework<3.18.0 (3.18.0 requires Django >=5.2). XBlock is held to xblock<6.0.0 for the same reason (6.0.0 requires Python >=3.12) – this is the biggest of the three since XBlock is ai-aside’s core runtime dependency, so it’s called out separately for visibility.
Fixed the quality, docs, and pii_check tox environments, which were broken independently of the Python version bump: pinned setuptools<81 in each (newer setuptools dropped pkg_resources, needed by edx_lint’s pylint plugin and by XBlock); added a basepython for each since [testenv]’s basepython is now Python-version-conditional; recompiled requirements/quality.txt to resolve an incompatible edx-lint/astroid pin combination; disabled the new pylint too-many-positional-arguments check alongside the already-disabled too-many-arguments; mocked the edx-platform-only openedx/lms imports for Sphinx autodoc; and added the missing toctree entry for docs/how-tos/monitoring.rst.
Dropped the last remaining Python 3.8 references: .github/workflows/publish.yml and test_publish.yml now build/publish on Python 3.12 (previously 3.8, which is no longer installable per python_requires) and got their actions/checkout bumped to v4; updated the stale mkvirtualenv -p python3.8 instruction in README.rst and the Python intersphinx mapping in docs/conf.py to point at 3.12.
3.8.9 - 2026-08-21
Completed DataDog instrumentation for Xpert Summary (LP-919): config API requests (ai_aside/config_api/views.py) are now instrumented centrally in AiAsideAPIView, tagged with method/course_id/unit_id/action/status and reporting call counts and latency; summary_handler now reports invocation counts, content-extraction latency, content size, and block count; and student_view_aside now reports aside injection counts and render latency tagged with user_role. Added a Datadog querying/alerting reference doc (docs/how-tos/monitoring.rst).
Added DataDog monitoring for Xpert Summary: render failures, should_apply_to_block failures, and summary_handler request outcomes are now reported as custom attributes, counters, and monitored exceptions instead of only being logged.
3.8.8 - 2026-08-05
Added Django 5.2 tox/CI compatibility and Python 3.11 test matrix updates.
3.8.7 - 2026-07-28
Gave the Xpert Unit Summary button and panel a light note-box look, scoped to the ai-aside rendering (kept out of ai-spot since it’s also embedded by non-edX consumers)
3.8.6 - 2026-03-24
Fixed is_summary_enabled() to properly check course-level settings when no unit record exists
This ensures course-level toggle correctly controls summary button visibility
3.8.5 - 2026-02-10
Added client ID support for unit summary feature
Updated build process to use python -m build instead of setup.py
3.8.2 - 2025-05-14
Fixed bug where necessary class variables were not set on the AiAsideCourseApp class
3.8.1 - 2025-05-13
Bumped ubuntu version to latest for the PyPi publishing job
3.8.0 - 2025-05-07
Added setting to control whether the summary should be enabled by default
Bumped actions/setup-python from 4 to 5
Added setting to set the default enabled state for course summaries
Updated readme deployment section
Added course_app/plugin for unit summaries
3.7.0 — 2023-11-20
Moved standard error handling to where it will not bother newrelic
3.6.2 — 2023-10-12
Handle rare blocks missing dates when calculating last updated
Remove log of expected “not here” exception during config
3.6.1 — 2023-10-10
Resolve scenario where a user has no associated enrollment value
3.6.0 – 2023-10-05
Include user role in summary hook HTML.
Add make install-local target for easy devstack installation.
3.5.0 – 2023-09-04
Add edx-drf-extensions lib.
Add JwtAuthentication checks before each request.
Add SessionAuthentication checks before each request.
Add HasStudioWriteAccess permissions checks before each request.
3.4.0 – 2023-08-30
Include last updated timestamp in summary hook HTML, derived from the blocks.
Also somewhat reformats timestamps in the handler return to conform to ISO standard.
3.3.1 – 2023-08-21
Remove no longer needed first waffle flag summaryhook_enabled
3.3.0 – 2023-08-16
Features
Add xpert summaries configuration by default for units
3.2.0 – 2023-07-26
Features
Added the checks for the module settings behind the waffle flag summaryhook.summaryhook_summaries_configuration.
Added is this course configurable endpoint
Error suppression logs now include block ID
Missing video transcript is caught earlier in content fetch
3.1.0 – 2023-07-20
Features
Added API endpoints for updating settings for courses and modules (enable/disable for now) (Has migrations)
3.0.1 – 2023-07-20
Add positive log when summary fragement decides to inject
3.0.0 – 2023-07-16
Features
Summary content handler now requires a staff user identity, otherwise returns 403. This is a breaking change.
Added models to summaryhook_aside (Has migrations)
Catch exceptions in a couple of locations so the aside cannot crash content.
2.0.2 – 2023-07-05
Fix
Updated HTML parser to remove tags with their content for specific cases like <script> or <style>.
2.0.1 – 2023-06-29
Fix
Fix transcript format request and conversion
2.0.0 – 2023-06-28
Added
Adds a handler endpoint to provide summarizable content
Improves content length checking using that summarizable content
1.2.1 – 2023-05-19
Fixes
Fix summary-aside settings package
1.2.0 – 2023-05-11
Added
Porting over summary-aside from edx-arch-experiments version 1.2.0
Metadata
Release files for ai-aside 3.9.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ai_aside-3.9.0.tar.gz | 53.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ai_aside-3.9.0-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 95.6 kB
Release files / ai_aside-3.9.0.tar.gz
| Download URL | ai_aside-3.9.0.tar.gz |
|---|---|
| Size | 53.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eca54a954164c11f88771bc2cb943700c30b305c8a411c23f68c788dba90281a
|
|
BLAKE2b-256 checksum How to use checksums |
c90b5d58eae38d7fdeadec6348251d1438d7c7796880dc6b7fe98df4d44564da
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / ai_aside-3.9.0-py2.py3-none-any.whl
| Download URL | ai_aside-3.9.0-py2.py3-none-any.whl |
|---|---|
| Size | 42.4 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
451c472d6aede75044c66e8fae456d2878fc945e4f813cd2e449ca7bde8a7b4b
|
|
BLAKE2b-256 checksum How to use checksums |
9727608607af553d109f634dbc24d5494719ee6216e86d80e16528370bc12f35
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|