Fully fledged website and module development with Artificial Intelligence

Created on 8 May 2023, over 1 year ago
Updated 10 June 2024, 6 months ago

Problem/Motivation

Accelerating development of websites, more described in the parent issue πŸ“Œ Use ChatGPT for solving Drupal issues to increase rate of development Active

Considering new developments within a few months, we can foresee simpler Drupal websites may be developed with AI within a year.

Proposed resolution

Since Drupal has configuration management (configuration written in .yml files), AI can write code and build websites by modifying yaml files and interacting with website on the command line using Drush.

What is needed to achieve this and how it already getting possible?

  1. AI has to be great at Drupal.
  2. AI has to know a lot of context about current website
    • Context window of AIs is getting larger:
      • GPT-3 had 2000 tokens,
      • GPT-3.5 - 4000 tokens,
      • GPT-4 - 8000 tokens,
      • GPT-3.5-16k (recent update) - 16000 tokens.
      • GPT-4-32k - 32000 tokens,
      • Open source MPT-7B-StoryWriter has 65000 tokens,
      • Anthropic's Claude (similar to GPT-4) - 100'000 tokens
      • this paper https://arxiv.org/abs/2304.11062 explains >1'000'000 tokens
      • LTM-1 (new kind of experimental LLM) has 5'000'000 tokens
    • Parts about the website and codebase can be compressed (summarized/optimized for LLM)
  3. AI has to continuously access currently live/running codebase
    • [this part is unclear how to process large context continuously, at the moment this would be extremely expensive, so some innovations/optimizations/improvements/ideas necessary if not already known]
  4. AI has to have access to the command line
    • GPT-4 Code Interpreter plugin demonstrates AI can execute code and perform task on the command line.
    • We can expect open source libraries will replicate this functionality soon if it is not done so already.
  5. AI can edit code
    • AI can edit code by sending commands to the terminal like this: sed -i 's/^core_version_requirement: ^9$/core_version_requirement: ^9 || ^10/g' web/themes/stylish/stylish.info.yml
  6. AI can change configuration (and build websites)
    • AI can change settings by writing commands like this: drush cset system.site name "New Website Name" -y && drush cim -y
  7. AI has to see how website looks like (including admin pages)
    • GPT-4 has vision, but it is not released to the public yet.
    • GPT-4 can be given browser access like Selenium, Pupetter, https://browserless.io/ etc. for: HTML fetching, screenshot making, or testing functionality by clicking on things.
  8. AI has to perform tasks autonomously
  9. AI must have access to most up-to-date knowledge of the world
    • AI could have a vector database, or Bing searching (recently released to general public). Possibly both at the same time. autoGPT can search the internet and update its knowledge base. Or it could be an open source knowledge database, which anyone can download and use locally to optimize for speed, because browsing the internet is slow. Only if local database does not have the (Drupal) knowledge, internet search might be performed.
  10. Humans have to receive results they expect
    • Simple examples:
      • "AI, please create sub-theme for Barrio named Stylish" - doable.
      • "Please create a grid view with URL /posts with latest articles" - doable.
    • For more complex scenarios autoGPT will have to devise multi-step plan.
      • "Please create a website for a conference named DrupalCon"
    • When AI does something wrong, humans will modify AI's reasoning and save it to AI's open source knowledge base. Next time, AI will know better how to perform tasks or reasoning on more complex scenarios. In other words, we can train the AI to do the right thing (this is a big ask for the whole world in general, and Drupal can participate in inventing the solution).

What innovations can be done on a Drupal side?

  • Since this would be implemented similar style to autoGPT, this Python library could be implemented in PHP.
  • Drupal UI could act as a User Interface for interaction with autoGPT or autoGPT-PHP. Creating chating and control mechanisms inside Drupal CMS taking advantage of Drupal standard features #3347447-4: ChatGPT-like UI/UX (and integration with aichat) β†’ . But this would also mean we would need to create a lot of new features Drupal currently lacks, which would be usable in all kinds of scenarios (described here #3350297-4: Creating chatGPT ECA action β†’ ). Like aim for the moon, but create additional useful technologies as a side effect.
  • Try to use this whole development concept in practice and iterate.

Remaining tasks

User interface changes

API changes

Data model changes

🌱 Plan
Status

Active

Component

Proposed Plan

Created by

πŸ‡±πŸ‡ΉLithuania mindaugasd

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @mindaugasd
  • πŸ‡©πŸ‡°Denmark ressa Copenhagen

    Could Open Assistant be a candidate for this? It's Open Source, so there's full transparency, it's installable locally or on your own server, there are no fees, you can control the training, etc.

  • πŸ‡±πŸ‡ΉLithuania mindaugasd

    @ressa for as subset of tasks, but maybe not for reasoning. GPT-4 is extreemly large language model with emergent reasoning capabilities, while Open Assistant is small in comparison.

    Open source projects have demonstrated things can be done in more efficient way, but OpenAI can adopt open source learnings and make their extremely large model even next level smarter. So their models will always be smarter, because they have the compute power.

    While Open Assistant can have 13 billion parameters, GPT-3 had 175 billions. And how much GPT-4 has is undisclosed, it is rumoured to be around 1 trillion https://en.wikipedia.org/wiki/Large_language_model

    A lot of parameters means to a lot gigabytes of storage and GPU memory, so open source local models cannot be that large.

    Because of these physical constrains, unless 100 more powerful and affordable computing technology would be invented, locally run open assistant possibly cannot do most complex reasoning which OpenAI's model will be able to do.

    It is good to have things open source as much as possible, but because of physical constraints, open source models won't grow as capable.

    There are rumors of google documents (are they real?) saying open source models are the future, but I don't know how this could be proven.

  • πŸ‡±πŸ‡ΉLithuania mindaugasd

    @ressa theoretically, model could be invented specifically for reasoning, or specifically for Drupal reasoning. Super specialized small and smart Drupal model. Possibly possible, but not practical at this point. While GPT-4 is already usable for complex all round tasks.

  • πŸ‡±πŸ‡ΉLithuania mindaugasd

    I don't want to discourage from developing an open source model, so crossed out

    Since theoretically possible.

  • πŸ‡±πŸ‡ΉLithuania mindaugasd

    News:

  • πŸ‡±πŸ‡ΉLithuania mindaugasd

    I applied for Drupal innovation contest to create AI developer assistant ( https://www.drupal.org/project/aidev β†’ )
    Results are unclear so far.
    Youtube video: https://www.youtube.com/watch?v=V-0EqaQvAXo

  • πŸ‡ΉπŸ‡·Turkey orkut murat yΔ±lmaz Istanbul

    Another LLM to consider could be Falcon.

  • πŸ‡±πŸ‡ΉLithuania mindaugasd

    This issue is LLM agnostic (unless Falcon has a huge context window?)
    Link for discussion about LLMs: πŸ“Œ Training a Large Language Model for Code (Code LLM) - an expert Drupal A.I. Active

  • πŸ‡ΉπŸ‡·Turkey orkut murat yΔ±lmaz Istanbul

    Thank you @mindaugasd, I've started following the other issue.

  • πŸ‡±πŸ‡ΉLithuania mindaugasd

    Updated issue with newest developments of context size (comparison).

  • πŸ‡±πŸ‡ΉLithuania mindaugasd

    Added tasks

  • πŸ‡±πŸ‡ΉLithuania mindaugasd

    Goals of AI developer assistant

    1. Create new Drupal features simpler and faster.
    2. Create better experience for Drupal users (simpler learning and problem solving)
    3. Enable users to contribute upstream to Drupal's open source codebase (by having complex features more approachable).
    4. Make Drupal a more practical solution to build systems (by increasing functionality and reducing cost).
    5. Create a coherent and flexible Drupal AI module ecosystem, thus enabling new AI innovators to build with Drupal (if it is not a bit too late)
    6. Make Drupal cool again (for example, Stack Overflow survey)

    Visualization of AI developer assistant module stack

    By creating "AI developer assistant" whole AI ecosystem is being created.
    Each of the module can be used independently.
    More information about each module and information how to fund the project: https://www.drupal.org/project/artificial_intelligence_initiative β†’

  • πŸ‡±πŸ‡ΉLithuania mindaugasd

    This new library https://github.com/AntonOsika/gpt-engineer designs the plans and builds the whole app only from 1 instruction.
    (does multi-step web development autonomously)

  • πŸ‡«πŸ‡·France fgm Paris, France

    I have a related, but not entirely equivalent question, and that is about code contributed on d.o. are modules allowed to include code generated by an AI ?

    The issue is that the AIs insist that they provide no license for the content they generate and have no copyright assertions, and I don’t think there already is a legal doctrine around this.

    One the one hand, creations not by a human are deemed acts of nature (Naruto vs Slater was settled out of court, but the US copyright office stated in 2014 that β€œOnly works created by a human can be copyrighted under United States law”) which means a dev using such code should gain the copyright.

    But on the other hand, in 2020, in the Uniloc USA, Inc. v. Google LLC case, such code was found not to be copyrightable, meaning such code could not placed by the contributor under GPL-2.0+ as all Drupal code must be, for lack of copyright.

    And that’s without even considering the potential for infringement from existing code regurgitated by the AI.

  • πŸ‡±πŸ‡ΉLithuania mindaugasd

    New microsoft's Gorrila is an ultra sophisticated development tool https://youtube.com/watch?v=IZOWHCinHZ8
    I am not sure how to adopt that level of sophistication. Maybe AI Work module ( https://www.drupal.org/project/aiwork β†’ ) has to adopt Gorilla in some way, maybe as another "Skill" for Drupal?

    Good news I released AI chat user interface few days ago ( https://www.drupal.org/project/aichat β†’ )
    Bad news it came so late.

    Recently I changed/improved " AI developer assistant β†’ " module stack, now it looks like this:

    I initiated a new module:

    AI personal assistant builder β†’

    β†’
    It will further enhance user experience of interacting with AI.

    And deprecated "AI models library" idea ( https://www.drupal.org/project/aimodels β†’ ) in favor of having many many separate modules.

  • πŸ‡±πŸ‡ΉLithuania mindaugasd

    @mindaugasd

    I am not sure how to adopt that level of sophistication

    I think I know now - Gorilla will be integrated to other models similar to GPT-5, or Drupal LLM πŸ“Œ Training a Large Language Model for Code (Code LLM) - an expert Drupal A.I. Active .

    And Drupal developers using next level AI developer assistant powered by AI work on the backend will be able to utilize it.

  • πŸ‡±πŸ‡ΉLithuania mindaugasd

    MetaGPT (22K stars) is just another very powerful tool AI work will have to compete with.

    MetaGPT includes product managers / architects / project managers / engineers. It provides the entire process of a software company along with carefully orchestrated SOPs.

    I am not sure yet if AI work includes this level of sophistication.

    I welcome community redesigns of AI work module.

  • πŸ‡±πŸ‡ΉLithuania mindaugasd

    aidev β†’ alpha1 just released, features rewritten code with more versatile API. Now supports disabled projects, code in any directory on the server. New plugin system allows better preprocessing of source code for limited GPT-4 context window.

    aidev have also launched open collective today which allows to support the development with small or large donations. More information on module's project page β†’ .

  • πŸ‡ΉπŸ‡·Turkey orkut murat yΔ±lmaz Istanbul

    Congratulations for that release @mindaugasd:)

    I've just shared the good news on LinkedIn.

  • πŸ‡±πŸ‡ΉLithuania mindaugasd

    Some updates on the project:

    • 2023-08-14 I released aichat 1.0.0-alpha1 β†’ - an initial version of AI chat user interface β†’ which is needed to talk with AI. As a bonus, aichat module should be useful across the board, not only for AI developer assistant, because it is primary way for people interact with AI in general.
    • 2023-08-31 I released aiprompt 1.0.0-alpha1 β†’ - AI prompt engineering β†’ module which is to configure AI assistant character and knowledge base, such as, defining project requirements, referencing various content, or providing AI codebase in the future when Ai developer assistant is complete

    aichat / aiprompt / aidev alpha1 releases was a result of very intensive sprint in hopes of more support for the project. As a result, there was little new support or use.

    Next:

    • 2024-04-17 I released aichat alpha2 β†’ and aiprompt alpha2 β†’ as a result of month long sprint. It was done, because of multiple reasons: 1) one person wrote me with interest to use it for a drupal open source project, so I volunteered to prepare the module for the usecase, but after completing it, modules were still not used because person did not continue with that idea. 2) Nonetheless, I needed to create AI features on my another Drupal installation, so I decided to work on open source versions instead of custom code, so solidified these features to move them for myself. 3) And module update was long overdue. This time people showed zero interest after releases. But these updates are quite useful, it allows to talk with AI about any content on the Drupal website.

    What's next?

    • There should be release of aichat alpha3 - It should further increase usefulness by solving some issues
    • There should be release of aidev alpha2 - this should make AI developer assistant ready for use and very useful, but I am not sure would people use it, because I hear that people like coding themselves instead of being prompt engineers, and opposition etc.

    New home for this project

    • I moving this issue to new " innovation ideas β†’ " project, which has a new workflow prepared for evaluating innovation ideas outside the scope of drupal core. If idea is approved it might even move up the ladder to new (as well) innovation β†’ project.
Production build 0.71.5 2024