Evaluate Annotations module and how it might work with CCC
## Problem/motivation The new [Annotations module](https://www.drupal.org/project/annotations) has overlap with CCC. ### Video From NikLP: No demo videos yet but how y'all feel about a gen AI video outlining my new module suite? :smiling_face_with_tear: https://www.linkedin.com/posts/niklepage_drupal-activity-7469809314463891456-j8u8/ ### Nik's integration approach [ai_context-local.patch](/uploads/5591cdf6801c901c1d6bc021f4975b60/ai_context-local.patch) [adr-ai-context-provider.md](/uploads/75577ae14490203a6e7d953fc2cf32fd/adr-ai-context-provider.md) ### Slack history NikLP  [9:05 AM] Here's uncle Claude's take on what and why: What the patch adds: ai_context currently assembles system prompt context from curated AiContextItem config entities only. There's no way for a third-party module to programmatically contribute context at runtime. The patch adds a standard Drupal plugin system — AiContextProviderManager with a Plugin/AiContextProvider namespace, an #[AiContextProvider] attribute, and an AiContextProviderInterface — that other modules can implement to inject dynamic content into agent system prompts alongside the curated items. The AiContextSystemPromptSubscriber is extended to iterate registered providers (sorted by weight), call isApplicable(), and append any returned content to the assembled context string. Three new files, one modified service definition, one modified subscriber. No changes to existing behaviour — it's purely additive. Why it's useful to ai_context: it's the standard Drupal extensibility pattern for this kind of aggregation. Right now ai_context is a closed system; with this it becomes a platform other modules can build on without forking the subscriber. The Annotations module uses it to inject assembled annotation documentation into prompts, but the API is generic — any module could use it for route context, user role summaries, etc. [9:09 AM]This patch only provided for the sake of completion, written against ai_context 1.0.0-beta2 ai_context-local.patch  diff --git a/ai_context.services.yml b/ai_context.services.yml index e0253b7..aca9a97 100644 --- a/ai_context.services.yml +++ b/ai_context.services.yml @@ -7,6 +7,13 @@ services: [9:11 AM]I have a module that uses this to "some effect" to interact with CCC. I thought as a gesture it might be useful on its own. NB I have no experience coding against CCC or knowledge of how it works (or really what it does) but it does work... Any suggestions welcome. Kristen Pol (she/her)  [12:15 PM] Please create an issue @NikLP for discussion This in on the roadmap so good to have a concrete suggestion to discuss Kristen Pol (she/her)  [7:47 AM] I heard from Marcus that this is the module https://www.drupal.org/project/annotations Drupal.orgAnnotationsAnnotations lets you attach structured notes to any part of a Drupal site: content types, custom entities, individual fields, vocabularies, roles, etc.Aug 8th, 2018NikLP  [7:48 AM] This afternoon is just me breaking gitlab :innocent: Kristen Pol (she/her)  [7:51 AM] :sweat_smile: Kristen Pol (she/her)  [10:10 AM] @NikLP I can create a ccc issue if you let me know if https://www.drupal.org/project/annotations is the right module to assess Drupal.orgAnnotationsAnnotations lets you attach structured notes to any part of a Drupal site: content types, custom entities, individual fields, vocabularies, roles, etc.Aug 8th, 2018NikLP  [12:59 PM] That's the module yes. I already have code but it's not in that repo I don't think, but I'll sort it out tomorrow morning :+1: NikLP  [8:36 AM] @Kristen Pol (she/her) what is it you need? I'm looking at the gitlab page for CCC and "frankly, my dear"... :meow-grimace:  I have no idea what's happening. I'll hopefully get some guidance on gitlab and 'how everything new works' soon. All I have is the patch attached above tho right now, which basically opens up CCC to context injection from other sources. @Marcus Johansson seemed to think that Annotations' insertion point into "the AI stuff" might be better addressed by focusing on Tool API but I still think the patch has value. Kristen Pol (she/her)  [8:51 AM] I can create an issue to assess Don't worry :wink: NikLP  [8:51 AM] ohthankgod NikLP  [9:32 AM] @Kristen Pol (she/her) There's also a brief ADR that explains the reasoning, but the code should be somewhat self-explanatory (it's out of date now so slightly butchered but might help) adr-ai-context-provider.md  [adr-ai-context-provider.md](/uploads/75577ae14490203a6e7d953fc2cf32fd/adr-ai-context-provider.md) NikLP  [10:07 AM] NB the submodule for this in my suite is called annotations_ai_context, confusingly, just FYI! ## Solution Review and test this, and see if this can inform the roadmap and/or how to integrate. ## Tasks - Watch video - Test module - Review module code - Review integration approach - Add thoughts - Create follow-up issues as needed
issue