# Processors

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

Supported activity processors:

| Type                     | Description                                                                  |
| ------------------------ | ---------------------------------------------------------------------------- |
| `text_interest_tags`     | Analyzes text content to extract topics                                      |
| `image_interest_tags`    | Analyzes image attachments to extract topics                                 |
| `og_metadata_enrichment` | Analyzes 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](/activity-feeds/docs/go-golang/query-activities/#activities-queryable-built-in-fields) or [filter feeds](/activity-feeds/docs/go-golang/feeds/#filtering-examples) 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](/activity-feeds/docs/go-golang/activity-selectors/#interest-activity-selector) and [ranking](/activity-feeds/docs/go-golang/custom-ranking/#interest-weights).

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:

<Tabs>

```js label="Node"
const response = await serverClient.feeds.createFeedGroup({
  id: "myid",
  activity_processors: [
    { type: "text_interest_tags" },
    { type: "image_interest_tags" },
  ],
});
```

```go label="Go"
response, err := client.Feeds().CreateFeedGroup(context.Background(), &getstream.CreateFeedGroupRequest{
    ID: "myid",
    ActivityProcessors: []getstream.ActivityProcessorConfig{
        {Type: "text_interest_tags"},
        {Type: "image_interest_tags"},
    },
})
if err != nil {
    log.Fatal("Error creating feed group:", err)
}
```

```php label="php"
$createResponse = $feedsClient->createFeedGroup(
    new GeneratedModels\CreateFeedGroupRequest(
        id: $feedGroupId,
        defaultVisibility: 'public',
        activityProcessors: [
            ['type' => 'text_interest_tags']
        ]
    )
);
```

```csharp label="C#"
var createResponse = await _feedsV3Client.CreateFeedGroupAsync(new CreateFeedGroupRequest
{
    ID = feedGroupId,
    DefaultVisibility = "public",
    ActivityProcessors = new List<ActivityProcessorConfig>
    {
        new() { Type = "text_interest_tags" }
    }
});
```

```python label="Python"
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"},
    ],
)
```

```ruby label="Ruby"
require 'getstream_ruby'

client = GetStreamRuby.manual(
  api_key: 'api_key',
  api_secret: 'api_secret'
)

create_request = GetStream::Generated::Models::CreateFeedGroupRequest.new(
  id: 'myid',
  activity_processors: [
    GetStream::Generated::Models::ActivityProcessorConfig.new(type: 'text_interest_tags'),
    GetStream::Generated::Models::ActivityProcessorConfig.new(type: 'image_interest_tags')
  ]
)

create_response = client.feeds.create_feed_group(create_request)
```

</Tabs>

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

<Tabs>

```js label="Node"
await client.feeds.updateFeedGroup({
  id: "<id of feed group to update>",
  // Fields to update
});
```

```go label="Go"
_, err = client.Feeds().UpdateFeedGroup(context.Background(), "myid", &getstream.UpdateFeedGroupRequest{
    // Fields to update
})
if err != nil {
    log.Fatal("Error updating feed group:", err)
}
```

```php label="php"
use GetStream\GeneratedModels\UpdateFeedGroupRequest;

// Create update request
$updateRequest = new UpdateFeedGroupRequest(
    // Fields to update
    // activityProcessors: [...],
    // activitySelectors: [...],
    // ranking: new RankingConfig(...),
    // custom: (object) [...]
);

// Update the feed group
$response = $feedsClient->updateFeedGroup("myid", $updateRequest);
```

```rb label="Ruby"
require 'getstream_ruby'

update_request = GetStream::Generated::Models::UpdateFeedGroupRequest.new(
  # Fields to update, e.g.:
  # activity_processors: [...],
  # activity_selectors: [...],
  # ranking: GetStream::Generated::Models::RankingConfig.new(...),
  # custom: { ... }
)

response = client.feeds.update_feed_group("myid", update_request)
```

```java label="Java"
import io.getstream.services.FeedsImpl;
import io.getstream.models.*;

FeedsImpl feedsClient = new FeedsImpl(new StreamHTTPClient("<API key>", "<API secret>"));

UpdateFeedGroupRequest request = UpdateFeedGroupRequest.builder()
    // Fields to update, e.g.:
    // .activityProcessors(List.of(...))
    // .activitySelectors(List.of(...))
    // .ranking(RankingConfig.builder().type("recency").build())
    // .custom(Map.of("description", "Updated feed group"))
    .build();

UpdateFeedGroupResponse response = feedsClient.updateFeedGroup("myid", request).execute().getData();
```

```csharp label="C#"
var request = new UpdateFeedGroupRequest
{
    // Fields to update, e.g.:
    // ActivityProcessors = new List<ActivityProcessorConfig> { ... },
    // ActivitySelectors = new List<ActivitySelectorConfig> { ... },
    // Ranking = new RankingConfig { Type = "recency" },
    // Custom = new Dictionary<string, object> { ["description"] = "Updated feed group" }
};

var response = await _feedsV3Client.UpdateFeedGroupAsync("myid", request);
```

```python label="Python"
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"},
)
```

</Tabs>


### 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.

<Tabs>

```swift label="Swift"
try await feed.addActivity(
    request: .init(
        text: "check out my 10 fitness tips for reducing lower back pain",
        type: "post"
    )
)
// Wait for feeds.activity.updated event
print(activity.interestTags) // ["fitness", "health", "tips"]
```

```kotlin label="Kotlin"
feed.addActivity(
    request = FeedAddActivityRequest(
        text = "check out my 10 fitness tips for reducing lower back pain",
        type = "post"
    )
)
// Wait for feeds.activity.updated event
println(activity.getOrNull()?.interestTags) // ["fitness", "health", "tips"]
```

```js label="JavaScript"
await feed.addActivity({
  type: "post",
  text: "check out my 10 fitness tips for reducing lower back pain",
});

// Wait for feeds.activity.updated event
console.log(activity.interest_tags); // ["fitness", "health", "tips"]
```

```js label="React"
await feed.addActivity({
  type: "post",
  text: "check out my 10 fitness tips for reducing lower back pain",
});

// Wait for feeds.activity.updated event
console.log(activity.interest_tags); // ["fitness", "health", "tips"]
```

```js label="React Native"
await feed.addActivity({
  type: "post",
  text: "check out my 10 fitness tips for reducing lower back pain",
});

// Wait for feeds.activity.updated event
console.log(activity.interest_tags); // ["fitness", "health", "tips"]
```

```dart label="Dart"
await feed.addActivity(
  request: const FeedAddActivityRequest(
    text: 'check out my 10 fitness tips for reducing lower back pain',
    type: 'post',
  ),
);

// Wait for feeds.activity.updated event
print(activity.interestTags); // ["fitness", "health", "tips"]
```

```js label="Node"
await client.feeds.addActivity({
  feeds: ["user:1"],
  type: "post",
  text: "check out my 10 fitness tips for reducing lower back pain",
  user_id: "<user id>",
});

// Wait for feeds.activity.updated event
console.log(activity.interest_tags); // ["fitness", "health", "tips"]
```

```go label="Go"
response, err := client.Feeds().AddActivity(context.Background(), &getstream.AddActivityRequest{
    Feeds:        []string{"user:john"},
    Type:         "post",
    Text:         getstream.PtrTo("check out my 10 fitness tips for reducing lower back pain"),
    UserID:       getstream.PtrTo("john"),
})
if err != nil {
    log.Fatal("Error adding activity:", err)
}

// Wait for feeds.activity.updated event
log.Printf("Activity created with ID: %s\n", response.Data.Activity.ID)
log.Printf("Interest tags: %v\n", response.Data.Activity.InterestTags) // ["fitness", "health", "tips"]
```

```java label="Java"
AddActivityRequest activity =
    AddActivityRequest.builder()
        .type("post")
        .feeds(List.of(testFeedId))
        .text("This is a test activity from Java SDK")
        .userID(testUserId)
        .build();

AddActivityResponse response = feeds.addActivity(activity).execute().getData();
```

```php label="php"
$activity = new GeneratedModels\AddActivityRequest(
    type: 'post',
    feeds: ['user:eric'],
    text: 'check out my 10 fitness tips for reducing lower back pain',
    userID: 'eric'
);
$response = $feedsClient->addActivity($activity);

// Wait for feeds.activity.updated event
$response->getData()->activity->interestTags // ["fitness", "health", "tips"]
```

```csharp label="C#"
var activity = new AddActivityRequest
{
    Type = "post",
    Text = "This is a test activity from .NET SDK",
    UserID = _testUserId,
    Feeds = new List<string> { $"user:{_testFeedId}" }
};
var response = await _feedsV3Client.AddActivityAsync(activity);
```

```python label="Python"
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()),
    },
)
```

</Tabs>


---

This page was last updated at 2026-05-22T16:31:46.546Z.

For the most recent version of this documentation, visit [https://getstream.io/activity-feeds/docs/go-golang/activity-processors/](https://getstream.io/activity-feeds/docs/go-golang/activity-processors/).