AI Artifact User storage

In December, we announced support for Web Artifacts :confetti_ball:

In the intervening months, LLMs have gotten even more powerful.

I am very happy to announce AI Artifact storage.

The following is a short survey that was generated entirely in a Discourse Artifact using user storage. Let us know how you are feeling about AI!

Read more about it at:


This is an opening move, and I can see this system growing and enabling all sorts of extremely cool uses to help empower communities:

  • Surveys
  • Games
  • Sophisticated polls
  • and more…
17 Likes

I’ve made a demo artifact to exercise the user storage and demonstrate what is possible with it, please give it a try.

Click here to see how it was built.

PS: Use a gamepad :video_game: to play if you want a high score

15 Likes

Suggestion:

At the end of a prompt consider adding

ask questions as needed

While the AI will often ask several questions, I find that the questions are valid and in taking the time to answer them, it does make for a much better result. Even at the end of the answers to the questions again add ask questions as needed. This sometimes goes for a few rounds but in the end 5 minutes of added Q&A saves about 20 or minutes of multiple round trips. :slightly_smiling_face:

1 Like

What is user storage? Is it like data linked to a visitor’s session?

Linked the user id, not to user session - shared on all user sessions

1 Like

This is pretty cool, I initially ignored the topic because I saw “ai” in the title (nothing personal with discourse i’m just tired of AI being in everything that it doesn’t need to be lately) but this is actually a nice feature. However, why is it locked behind only AI? This seems like it could be a lot more powerful if anybody could create these artifacts.

2 Likes

I second this! For example, having an interface where the code for artifacts and key/value pairs for storage can be manually inserted/updated would be neat.

Otherwise you’re forced to either use the web creator persona (can get expensive) or ssh tunnel into the database and manually edit the code in the relevant database row/column (can get risky)

2 Likes

Now that you mention it, a runnable code snippet [1] WITH storage would be very interesting… I can see many use cases for it especially on code help forums.


  1. coded manually, without AI ↩︎

2 Likes

That’s a great use case, if that happened people in coding forums wouldn’t have to rely on stuff like JSFiddle and Codepen (from experience).

1 Like

I am not against having a mechanism, but it is a rather large piece of work, there is lots of UI, an interim thing I could probably do is provide an admin API for artifact creation / editing and so on.

Worth tracking in a separate Feature topic if you want.

3 Likes

I’ll open a topic when I have time, thanks for letting me know.

2 Likes

I’m curious, how does the artifact in the op know my username? @sam do you mind sharing the code behind this? Thanks!

Artifacts use a messaging system from the sandboxed IFRAME back to the hosting page can communicate directly with the instance. That is how they can store/retrieve user data and get username/avatar template etc…

Implementation is here: discourse-ai/app/controllers/discourse_ai/ai_bot/artifacts_controller.rb at main · discourse/discourse-ai · GitHub

1 Like

I’d be happy to open this feature request asap, if that’s alright with you

Yeah sure I ended up forgetting and I’m not at my computer anymore so have at it

1 Like

I was actually referring to the artifact’s code :sweat_smile: , but that’s helpful too.
Thanks!

Done bossman :smiling_face_with_sunglasses:

1 Like