Processors

Activity processors enable you to do additional processing on activities after they are posted.

Supported activity processors:

TypeDescription
text_interest_tagsAnalyzes text content to extract topics
image_interest_tagsAnalyzes image attachments to extract topics
og_metadata_enrichmentAnalyzes Open Graph (OG) metadata of links in activity text to extract topic

Processors use AI to extract topics from the given sources.

The topics of an activity are stored in the interest_tags field.

Topic information can be used to query activities or filter feeds based on topics.

Activity topics enable the Stream API to automatically compute users' interests (what activities a user interacts with). A user's interest can be used as input for activity selectors and ranking.

Topics can also be set explicitly with the create and update activity endpoints.

Setting up activity processors

You can set up activity processors on the feed group level:

create_response = self.client.feeds.create_feed_group(
    id=feed_group_id,
    default_visibility="public",
    activity_processors=[
        {"type": "text_interest_tags"},
        {"type": "image_interest_tags"},
    ],
)

You can also update built-in feed groups with activity processors:

response = self.client.feeds.update_feed_group(
    "myid",
    # Fields to update, e.g.:
    # activity_processors=[...],
    # activity_selectors=[...],
    # ranking={"type": "recency"},
    # custom={"description": "Updated feed group"},
)

Extraction thresholds

By default text_interest_tags runs on any activity that has text, however short. Very short posts tend to produce low-quality topics, and each one still costs an AI call. You can require a minimum amount of text before extraction runs:

FieldDescription
min_text_lengthMinimum number of characters the activity text must have. 0 (the default) disables it
min_word_countMinimum number of words the activity text must have. 0 (the default) disables it

Both default to 0, so leaving them unset preserves the existing behaviour. When both are set, an activity must clear both to be processed. An activity below the threshold is stored as normal and keeps whatever interest_tags it was created with — no AI call is made for it, and no feeds.activity.updated event is emitted for topics.

The right threshold depends on your content: a handful of words can still be meaningful in some apps, so these are yours to tune rather than a fixed platform default.

Both fields apply only to text_interest_tags, the only processor that reads activity text.

create_response = self.client.feeds.create_feed_group(
    id=feed_group_id,
    default_visibility="public",
    activity_processors=[
        {
            "type": "text_interest_tags",
            "min_text_length": 40,
            "min_word_count": 5,
        },
    ],
)

Notification activities

Activity processors never run on notification activities — the activities generated in a notification feed by follows, comments, reactions and mentions. They are created by the notification pipeline rather than the activity-creation path that runs processors, so they are never sent to an AI model and never receive interest_tags, regardless of what the notification feed group configures.

Reading topics

Whenever a new activity is posted, the processors will run. Interest topics are not computed instantly; they are added with the feeds.activity.updated event.

response = self.client.feeds.add_activity(
    type="post",
    feeds=[self.test_feed.get_feed_identifier()],
    text="This is a test activity from Python SDK",
    user_id=self.test_user_id,
    custom={
        "test_field": "test_value",
        "timestamp": int(datetime.now().timestamp()),
    },
)