Jan 4, 2024
Core APIs
Get Recommendations
After creating a datastore and training a model, actually get recommendations
4.4 Get Recommendations
Leora offers two distinct recommendation modes:
4.4.1 User-Based Recommendations
Retrieve personalized suggestions based solely on a user’s historical interactions and profile features.
Endpoint
Query Parameters
user_id
(string, required)top_k
(integer, default: 10)filters
(JSON string, optional)explanations
(boolean, defaultfalse
)
Response
Use case: Known users with established history; leverages full profile and long-term behavior.
4.4.2 Session-Based Recommendations
Generate recommendations based on the current session’s activity sequence, ideal for anonymous or new users.
Endpoint
Query Parameters
session
(array of item IDs, required)top_k
(integer, default: 10)filters
(JSON string, optional)explanations
(boolean, defaultfalse
)
Response
Use case: Anonymous browsing, new visitors without saved history, or context-driven sessions.
Performance: Both endpoints maintain 50–200 ms (95th percentile) latency with standard quotas (1000 requests/minute).