A setting to allow storing persistent JSON data in artifacts

I humbly propose the implementation of rails console setting that would let admins enable the ability for AI artifacts to store persistent data in a single JSON file. This may of course inadvertently introduce some issues/risks just like the setting to enable permanently deleting topics — :warning: hence enabling it via the rails console.

AI artifacts are very useful and greatly add to quality of discussions, however their utility can be tripled if they were able to permanently store simple data and manipulate that data in simple ways :eyes:

My Personal Use-Case

My Discourse instance is used as an LMS (for English education) and a virtual laboratory for experiments for my scientific research in AI. Each of my clients/students has their own private category (access is granted through their private group) where we have everything saved and tracked (learning materials, etc.). A small part of my research is figuring out how to design a system that can successfully and autonomously create educational content for a learner given their “Learner Biography” (as shown in the screenshots below) and a knowledge graph of sorts (I’m gonna keep the rest confidential for now).

My intention is to use the Discourse API to fetch that JSON data (the learner’s biography from the artifact) from the topic content (probably gonna need some heavy regular expressions here) then feed it to my cognitive architecture which is built with FastAPI and is running on the same server with a reverse proxy. The cognitive architecture does its magic, then creates new content for that learner, then creates a new topic with that content in that learner’s private category.

Here’s a quick and dirty visualization of what I’m talking about:

    flowchart TD
    A[Discourse Instance<br/>LMS + AI Research Lab] --> B[Student Private Categories<br/>with Group Access Control]
    
    B --> C[Learner Biography<br/>stored in Topic Content<br/>JSON format]
    
    C --> D[Discourse API<br/>Fetch Topic Content]
    
    D --> E[Regular Expression<br/>Extract JSON Data]
    
    E --> F[Learner Biography<br/>Extracted Data]
    
    F --> G[FastAPI Cognitive Architecture<br/>Same Server + Reverse Proxy]
    
    H[Knowledge Graph<br/>Confidential Research Data] --> G
    
    G --> I[AI Content Generation<br/>Magic Happens Here ✨]
    
    I --> J[New Educational Content<br/>Personalized for Learner]
    
    J --> K[Create New Topic<br/>via Discourse API]
    
    K --> L[Content Posted to<br/>Student's Private Category]
    
    L --> M[Learning Materials<br/>Tracked & Saved]
    
    M --> N[Continuous Learning<br/>& Research Loop]
    
    N -.-> C
    
    style A fill:#e1f5fe
    style G fill:#f3e5f5
    style I fill:#fff3e0
    style L fill:#e8f5e8


Technically this can all be achieved (and more elegantly) by allowing http in artifacts, but I suspect that it is even riskier than storing data.

:heart: I fully intend to open source this technology once I get it all working and thoroughly tested.


This learner biography artifact works flawlessly except for the fact that the inputted data disappears after refreshing the page :see_no_evil_monkey:

what the data fields look like in the artifact

2 Likes

I have already been thinking about this super powerful feature, behind a site setting I want to allow artifact storage of key value pairs, bound to current user

This unlocks an enormous amount of use cases, including this

2 Likes

Ohhh dear Mr. Sam that would be a godsend!

In your implementation does “bound to current” user imply that only one user would be able to edit/see the saved data? I’m asking because depending on how you do it I may have to alter my approach. In my use-case, I would like for the data to be editable by both me and the student. No other users would be able to edit it, or even see it, because the artifact would be in the that student’s private category anyway.