See https://wikitech.wikimedia.org/wiki/Add_Link for high level overview and additional reading.
The link recommendations returned by mwaddlink will be the raw wikitext of an article, but with new links added where the algorithm thinks we should have new links.
Depending on what we do in T261408: Add a link engineering: Maintenance script for retrieving, caching, and updating search index, we might be storing:
- the raw wikitext as is
- annotated wikitext that distinguishes the algorithm-added links from the already existing links
- a diff of the old wikitext and new wikitext
So, we'll need to store this data, we might also want to think about storing:
- the article ID it's associated with
- timestamp of when the recommendations were generated
- the proposed new link text extracted from the overall recommendation document (mwaddlink might be able to provide this for us separately from the existing wikitext), see Concept B in the design for how this might be used on the front-end.
- anything else?