# Search & Retrieval -- Cross-Comparison Review

**Last updated:** 2026-05-10

This directory contains comparisons of @coda/search against search and retrieval systems. These systems overlap most directly with our core use case: ranked retrieval of structured metadata for AI agent consumption.

---

## Compared Systems

| Project                                   | Stars             | Type                                | Our Verdict                                        |
| ----------------------------------------- | ----------------- | ----------------------------------- | -------------------------------------------------- |
| [LightRAG](lightrag-comparison.md)        | 34,977            | Graph-enhanced RAG (EMNLP 2025)     | Adopted 4 patterns; core architecture incompatible |
| [RAG-Anything](raganything-comparison.md) | 20,001            | Multimodal RAG (LightRAG extension) | Nothing new beyond LightRAG patterns               |
| [ChromaFs](chromafs-comparison.md)        | N/A (proprietary) | Virtual filesystem over vector DB   | Adopted 3 design patterns; no code                 |

---

## Cross-Cutting Findings

### 1. No graph-RAG system has BM25/lexical search

This is the single most consistent finding across all search comparisons. LightRAG, RAG-Anything, GraphRAG, Graphiti, KAG, and HippoRAG all rely on vector-only or graph-traversal retrieval. None have added BM25 or keyword scoring. This remains our most significant technical differentiator.

**Why it matters:** For schema discovery, exact keyword matching (`ARTIST_ID` -> `ARTIST_ID` column) is critical. Vector similarity alone misses these deterministic matches. Our hybrid BM25 + HNSW + RRF fusion consistently outperforms vector-only retrieval by NDCG@10 of 0.15-0.20 in benchmarks.

### 2. LLM dependency at query time is architecturally incompatible

All compared systems use LLM calls for keyword extraction, entity extraction, or context synthesis at query time, adding 200ms-5s latency. Our 10-15ms budget and zero-LLM policy eliminate these systems as wholesale alternatives.

### 3. Round-robin fusion is inferior to RRF

Both LightRAG and RAG-Anything use positional interleaving (round-robin) to merge local and global results. This ignores scores entirely. Our Reciprocal Rank Fusion (RRF) is mathematically principled for heterogeneous signals and produces better NDCG.

### 4. Reranker deployment is a competitive gap

LightRAG has deployed Cohere, Jina, and Dashscope reranker providers as default mode since v1.4.5. We have the `RerankProvider` interface and pipeline stage but no production model deployed yet.

---

## What We Adopted

| Pattern                          | Source   | Implementation                                                          |
| -------------------------------- | -------- | ----------------------------------------------------------------------- |
| Graph degree boost               | LightRAG | `DegreeSignal` implementing `StaticSignal<T>`                           |
| Dual-level keyword weighting     | LightRAG | Raw vs glossary-expanded `KeywordRankingStage`                          |
| Weighted context allocation      | LightRAG | `allocateBudget()` utility                                              |
| Token budget management          | LightRAG | Same `allocateBudget()` with cap                                        |
| Coarse-to-fine search            | ChromaFs | `SearchPipeline` over-fetch + filter + rerank                           |
| Lightweight topology             | ChromaFs | `LabeledGraph<T>` separate from content                                 |
| Access control via index pruning | ChromaFs | `Filter` allowlist/blocklist (build-time) + `SearchFilter` (query-time) |
| Adamic-Adar neighbor specificity | LLM Wiki | `AdamicAdarSignal` implementing `StaticSignal`                          |

---

## Competitive Landscape -- Graph-RAG Systems (May 2026)

| Project              | Stars  | Status            | BM25? |
| -------------------- | ------ | ----------------- | ----- |
| LightRAG (HKUDS)     | 34,977 | Active (daily)    | No    |
| Microsoft GraphRAG   | 32,871 | Active (moderate) | No    |
| Graphiti (Zep)       | 25,863 | Active (daily)    | No    |
| RAG-Anything (HKUDS) | 20,001 | Active (weekly)   | No    |
| KAG (OpenSPG)        | ~8,725 | Stalled           | No    |
| HippoRAG (OSU)       | ~3,494 | Stalled           | No    |

---

## Recommendations

### Short term

- Deploy a cross-encoder reranker (close the gap with LightRAG)
- Add context precision evaluation (RAGAS-style "is the context sufficient?")

### Medium term

- ~~Evaluate Adamic-Adar as a custom `StaticSignal`~~ — DONE (`AdamicAdarSignal`)
- Add explain mode for per-signal score breakdown (from Elasticsearch patterns)

### Not adopting

- LLM-based entity extraction (our schemas are already structured)
- Round-robin fusion (RRF is strictly better)
- 13 storage backends (in-memory + S3 is sufficient at our scale)
