[Tracker]
Update Summary: [One-line status update for stakeholders]
Check-in Date: MM/DD/YYYY
Blocked by: [#XXXXXX] (New issues on new lines)
Additional Collaborators: @username1, @username2
Metadata is used by the AI Tracker. Docs and additional fields here.
[/Tracker]

Problem/Motivation

We want a generic mechanism for adding context source plugins, such as loading context from a:

  • PDF
  • MD file
  • Word doc
  • Google doc
  • Single webpage (URL)

And converting the info to markdown, and inserting it into the ai_context_item content entity content field.

Note that the source will provide the initial information, but the user can edit it using the ai_context_item content entity form as they do for manually-entered context.

For now, we can assume external documents are publicly accessible, but a future feature would allow private documents, so would need access control handling.

We also need a way to resync with the source, which will wipe out any changes the user has made. This is more relevant for external sources, such as a web page with brand guidelines.

Proposed resolution

See discussions in:

#3547034: [Spike] Research URL support for CCC
#3547035: [Spike] Research PDF upload support for CCC

We will use the new Document Loader system.

We might use the AI File to Text module which:

  • Extracts content from Word (.docx, .doc), OpenDocument (.odt, .ods), PDF, CSV, TXT, and Markdown (.md) files.
  • Three output formats: plain text, styled HTML, or Markdown.

Target date or deadline

April 2026

Remaining tasks

  • Design workflow
  • Create plugin architecture
  • Implement key plugins
  • See additional child issues

AI usage (if applicable)

[ ] AI Assisted Issue
This issue was generated with AI assistance, but was reviewed and refined by the creator.

[ ] AI Assisted Code
This code was mainly generated by a human, with AI autocompleting or parts AI generated, but under full human supervision.

[ ] AI Generated Code
This code was mainly generated by an AI with human guidance, and reviewed, tested, and refined by a human.

[ ] Vibe Coded
This code was generated by an AI and has only been functionally tested.

CommentFileSizeAuthor
#9 Screenshot from 2026-03-17 21-00-04.png208.43 KBrobloach

Issue fork ai_context-3569310

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

kristen pol created an issue. See original summary.

kristen pol’s picture

rakhimandhania’s picture

kristen pol’s picture

Issue tags: -mvp, -sprint candidate

This is probably a post-Chicago task

kristen pol’s picture

Issue tags: -AI Innovation

There was progress on the PDF research task but there are some module dependencies that need to be sorted before this could be worked on

kristen pol’s picture

Title: Create add context intermediary page for PDF/URL/manual » [META] Context source plugin feature (context from PDF/MD/Word/URL/etc)
Priority: Normal » Major
Issue summary: View changes

If this doesn't make it into 1.0, then it should make it into 1.1.

We need child issues for:

  • Discuss feature
  • Create workflow UI/UX
  • Create plugin architecture
  • Create PDF context source plugin
  • Create MD context source plugin
  • Create TXT context source plugin
  • Create Word context source plugin
  • Create Webpage (URL) context source plugin

robloach made their first commit to this issue’s fork.

robloach’s picture

StatusFileSize
new208.43 KB

This issue is postponed, but I wanted to demonstrate a prototype of what using a Document Loader + Field Widget Action could look like to allow uploading content via a PDF or a Website URL.

Merge Request: https://git.drupalcode.org/project/ai_context/-/merge_requests/103

Modules

Notes

  • The UX obviously could improve, with a tabbed interface or similar, this is mostly focused on getting it to work first
  • Regarding the UX, I still believe an Editor Button could make more sense for this. Like click a button and a modal pops up to allow ingesting the content.
  • The markdown editor doesn't quite behave nicely with FWA. While the value is set, the markdown editor doesn't update properly like it does with CKEditor.
  • Document Loader doesn't have a sense of a fallback method for format outputs. It expects to output markdown, but text is the only allowed output. Need to get a fallback method working.
  • We could likely introduce this as a module itself, but having it within the context item itself does give us a lot of control over it.

kristen pol’s picture

Oooh! Awesome!

We can open this back up during Chicago contribution day :) Let's discuss with Aidan+Emma in person

But, I would need to know when DL 2.0 (stable) would land first. Maybe we can get it into CCC beta2 if that is happening soon (which I think it is)

kristen pol’s picture

ahmad khader’s picture

The great thing about the document loader's current implementation is that we don't need to push any code except to add a dependency or recipe to ship with CCC, not only that. It will solve all file/date extraction of the other issue tickets in one singular code logic, and other integrations in the future will be bulletproof as well.

kristen pol’s picture

Status: Postponed » Active
Issue tags: +AI Initiative Sprint, +AI Context Management

Moving this to open for additional discussion though it's not a given this will make it into 1.0. We'd need to button it up in the next couple weeks.