damus-io / damus

iOS nostr client
GNU General Public License v3.0
2k stars 289 forks source link

Algorithms #1302

Open alltheseas opened 1 year ago

alltheseas commented 1 year ago

what is it Algorithm capability will enable Damus users to opt-in to various algorithms as a complement to the chronological timeline.

This could enable "trending" posts, "trending" profiles etc

implementation @jb55 was exploring script? language capability

https://damus.io/note1ejhkppvw74f966fxw4srhvsd3npyjjpm9pq65p6qlv06xu2eu2hqklcwv4

design exploration @robagreda what might a "algo marketplace" look like?

requirements:

-damus user can always opt-in, or opt-out -there are no mandatory algorithms (see twitter) -algorithms are a marketplace -algos can be developed by third party devs -algos can be free, or paid / there is a way to zap algo devs -damus algos must have easy to find name, description, author -damus must clearly display if algo is installed -damus must clearly display if algo view is on -damus must clearly have a way to "install", and "uninstall"

questions:

is there "install" button? is there a "uninstall" button (i.e. "algo store" can service as a place to manage all algos) where does the installed algo take place? can there be more than one algo installed? how might user swap between algos; does each algo have a separate view?

crazy experiment areas can algos be combined? can there be a way to zap (i.e. optionally tip) algo authors

GBKS commented 1 year ago

That's a fun exploration. It might be best to start with thinking about what people might want to use algos for, and then derive the display from there. Always good to work with realistic content and scenarios. Did someone already explore that in depth? For example, is search also an algo?

Generally, the idea is that there are different views into all the activity. I like how Twitter has the row of tabs at the top when you set up multiple lists. Allows you to quickly switch between them. I also make heavy use of algo user options like muting/blocking words/people/hashtags. Twitter also has a bunch of other search options that could be considered. For example, when searching for bitcoin content, it's often helpful to use -filter:links to remove spam.

It can get pretty complex technically, but I do wonder if there aren't a handful of use cases that cover 98% of all needs.

alltheseas commented 1 year ago

Generally, the idea is that there are different views into all the activity. I like how Twitter has the row of tabs at the top when you set up multiple lists. Allows you to quickly switch between them.

Agree

I also make heavy use of algo user options like muting/blocking words/people/hashtags

These are not algos, but user created lists. Unless your idea is to automate this, and have algos make these decisions on behalf of the user. This a twitter, fb very dark, not opt-in, pattern.

Twitter also has a bunch of other search options that could be considered. For example, when searching for bitcoin content, it's often helpful to use -filter:links to remove spam.

The above is an advanced search description. We have this on roadmap, and have not prioritized yet. https://github.com/damus-io/damus/issues/493 https://github.com/damus-io/damus/issues/1075

It might be best to start with thinking about what people might want to use algos for Currently the only option of timeline, and universe views is chronological. An algo could find notes in an order other than chronological.

Top zapped replies is an example sorting. https://github.com/damus-io/damus/issues/1116 Most zapped notes view. https://github.com/damus-io/damus/issues/686

We don't need algo marketplace capability for the above two examples. However, if we are to provide "algo marketplace" capability there can be third party algo providers that experiment and provide novel algorithms for exploration. This is something that twtr, and fb are incentivized not to do, as they keep their users in a perpetual state of doomscrolling amid sale of user data, and ads bombardment.

GBKS commented 1 year ago

These are not algos, but user created lists. Unless your idea is to automate this, and have algos make these decisions on behalf of the user. This a twitter, fb very dark, not opt-in, pattern.

Yes, these are put together by the user, but shouldn't an algo also consider them? Or does the algo create a feed and then the client applies the mute/block list filtering afterwards on the results? Whether I see my chronological timeline, most zapped content or do a search, I may still just not ever see certain terms or content from certain people.

In my mind, these things are all related. I create a "view into the stream of information", which involves an logic part (the algo) as well as user options (search term and parameters like filtering links, as well as the mute/block list) that the logic part works with (variables essentially).

alltheseas commented 1 year ago

but shouldn't an algo also consider them?

It depends on the algo that is "installed" by the user.

In my mind, these things are all related. I create a "view into the stream of information", which involves an logic part (the algo) as well as user options (search term and parameters like filtering links, as well as the mute/block list) that the logic part works with (variables essentially).

Agree

alltheseas commented 1 year ago

https://github.com/damus-io/damus/pull/1246

alltheseas commented 1 year ago

User defined algos requirements & suggestions:

  1. Algos must be opt-in ("user enabled")
  2. Algos must be known, visible, and configurable
  3. Keep "chronological" algo as an option
  4. Add "trending" option
  5. Add open API/store for build your own. "api/store: don’t be the gatekeeper for algorithms. allow others to publish algorithms and users to use them."
  6. Ability to zap algorithm creators
  7. Media feed image

trending: some kind of damus secret-sauce algorithm. show me cool stuff based on past zaps, likes, follows, etc.

api/store: don’t be the gatekeeper for algorithms. allow others to publish algorithms and users to use them. provide some kind of api for making that possible

in practice the api could be some nostr event that holds some nostrscript or w/e mechanism damus uses to define algorithms -Ben

https://damus.io/note162ul7rne3qhrksk8wlf76ar4stm9k3jv4xwtcc34ga26kdwtljcqqllevf

Tangential: user lists https://github.com/damus-io/damus/issues/531

alltheseas commented 1 year ago

https://damus.io/note1kpm4dhdtl3lhlmcepjgleycmrunlydjfvem5zdycmea73g8uhpmqr36z44

Algo implementation and UI via bluesky for web. UI is not normie friendly.

alltheseas commented 11 months ago

User feedback https://damus.io/note1tkn46rxjd73ef27cehgnqyhv0gy52ue8y3tjwkzntqnaqdln5xvs96w5dq

jb55 commented 6 months ago

@GBKS wrote:

Twitter also has a bunch of other search options that could be considered. For example, when searching for bitcoin content, it's often helpful to use -filter:links to remove spam.

I'm putting together a flexible way of building any kind of algorithm, filtering links would be very easy with nostrscript + nostrdb:

-- note blocks are blocks of parsed contents
for block in nostr_note_blocks(note) {
  if block.type == url {
      return false
  }
}
return true

this could be assemblyscript or a custom wasm-targetted language that I'm calling nostrscripts. These filters run alongside nostrdb queries, so that are super efficient. I am also planning on creating reducers for more than just filtering.

Full plan here:

alltheseas commented 2 months ago

discoverability is lacking

https://damus.io/nevent1qqsz28a99c5xyw7l3clu8qe3zrmatph9lckdd0tk3mg7jye9kzw33tcjrl529

alltheseas commented 2 months ago

Customer requests people you might like/people followed by those you follow algo

https://damus.io/nevent1qqsz8akt2lkexcunr828858xz2arn97lya60lwpd37kgkcc3m4wwqmqpz4mhxue69uhhyetvv9ujumt0wd68ytnsw43qzxrhwden5te0wfjkccte9ehx7umhdpjhyefwvdhk6qghwaehxw309ahx7um5wghxvmt59emkj73wvf5h5qgjwaehxw309ac82unsd3jhqct89ejhxr6249y

For discovery of new people to follow, is there a ‘people you might like’ DVM / client feature out there?

Looking for something that searches for the most followed npubs by people you already follow (only showing people you don’t already follow).

alltheseas commented 1 month ago

Customer request for finding valuable non-current posts

Are there any Nostr clients that don't have such a present bias? I'd like to see older posts that have been popular and continue to get engagement as that's probably the most evergreen content.

Wisdom > hot takes.

https://damus.io/nevent1qqsg392vpmf2gpameeh5el5ryg0qyhwev8u78y44whh3482qx4my3ncpp4mhxue69uhkummn9ekx7mqpzfmhxue69uhhqatjwpkx2urpvuhx2ucprpmhxue69uhhyetvv9ujuumwdae8gtnnda3kjctvqythwumn8ghj7un9d3shjtnrw4e8yetwwshxv7tf6zkgj0