Feed Configs
A feed config bundles one or more algorithms with weights, fallbacks, cache settings, and exclusion rules. It's the bridge between your algorithm code and production serving.
Overview
After you've built and tested an algorithm (using the pipeline in [Search](../Building Algorithms/search) → [Features](../Building Algorithms/algo-features) → [Scoring & Ranking](../Building Algorithms/algo-scoring-ranking)), you save it as a feed algorithm. Then you create a feed config that defines:
- Which algorithms run and how their results are interleaved
- What happens when an algorithm fails (fallback chain)
- How long results are cached
- How many items per page
- Which items to exclude
You create feed configs in the Console or via the API. The output is a config_id you pass to the Serve endpoint.
Algo A ──┐
├── Feed Config (config_id: 104) ──→ POST /deploy/serve
Algo B ──┘
Multi-Algorithm Interleaving
When your config has multiple algorithms, results are interleaved by weight:
{
"main_algos": [
{ "algo_id": 42, "weight": 0.6 },
{ "algo_id": 43, "weight": 0.4 }
]
}Items from each algorithm are merged in order, maintaining each algorithm's internal ranking while respecting the weight ratio. [0.6, 0.4] means 60% of items come from the first algorithm and 40% from the second.
Common Patterns
| Pattern | Algo A | Algo B | Why |
|---|---|---|---|
| Trending + personal | Global trending (60%) | User-personalized (40%) | Mix discovery with relevance |
| Cross-index | Farcaster posts (70%) | Zora coins (30%) | Multi-content-type feed |
| Safe A/B test | Proven algo (80%) | Experimental algo (20%) | Test new logic with low risk |
Fallback Chain
If an algorithm fails or times out, fallbacks keep the feed alive:
{
"main_algos": [
{ "algo_id": 42, "weight": 0.6 },
{ "algo_id": 43, "weight": 0.4 }
],
"primary_fallback": 42,
"secondary_fallback": 44
}main_algos (42 + 43 interleaved)
│ fails or times out
▼
primary_fallback (algo 42 alone)
│ fails
▼
secondary_fallback (algo 44)
Each level has its own cache TTL.
Cache Settings
Algorithm results are cached to reduce latency and compute costs:
{
"main_algos": [
{ "algo_id": 42, "weight": 0.6 },
{ "algo_id": 43, "weight": 0.4 }
],
"main_max_cache_age_s": 3600,
"primary_fallback": 42,
"primary_fallback_max_cache_age_s": 7200,
"secondary_fallback": 44,
"secondary_fallback_max_cache_age_s": 600,
"building_timeout_ms": 300
}| Parameter | Default | Description |
|---|---|---|
main_max_cache_age_s | 7200 | Cache TTL for main results (seconds) |
primary_fallback_max_cache_age_s | 7200 | Cache TTL for primary fallback |
secondary_fallback_max_cache_age_s | 600 | Cache TTL for secondary fallback |
building_timeout_ms | 150 | Max ms to wait for a fresh build before serving cached results |
Recommended TTLs
| Use case | main_max_cache_age_s |
|---|---|
| Fast-moving markets (crypto, sports) | 300–600 (5–10 min) |
| Social feeds (Farcaster, Zora) | 1800–3600 (30–60 min) |
| Discovery / explore feeds | 7200 (2 hours, the default) |
| Editorial / curated content | 14400+ (4+ hours) |
When you update an algorithm, cached results continue serving until the TTL expires. Use the cache clear endpoint to force a refresh.
Cold Starts
If building takes longer than building_timeout_ms, the API returns an empty feed rather than blocking. This typically happens on first serve for a new user. See Handling cold starts for retry patterns.
Page Size
Controls items per page when serving:
{
"main_algos": [{ "algo_id": 42, "weight": 1.0 }],
"page_size": 25
}The initial /deploy/serve call returns page 1. Fetch more via /deploy/serve/page. See Serving for the full pagination flow.
Exclusion Rules
Remove items matching specific criteria at serve time, without modifying algorithm code:
{
"main_algos": [{ "algo_id": 42, "weight": 1.0 }],
"page_size": 25,
"exclusion_rules": []
}Exclusion rules are evaluated after algorithms run and before items are paginated. Multiple rules use OR logic — an item is excluded if it matches any rule.
Where to Filter
| Approach | Where | When to use |
|---|---|---|
Search filters (include/exclude) | Algorithm code | Hard requirements — items that should never be candidates |
Ranking diversity (limitByField) | Algorithm code | Variety in ranked output |
| Exclusion rules | Feed config | Business rules you want to change without redeploying algorithms |
Creating a Feed Config
Via the Console
- Go to the Console
- Navigate to the Feed Config section
- Select your algorithms and set weights
- Configure fallbacks, cache TTLs, and page size
- Save — note your
config_id
Via the API
const response = await fetch('https://api.mbd.xyz/v3/studio/deploy/configs', {
method: 'POST',
headers: {
'Authorization': 'Bearer mbd-YOUR_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Polymarket Trending + Personal',
description: 'Blends trending markets with user-personalized picks',
is_public: false,
feed_config: {
main_algos: [
{ algo_id: 42, weight: 0.6 },
{ algo_id: 43, weight: 0.4 }
],
primary_fallback: 42,
secondary_fallback: 44,
building_timeout_ms: 300,
main_max_cache_age_s: 3600,
page_size: 25,
exclusion_rules: []
}
})
})
const { config_id } = await response.json()Previewing Before Saving
Test config changes without creating a permanent record:
const preview = await fetch('https://api.mbd.xyz/v3/studio/deploy/preview', {
method: 'POST',
headers: {
'Authorization': 'Bearer mbd-YOUR_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
config: {
main_algos: [
{ algo_id: 42, weight: 0.7 },
{ algo_id: 43, weight: 0.3 }
],
page_size: 25,
building_timeout_ms: 300
},
inputs: { farcasterFid: '16085' }
})
})The preview response is identical to a serve response — you get a served_id and can paginate.
Managing Configs
| Action | Method | Endpoint |
|---|---|---|
| List all configs | GET | /v3/studio/deploy/configs |
| Get a config | GET | /v3/studio/deploy/configs/{id} |
| Update a config | PUT | /v3/studio/deploy/configs/{id} |
| Delete a config | DELETE | /v3/studio/deploy/configs/{id} |
Updating a config does not clear cached results. Clear the cache to see changes immediately.
What's Next
- Serving → — Serve feeds in production with pagination, new items, and cache management
- Feed Deployment Status → — Understand warmup tiers (Draft, Group, Live)
- API Reference: Feed Configs — Full endpoint specifications
Updated 8 days ago
Learn how to serve feeds in production
