What Does This Endpoint Do?
This endpoint uses AI-powered recommendation algorithms to suggest relevant items to users. It combines vector embeddings with collaborative filtering techniques to provide personalized recommendations that go beyond simple similarity matching.When to Use Recommendations
You’ll find this endpoint useful when you need to:- Build recommendation systems: Create “Recommended for you” features for e-commerce, content platforms, or any application with items
- Personalize user experience: Show users items they’re likely to be interested in based on their behavior
- Increase engagement: Help users discover new content or products they might like
- Implement diverse recommendations: Avoid filter bubbles by showing varied suggestions
- Handle cold start problems: Provide recommendations even for new users with limited history
- Cross-sell and upsell: Suggest complementary or higher-value items
How It Works
- You provide a table and optionally a source item or user history
- The system analyzes vector embeddings and user interaction patterns
- It applies the specified recommendation strategy (similar, diverse, or popular)
- Results are returned with similarity scores and strategy metadata
Code Examples
Example 1: Item-to-Item Recommendations
This example shows how to generate recommendations based on a specific item.- Node.js
- Python
- Go
- cURL
Example 2: User History-Based Recommendations
This example shows how to generate recommendations based on a user’s interaction history.- Node.js
- Python
- Go
- cURL
Example 3: Diverse Recommendations
This example shows how to generate diverse recommendations to avoid filter bubbles.- Node.js
- Python
- Go
- cURL
Request Body Explained
Table to generate recommendations from.Example: “products”
Source item ID for item-to-item recommendations. Use this OR
user_history, not both.Example: “123”Array of record IDs the user has interacted with. Use this OR
record_id, not both.Example: [“123”, “456”, “789”]Recommendation strategy to use. Options: “similar”, “diverse”, “popular”. Default: “similar”.
similar: Find items similar to source or user historydiverse: Find varied items to avoid filter bubblespopular: Find popular items across all users
Maximum number of recommendations to return. Range: 1-100, default: 10.
Record IDs to exclude from recommendations (e.g., items user already has).Example: [“123”, “456”]
Response Fields Explained
true if recommendations were generated successfully, false otherwise.Array of recommended items, each containing:
record: The actual record datasimilarity: Similarity score (0-1) indicating recommendation strength_meta: Additional metadata including strategy and source information
Strategy used for generating recommendations.
Recommendation generation time in milliseconds.
Example Response
Common Errors and How to Fix Them
| Error | Cause | Solution |
|---|---|---|
| ”Table not found” | The specified table doesn’t exist | Check your table name for typos |
| ”No embeddings found” | The table doesn’t have vector embeddings | Ensure your table has been processed for embeddings |
| ”Record not found” | The specified record_id doesn’t exist | Check that the record ID exists in the table |
| ”Invalid strategy” | The strategy value is not supported | Use one of: “similar”, “diverse”, “popular" |
| "No user history provided” | Neither record_id nor user_history was provided | Provide either a record_id or user_history array |
| ”Unauthorized” | Invalid or missing API key | Check that you’re using a valid API key |
Tips for Better Recommendations
- Use appropriate strategies:
similar: For “More like this” featuresdiverse: To avoid filter bubbles and show varietypopular: For trending or top items
- Exclude already-interacted items: Use
exclude_idsto avoid recommending items users already have - Combine strategies: Use different strategies for different sections of your app
- Monitor similarity scores: Higher scores indicate stronger recommendations
- Test with different limits: Find the right number of recommendations for your use case
- Use user history: Provide user interaction history for more personalized results
Recommendation Strategies Explained
Similar Strategy
- Best for: “More like this”, “Related items”, “You might also like”
- How it works: Finds items with similar vector embeddings to the source
- Use case: When users want items similar to what they’re viewing
Diverse Strategy
- Best for: Discovery, avoiding filter bubbles, showing variety
- How it works: Finds items that are different from each other while still relevant
- Use case: When you want to show users new and varied content
Popular Strategy
- Best for: Trending items, top sellers, general recommendations
- How it works: Finds items that are popular across all users
- Use case: For new users or when you want to show trending content
Best Practices
- Start with similar strategy: Most users expect recommendations similar to what they like
- Use diverse for discovery: Help users find new content they might not have discovered
- Combine with user history: More interaction data leads to better personalization
- Exclude irrelevant items: Use
exclude_idsto avoid recommending inappropriate items - Monitor performance: Track which recommendations users actually engage with
- A/B test strategies: Experiment with different approaches to see what works best

