An admin API for AI web artifact creation and editing

As per this discussion, it seems like many admins would be ecstatic to have an interface or an admin API which allows them to manually create and edit artifacts.

Currently the only way to create/edit any artifacts is through the Web Artifact Creator persona, however this inherently has some limitations:

  • :money_bag: Costs: Making LLM calls for trivial changes such as changing some text or button placement, etc. gets quite expensive if one really wants to work out all of the kinks and progressively add new stuff to it, etc.
  • :warning: Risks: An admin could in principle (I think, as I haven’t tried it yet) write a function to SSH tunnel into the database (or use a GUI like pgAdmin 4), copy the relevant rows from the relevant tables, auto increments the artifact ID, alter the code for a different artifact or make changes, etc. etc. But this is obviously risky and potentially destructive (that’s why Data Explorer is read-only, after all). Not to mention that it is time-consuming.

What would this feature enable? A LOT. Here are just a few things I could think of which are relevant to my community:

  • :nerd_face: A “base quiz” artifact: We could have one base quiz artifact, then simply copy it and alter the JSON storage to create an entirely new quiz. This pathway has the potential to totally bypass H5P content for educational communities.
  • :wrench: A “copy/customize artifact” LLM tool: Since this hypothetical feature would be part of Discourse’s rich REST API, admins could make a tool which allows personas to copy a given artifact then personalize the JSON storage for a particular user or group.
  • :microscope: Personalized artifacts: Closely related to both of the previous points, instead of having to rely on an LLM to copy/paste an artifact without messing anything up, we could have just one artifact which actually works then use this API to copy it for a specific user or group, then personalize it to them however needed via the JSON storage. One use-case I have for this is making individual knowledge graphs for some of my users. It’d be nice to have a graph visualizer artifact which works well, then each user just builds their own knowledge graph which is stored as persistent JSON.
  • :computer_disk: Fetching JSON data: I suspect that such an API would also more easily enable retrieving the persistent JSON data associated with any given artifact. This could be massively beneficial for many reasons. For example, feeding it to an LLM for context (via a “read artifact data” tool), etc.
5 Likes

I’ve just attempted to manually add a new artifact to the ai_artifacts database table using pgAdmin4. I copy/pasted the row of an already existing artifact then changed the values for the id,user_id, and post_id columns. Did the same process for the ai_artifact_key_values table.

And it still didn’t work for some unknown reason. The new artifact which I manually added was not visible to the user which it should be visible to. So I fear the only way to get this done is via a dedicated admin API endpoint :pensive_face:

2 Likes

Even if we don’t get a Codepen style editor with this, I think something like baking in VSCode would be satisfactory.

3 Likes

Gets my vote! I think my company could totally use this, as we’ve just moved to Discourse. I’m going to have a chat with them and get their two cents. May I ask a few questions?

  1. Which LLM do you use for artifacts?
  2. How else you have tried to share the artifact?

And

Could you maybe explain on how you see this working? It sound rather intensive.

1 Like

I find that Claude Sonnet 4 behaves quite well, and all of the testimonies saying Claude Code is amazing just banks this up. However I haven’t tested o3 pro yet

I’ve tried: group message, sharing in private category, manually copying the artifact in the database, etc. Seems like the only way to share is to share it publicly (no way to control access granularly)

Cloudflare does it nicely, there’s just an edit code button in the Workers UI which will take you to embedded VSC where you just simple edit the code and deploy right to the worker. Something like that could work for creating and editing artifacts in the browser.

1 Like