Skip to main content
Start a photo search with fixed fusion weights, send click signals back, and let learned fusion tune the weights per user. Each photo is searched by its image and by its caption, and the retriever learns which of the two your users trust.

Jump to the manifest

feedback-loop.namespace.yaml: apply it with one API call, then read the walkthrough below to change it.

At a glance

How the pieces connect

Buckets hold what you upload, collections turn it into searchable documents, and retrievers answer queries over the collections.

Deploy it

1

Get the manifest

2

Validate it

Validate runs every check apply runs and creates nothing. Fix each entry in errors, then run it again.
3

Apply it

Apply creates every resource in one call. wait_for_seed=true also waits until the sample objects are processed, so the first query below has documents to return.
The response lists each resource with its outcome in resources. Apply refuses a resource that already exists and rolls the whole apply back, so to apply the file again over this namespace add ?mode=create_missing, which creates only what is missing.

Run the first query

Look up the namespace id by name, then run photo-search. Check status and warnings along with documents: a run that times out still answers 200, with status degraded.

Add your own data

Each object you add to a bucket is processed by every collection that reads it. This adds one object to photos. NAMESPACE_ID is the id from the namespace lookup above.
The object is PENDING until processing finishes, then COMPLETED or FAILED. Buckets and objects covers object states, retries and duplicates.

Retrievers

Describe a photo in words and get back the photos that match, ranked by what the image shows and what its caption says, fused with fixed weights. Stages: feature_search Searches: photo-visual, photo-captions

Collections

Each collection runs one extractor over a bucket, or over another collection’s documents.
image_extractor@v1 over bucket photos: one document per photo, embedded by SigLIP (768 dimensions). The visual arm of photo-search.Reads bucket photos with image_extractor v1.Inputs: image ← imageCopied onto each document: title, caption
text_extractor@v1 over bucket photos: one document per caption, embedded as text. The caption arm of photo-search.Reads bucket photos with text_extractor v1.Inputs: text ← captionCopied onto each document: title

The manifest

Every resource above comes from this file. Change it and apply it again with ?mode=upsert to update what exists. Manifests documents each field.
feedback-loop.namespace.yaml

Hand it to an agent

Paste this prompt into Claude Code, Cursor or another coding agent. To give the agent this whole page instead, use Copy page in the menu at the top of the page, or point it at the page’s Markdown at https://mixpeek.com/docs/templates/feedback-loop.md.
Prompt

How it works

Each photo is searched by two arms: photo-visual holds a SigLIP embedding of the image, which a text query can match, and photo-captions a text embedding of the caption, which names places and context the pixels do not show. photo-search sends the query to both in one feature_search stage. Learned fusion keeps one weight per feature URI, which is why the arms come from two extractors: two searches on one URI share one weight and give the learner nothing to choose between. The stage starts with fixed weights, 0.6 visual and 0.4 caption:
  • fusion: dbsf scales each arm’s scores to 0 to 1 before weighting, since SigLIP and the text model score on different scales.
  • fuse_on: source_object adds up evidence per bucket object. A photo found by both arms comes back once.
  • user_id and user_segment are declared in input_schema now, unused, so switching to learned fusion later changes no inputs.
These weights are the baseline to beat. Each change below is an edit to the manifest; apply it again with ?mode=upsert. A published retriever keeps its stages, so clone it to change them.

Send interaction signals

Send an interaction each time someone clicks, saves or rejects a result. This runs a search as one user and records a click on the top result:
cURL
Under the static stage, documents carry no feature_uri, so these clicks only feed the evaluation dataset below. Under learned fusion, each document carries the feature_uri of the arm that contributed most, and the same code sends it. POST /v1/retrievers/interactions/batch takes a list.

Switch to learned fusion

Change fusion to learned and add a learning_config. Learned fusion samples a weight per arm from what users rewarded.
photo-search stages, learned fusion
  • weight and fuse_on are gone; learned fusion does not read them. It merges by document, so a photo found by both arms can come back twice.
  • learning_config can be {}: per-user context on INPUT.user_id, Thompson sampling and the default reward map. The stage needs at least 2 searches.
With no interactions yet, every arm starts at a uniform Beta(1, 1) prior, so the first searches explore.

Cold start and user context

Each search uses the most specific context with enough history, in this order (fallback_strategy: hierarchical, the default): fallback_strategy: global skips the demographic step; context_features: [] learns one global set. Every execute response under learned fusion carries learned_fusion_context, with gate (serve, shadow or skip), sampled_weights, context_level, interaction_count and weights_source:
cURL

Weight the reward signals

reward_map sets how much each interaction type is worth to the arm that found the result. By default purchase earns 3.0, add_to_cart and positive_feedback 2.0, click 1.0, skip -0.5 and negative_feedback -2.0; Tune relevance lists every type. For a photo library, weight downloads above clicks:
photo-search learning_config, custom rewards
A reward_map you set replaces the default map. A type you leave out earns 0. Every key must be a valid interaction_type, or saving the retriever fails.
max_reward_per_interaction (default 5.0), decay_factor (0.995 per day of age) and decay_window_days (365) bound how rewards add up.

Roll out safely

1

Shadow mode

Weights are sampled and recorded with gate: shadow; results are ranked by rrf.
photo-search learning_config, shadow mode
2

Serve a share of traffic

Turn shadow mode off and set rollout_pct. The split hashes user_id, so one user always lands on the same side.
photo-search learning_config, 10 percent rollout
3

Ramp up or turn it off

Raise rollout_pct to 100 once the evaluation below holds up. rollout_pct: 0 turns it off and keeps its settings.
Searches outside the rollout and in shadow mode are ranked by rrf with no weights. Their documents carry no feature_uri, so clicks on them do not train the learner.
If learned weights take longer than circuit_breaker_timeout_ms (default 1000), the search falls back to static fusion.

Watch the weights converge

Each execution keeps its learned_fusion_context:
cURL
Weights converge when they move less between searches as interaction_count grows. A weight near the 0.95 ceiling means users rarely act on the other arm’s results.

Measure learned against static

generate-from-interactions builds a dataset from queries with at least min_interactions positive interactions (default 5; use 1 for a few test clicks). candidates then scores several stage lists without saving them and returns one evaluation_id per candidate. Poll each until status is completed and compare overall_metrics, such as ndcg_at_10.
cURL
Learned fusion samples new weights on each search, so run the learned candidate more than once before you read a small gap as a win.

Let the evaluation gate ship weights

Name the dataset (id or name) in learning_config.evaluation_dataset_id. On its evaluation schedule the platform trains a fixed weight set from this retriever’s interactions and ships it only when it beats the live configuration on the dataset.
photo-search learning_config, evaluation gate
A shipped set appears as the read-only learning_config.shipped_weight_set, and searches report context_level: shipped. A refused set leaves the retriever unchanged.

Next steps

Tune relevance

Interactions, fusion strategies and evaluations.

Feature Search

Every search, fusion and learning option for the stage this retriever uses.