Perplexity has launched Photon, an in-house retrieval and rating engine written in Rust. It replaces an open-source engine Perplexity had forked for its AI-native search stack. Photon now handles retrieval and rating for all manufacturing visitors. It additionally powers a brand new Fast Search mode within the Perplexity Search API. Perplexity experiences single-call latency of 160 ms at p50 and 230 ms at p95.
Is it deployable? Sure, as a hosted API. Set search_type: "fast" on POST /search and pay $1 per 1,000 requests. Photon itself is just not open supply, so the engine can’t be self-hosted.
Why Perplexity Changed its Previous Engine
The previous engine hit 3 limits because the index grew:
- Tail latency: Manufacturing p99 sat close to 800 ms. The dataset exceeded RAM, so
mlockwas not an possibility. Chilly reads triggered main web page faults that stalled queries. - Merge spikes: Throughout disk index fusion, p99 climbed to about 1.2 s for 10 to fifteen minutes.
- Sluggish restoration: Deploying and syncing an additional cluster might take greater than per week. Restoration additionally raised the share of partial responses.
Perplexity workforce concluded that constructing from scratch was easier and cheaper than sustaining its fork.
How Photon Works
A load balancer routes every request to a Photon dealer. The dealer followers out to a shard group and watches for timeouts. Every shard runs retrieval, preliminary rating, and second-stage rating. The dealer then merges candidates and fetches key doc fields.
- Adaptive posting lists: Brief lists sit inline inside a single web page. Longer lists cut up into blocks of mounted doc ID ranges. Sparse blocks retailer sorted offset arrays and use galloping search. Dense blocks use bitmaps, so membership turns into a single bit lookup.
- Budgeted traversal: A WAND-like algorithm splits lists into driving lists and probe lists. Low cost presence checks certain every candidate’s most rating first. Precise time period frequencies are learn solely when a candidate can clear the edge.
- Docblob information: Every doc will get a compact document of frequencies, discipline masks, and positions. Phrases use Elias-Fano encoding, so rating decodes solely the matched phrases. Rating a candidate wants simply 1 lookup per doc.
- Batched async reads: Document offsets are recognized upfront, so disk reads exit in batches via
io_uring. The cache checks the entire batch first. Readers take no locks, and eviction makes use of CLOCK as an alternative of a shared LRU checklist. - Separate construct and serve: Indexers construct versioned shard indexes from YTsaurus tables on devoted nodes. A controller rotates serving teams one after the other and warms caches with replayed search-log queries.
A full internet index now builds in a single-digit variety of hours.
Interactive Explainer: Inside Photon
‘;
resize();return;
}
var nb=Math.min(12,Math.max(3,Math.spherical(Math.log10(n)*2)));
var g=doc.createElement(‘div’);g.className=”plist”;
for(var b=0;b
var el=doc.createElement(‘div’);el.className=”blk “+(dense?’dense’:’sparse’);el.fashion.animationDelay=(b*45)+’ms’;
var h=”
Block “+(b+1)+’: ‘+(dense?’bitmap’:’offset array’)+’
‘;
if(dense){h+=’
‘;for(var okay=0;okay’;h+=’
‘;}
else{var c=Math.max(2,Math.spherical(bd*12)),o=0,arr=[];for(var k3=0;k3
‘;}
h+=’
density ‘+Math.spherical(bd*100)+’%
‘;
el.innerHTML=h;g.appendChild(el);
}
field.appendChild(g);resize();
}
$(‘px-len’).addEventListener(‘enter’,drawPL);$(‘px-den’).addEventListener(‘enter’,drawPL);drawPL();
/* PANE 2: bounded traversal */
var C=[{id:’D1′,ub:.72,ex:.61},{id:’D2′,ub:.55,ex:.40},{id:’D3′,ub:.90,ex:.82},{id:’D4′,ub:.38,ex:.30},{id:’D5′,ub:.70,ex:.66},{id:’D6′,ub:.58,ex:.52}];
var idx,saved,reads;
operate build2(){
idx=0;saved=[];reads=0;var h=””;
C.forEach(operate(c){h+=”;});
$(‘px-cands’).innerHTML=h;$(‘px-st2′).innerHTML=’Precise frequency reads: 0 of 6. Press the button to begin.’;$(‘px-step2’).disabled=false;resize();
}
operate thr(){if(saved.size=C.size)return;var c=C[idx];var row=$(‘px-c’+c.id);var tag=row.querySelector(‘.tag’);
row.querySelector(‘.ub’).fashion.width=(c.ub*100)+’%’;var t=thr();var msg;
if(c.ub’+c.id+’: higher certain ‘+c.ub.toFixed(2)+’ can not beat threshold ‘+t.toFixed(2)+’. Skipped with out studying probe lists or precise frequencies.’;}
else{reads++;row.querySelector(‘.ex’).fashion.width=(c.ex*100)+’%’;saved.push(c);saved.type(operate(a,b){return b.ex-a.ex;});var out=null;
if(saved.size>3){out=saved.pop();var orow=$(‘px-c’+out.id).querySelector(‘.tag’);orow.className=”tag drop”;orow.textContent=”evicted”;}
if(!out||out.id!==c.id){tag.className=”tag keep”;tag.textContent=”retained (“+c.ex.toFixed(2)+’)’;}
msg=’‘+c.id+’: certain ‘+c.ub.toFixed(2)+’ clears threshold ‘+t.toFixed(2)+’, so Photon reads precise frequencies: rating ‘+c.ex.toFixed(2)+’.’+(out?’ ‘+out.id+’ is evicted from the bounded set.’:”);}
idx++;setThr();
msg+=’
Precise frequency reads: ‘+reads+’ of ‘+idx+’ visited. New threshold: ‘+thr().toFixed(2)+’.’;
if(idx>=C.size){msg+=’ Traversal executed: ‘+(C.length-reads)+’ of 6 candidates have been pruned cheaply.’;this.disabled=true;}
$(‘px-st2’).innerHTML=msg;resize();
});
$(‘px-reset2’).addEventListener(‘click on’,build2);build2();
/* PANE 3: batched reads */
var batch=[];var U=26;
operate newBatch(){batch=[];for(var i=0;ithread

