Pass 3 of 3 · Deep dive of PHAROSPass 1 · OverviewPass 2 · How it works
Code Observatory / Serve
Retriever
Keyword, dense, hybrid and graph modes, with the mode used always reported.
Recorded run
PHAROS at 975a38dMIT license
How it works
Auto is dense when dense can run, and hybrid when the caller passes hints. If embeddings are unavailable it falls back to keyword and says so. An explicit mode that cannot run is refused.
Hybrid is reciprocal rank fusion of keyword and dense, with a boost for an exact symbol name. Tests, docs and examples are down-ranked unless the question asks for them.
Recorded runs through it
- Hints turn auto into hybridThe same question with two guessed identifiers. Auto becomes hybrid, and the function that actually does the check moves from fifth to first.
- A missing embedder: degrade with a warning, or refuseNo embedder at all. Auto degrades and says so. Asking for a mode that cannot run is refused.
Source evidence
- Choose a mode, then run it
backend/app/codeintel/retrieval.py:204–277Auto is dense, or hybrid with hints, or keyword with a warning. An explicit mode that cannot run raises ModeUnavailable. - Is dense possible here?
backend/app/codeintel/retrieval.py:281–301Vectors from different models are never compared. A model mismatch makes dense unavailable. - Dense search with pgvector
backend/app/codeintel/retrieval.py:370–405Cosine distance through the HNSW index, filtered to one embedding model, with an iterative scan on pgvector 0.8 or later. - Reciprocal rank fusion
backend/app/codeintel/retrieval.py:409–444Each list contributes 1/(60 + rank). Dense and keyword modes keep their own scores. - Exact symbol boost
backend/app/codeintel/retrieval.py:446–463A name spelled as an identifier, or passed as a hint, adds one more 1/61. - Down-rank tests and docs
backend/app/codeintel/retrieval.py:511–531Tests, docs and examples are multiplied by 0.7 after fusion, unless the query asks for them. - Match a repository reference
backend/app/codeintel/retrieval.py:614–630Accepts an id, a canonical URL, a name or a URL suffix.
Claims this supports
PHAROS supports keyword, dense, hybrid and graph retrieval; auto prefers dense, hybrid with hints, keyword fallback with warnings.
Explicit unavailable semantic modes fail; auto can degrade with a warning. Repository scope is a filter the caller chooses; a call naming no repository searches the whole index.
In a recorded run with no embedder, auto used keyword retrieval with a warning, and explicit dense, hybrid and graph modes were refused.
Reported nDCG@10 improved 0.394 to 0.697 and 0.463 to 0.726 on two locked held-out sets totaling 101 questions.
Seven repositories and languages, single annotator, CPU. Read from project documentation; not reproduced for this site.
