What adapts today
Every retriever adapts in two ways with no configuration, and in a third when you turn on learned fusion:The query optimizer
Filtered search strategy
Auto-Tune
Learned fusion (Auto-Tune)
Auto-Tune (learned fusion) sets a retriever’s fusion weights, such astext: 0.7, image: 0.3, from how users interact with results. The feature search stage learns which embedding features produce results people click, buy or rate well, and it learns this per user with Thompson Sampling, a multi-armed bandit algorithm. Users without enough history fall back to segment-level weights, then to weights learned across all users.
How learned fusion works
Each feature search in the stage (for example a text embedding and an image embedding) is one arm of the bandit. Each arm has a Beta(alpha, beta) distribution that describes how well that feature has served this user so far.A query arrives with a user ID
user_id from the query inputs and looks up the stored interactions for that user. If the user has too few, it uses the user’s segment or all users instead (see Hierarchical fallback).Weights are sampled
Results are fused with those weights
1 / (1 + rank). A feature’s share of the page roughly follows its weight, and equal weights interleave the features.The user interacts
feature_uri of the result. The API turns the interaction types into a single reward using the retriever’s reward_map.The distributions update
alpha, and a negative reward adds its absolute value to beta. A reward of 0 (for example an impression under the default map) changes neither. Older interactions count for less (see Temporal decay).The next query uses the updated weights
Quick start
Learned fusion needs a feature search stage with at least two searches. With fewer, the API rejects the retriever, since there is nothing to weight.1. Create a retriever with learned fusion
"fusion": "learned" without a learning_config, the stage uses a learning_config with every default from the configuration reference.
2. Execute with a user ID
execution_id, each result’s document_id, and each result’s feature_uri, which names the feature that contributed most to that result’s fused score. You send these back in step 3. The response also carries learned_fusion_context (see Response metadata).
3. Post interactions
When a user engages with a result, post an interaction with the result’sdocument_id (as feature_id), its feature_uri, and the execution_id of the search:
execution_id, feature_id and interaction_type as one recorded in the previous 5 minutes is not stored. The response returns deduplicated: true and no interaction_id.
The Python SDK can build the interaction from an execute response. Pass feature_uri when the retriever fuses more than one feature: without it the helper warns and sends none, and the server then leaves the weights unchanged.
user_456 has min_interactions stored interactions on this retriever, their searches use personal weights. If they keep engaging with text-matched results over image-matched ones, the text feature’s weight rises for their queries.
Key concepts
What learned fusion optimizes
Learned fusion learns one weight per feature. Each feature URI is an arm of the bandit, and its state is a Beta distribution for that feature. The system keeps no state per document. A click changes feature weights, and every document is then scored from its rank in each feature under the new weights. A document that ranks low in every feature cannot be lifted by clicks. To change how individual documents rank, add a Rerank stage, which re-scores each document against the query.Thompson Sampling
Think of each feature as a weighted coin. At the start every coin is fair: you have no idea which feature is better, so each gets an equal share. As users click text-matched results more than image-matched ones, the text coin lands heads more often and with less variance, so text gets the larger weight on most queries while image is still tried on some. Each coin is a Beta(alpha, beta) distribution:alpha = 1 +the decayed sum of positive rewards for the featurebeta = 1 +the decayed sum of the absolute values of negative rewards
exploration_bonus and exploration_decay adjust how wide the samples are (see Exploration decay).
Rewards
The interactions API turns the types in one interaction into a single reward. It looks up each type in the retriever’sreward_map, keeps the value with the largest absolute size (sign preserved), and clamps it to ±max_reward_per_interaction. With the quick start’s map, ["click", "purchase"] gives 3.0 and ["click", "negative_feedback"] gives -2.0. A type missing from the map contributes 0.0. See Multi-signal rewards.
Hierarchical fallback
Not every user has enough history for personal weights. The stage resolves weights from the first level that has data:retriever_id and a feature_uri the stage searches.
- Personal uses the
user_idinput. IncludeINPUT.user_idincontext_featuresand declareuser_idin the retriever’sinput_schema. A request without auser_idskips this level. - Demographic uses the fields in
demographic_features, such as["INPUT.user_segment"]. It matches interactions whosemetadataholds the same value under the same field name, so send the segment inmetadataor inquery_snapshot. This level reads interactions from the analytics store; where analytics is not enabled, lookup goes from personal to global.
context_level reads session (see Session-level adaptation).
Response metadata
When learned fusion runs, the execute response carries a top-levellearned_fusion_context object. Use it to confirm personalization is active and to watch the weights change:
skip response the object carries gate, gate_reason, served_fusion, rollout_pct and rollout_skip instead of weights. Rollout and safety covers reading these and the execution profile.
Configuration reference
fusion must be "learned", and searches must hold at least two entries. Each searches[].feature_uri is one arm of the bandit. The learning_config object sits in the feature search stage’s parameters next to fusion. Every field is optional.
reward_map:
Complete learning_config example
Every settable field at its default. Put it in the feature search stage’s parameters next to fusion: "learned" and change only what you need:
Advanced controls
Session-level adaptation
The stage builds weight state from stored interactions. With analytics enabled it reads them from the analytics store. Without it, it reads the namespace’smxp_retriever_interactions collection and caches the aggregate for 60 seconds, so a new click can take up to a minute to reach the weights.
For adaptation within a session, the interactions API also writes each interaction that has a session_id and a feature_uri to a session cache that expires after 1 hour. On the next search with the same session_id, the stage adds the session’s rewards to the stored distributions before sampling:
session_id in the execute inputs and on each interaction, and send retriever_id on the interaction so it matches the retriever being searched. session_id is accepted as an input on any retriever with a learning_config, without declaring it in input_schema:
occurred_at) do not go to the session cache.
session_id, the stage still learns from interactions. They reach the weights on the next read of the stored aggregate instead of on the next search.Temporal decay
User preferences change over time, so older interactions count for less:decay_factor of 0.995:
decay_factor(default0.995): per-day multiplier.1.0turns decay off.decay_window_days(default365): interactions older than this are ignored.
occurred_at decay by their real age.
Weight clamping
Sampling can produce extreme weights that all but remove a feature, such astext: 0.99, image: 0.01. Clamping bounds each weight:
[min_weight, max_weight] and the set is re-normalized to sum to 1. Re-normalizing can move a weight slightly past a bound when several weights were clamped, but every feature keeps a share of the results.
This matters for recovery. Without clamping, a user who clicks only text results could end up with image: 0.01. If their preferences shift later, recovery is slow because image results would almost never be shown, and so almost never clicked.
Exploration decay
exploration_bonus sets how widely the bandit samples. A fixed bonus keeps the samples equally wide forever, so exploration decay shrinks it as interactions accumulate:
alpha and beta by effective_exploration before sampling. Values above 1 widen the distributions (more exploration) and values below 1 narrow them (more exploitation).
exploration_bonus(default1.0): starting multiplier.exploration_decay(default0.99): per-interaction decay.exploration_floor(default0.1): lowest value the multiplier reaches.
1.0 * 0.99^100 = 0.37. After 500 it would be 0.007, so the floor of 0.1 applies. total_interactions is the interaction count of the level that supplied the weights, which learned_fusion_context reports as interaction_count.
Multi-signal rewards
reward_map gives each interaction type its own reward:
alpha, making it more likely to get a higher weight. Negative values add to its beta. A purchase at 3.0 moves the distribution three times as far as a click at 1.0. When one interaction lists several types, only the type with the largest absolute reward counts.
Each reward is capped at max_reward_per_interaction (default 5.0), so a single interaction cannot dominate the learned weights. Without a reward_map, the default map shown in the configuration reference applies.
See Reward signals for the supported interaction types and how to choose values.
When to use learned vs static
Roll out learned fusion safely
Start in shadow mode, ramp traffic in steps, watch the metrics below, and turn learned fusion off with one config change if results get worse.Traffic splitting
Therollout_pct field controls what percentage of requests use learned fusion weights. The rest fall back to static fusion (RRF by default).
user_id, or of session_id when there is no user_id. A request with neither is bucketed at random, so it gets learned weights with probability rollout_pct.Changing the rollout
rollout_pct lives in the feature search stage’s learning_config, so you change it by updating the retriever. Send the retriever’s stages with that stage’s learning_config edited; the next request uses the new value, with no redeploy.
learning_config) as they are today: the stage is replaced by what you send. In the Studio, the Learning tab rollout slider makes this update for you.
Shadow mode
Shadow mode computes learned fusion weights and logs what the results would have been, but serves static fusion results to the user. This lets you evaluate the quality of learned fusion before it affects real users.- Both fusion strategies execute in parallel
- Static fusion results are served to the user
- Learned fusion weights and re-ranked results are logged as
shadow_executionmetadata - The evaluation system can compare shadow vs. served results offline
learned_fusion_context field (when shadow mode is active) so you can inspect what weights would have been used:
Turning learned fusion off
Setrollout_pct to 0 with the same update. Every request then uses static fusion, and the rest of learning_config and the accumulated interaction history stay as they are, so setting the percentage back resumes where it left off.
Seeing which weights served a search
Each execution records the learned-fusion arm that served it aslearned_fusion_context: the gate it took (serve, shadow or skip), the context level (personal, demographic, global), the sampled weights and the user. It is in the execute response and stored on the execution’s profile:
POST /v1/retrievers/{retriever_id}/executions/list and read each one’s profile to see weights per feature over time, or every execution served to one user_id.
Weight bounds
Even with strong personalization data, individual feature weights are clamped to prevent degenerate rankings:[min_weight, max_weight] and re-normalized to sum to 1.0. This means even a user with extreme interaction patterns will always see results influenced by all configured features.
Circuit breaker
If learned fusion weight resolution takes too long (slow signal reads, Redis issues, or high load), that request is fused with equal weights for every feature instead of learned weights, and the response’s top-levelwarnings says so:
circuit_breaker_timeout_ms field in learning_config (range 1–30000ms).
The circuit breaker is per-request, not per-retriever. A single slow request does not disable learned fusion for everyone. The response’s learned_fusion_context metadata indicates when a fallback occurred:
context_level of "none" with circuit_breaker_triggered: true indicates the circuit breaker fired and uniform priors were used. The weight_resolution_ms field shows the actual resolution time. Monitor the mxp_learned_fusion_circuit_breaker_total Prometheus metric to detect systemic latency issues.
Recommended rollout plan
Shadow mode (1-2 weeks)
shadow_mode: true with rollout_pct: 100. All users get static results, but learned fusion runs in parallel and logs what it would have returned.Check: Run evaluations comparing shadow vs. served results. Learned fusion NDCG should be equal to or better than static.1% canary (1 week)
shadow_mode: false, rollout_pct: 1.0. A small fraction of users get learned fusion.Check: Monitor click-through rates and circuit breaker triggers. No degradation vs. control group.10% ramp (1 week)
rollout_pct: 10.0. Enough traffic to produce statistically significant comparisons.Check: Run a benchmark comparing learned vs. static. Expect learned fusion to show improvement for users with sufficient interaction history.50% ramp (1 week)
rollout_pct: 50.0. Half of users get personalized results.Check: Monitor weight distributions across users. Look for convergence patterns (weights stabilizing) rather than oscillation.100% GA
rollout_pct: 100.0. All users get personalized fusion weights, with hierarchical fallback for new users.Check: Keep evaluations running on a schedule to catch regressions. Set up alerts for high global fallback rates and circuit breaker storms.- Set
rollout_pct: 0to serve static fusion to everyone - Investigate a specific user through the
learned_fusion_contexton their executions’ profiles - Check whether the issue is global (bad reward map) or user-specific (outlier behavior)
- Adjust the
learning_configand restart from the previous step
Per-query pipeline selection
You keep your retriever as it is and add up to two candidate pipelines to it, for example a fast keyword-only pipeline and a thorough one with reranking. For each query, Mixpeek picks the pipeline that did best for your goal on queries like it in your own evaluation data. When no candidate has proven itself for that kind of query, your saved stages run.How it works
You add candidate pipelines
planner block, next to its normal stages. Saving one sends no traffic to it. Your normal stages are always the default.You pick a goal and an evaluation dataset
optimize_for (quality, balanced, speed or cost) and point the planner at a judged evaluation dataset for this retriever.Mixpeek evaluates every pipeline
It confirms a choice per kind of query
Each query runs the confirmed choice
Which pipeline runs
Mixpeek runs these checks for every query, in order. The first check that answers yes decides which pipeline runs.What you control
Configure it
- Retriever
- Request
- Response
shadow: the planner decides and logs what it would run while your default keeps serving. Switch to on when the logged decisions look right.Read the routing block
routing.source tells you who chose the pipeline:
reason_codes explains the reason:
What it promises
It never experiments on your live traffic
It never experiments on your live traffic
It leaves your default only on evidence
It leaves your default only on evidence
Budgets are limits
Budgets are limits
Billing does not change
Billing does not change
Your settings win
Your settings win
plan_id sent in the request, and adaptation: off always take precedence over what the planner learned, and the response marks them as your choice.Your data stays yours
Your data stays yours

