Skip to content

Recommendation

Combines user activity context with Ocean WASM algorithms to suggest activities and articles.

Activity Scoring (Ocean)

Formula (conceptual):

text
score = 0.6 * keyword_jaccard + 0.4 * type_similarity

Article Scoring

  • Base relevance (reranker score)
  • Novelty (recent created_at boost)
  • Diversity penalty if too similar to prior suggestions

Endpoints

  • GET /users/recommend_activities
  • GET /users/recommend_articles

Response Example

Activity Recommendations:

json
{
	"items": [
		{
			"id": "000000000000001234567890",
			"name": "Morning Run",
			"types": ["SPORT", "HEALTH"],
			"score": 0.87,
			"reason": "Matches your interest in outdoor activities"
		},
		{
			"id": "000000000000001234567891",
			"name": "Meditation",
			"types": ["RELAXATION", "HEALTH"],
			"score": 0.78,
			"reason": "Popular among users with similar interests"
		}
	],
	"total": 2
}

Article Recommendations:

json
{
	"items": [
		{
			"id": "000000000000002345678901",
			"title": "Circadian Rhythm Research",
			"score": 0.92,
			"reason": "Based on your recent health activity"
		}
	],
	"total": 1
}

Performance

  • Batch scoring in WASM memory
  • Memoize keyword sets per user session
  • Limit output to top N (default 10)

Errors

  • 401 Unauthorized
  • 429 Too Many Requests