Formulation Search
A formulation and ingredient search engine built on custom retrieval logic rather than a single vector index, designed to scale with the dataset.
- ownership
- Sole engineer, end to end
- when
- 2026
- org
- Bettrlabs
The film, as text: Formulation Search. A formulation and ingredient search engine built on custom retrieval logic rather than a single vector index, designed to scale with the dataset. Database first: A direct lookup with custom rules runs before any vector search. Independent fields: 11+ embedding fields per chunk, each its own similarity signal. Dense and lexical: Dense lanes and BM25 rank the same candidates independently. Reciprocal rank fusion: RRF fuses the ranked lists, so items that agree across signals rise. Rerank: A reranker orders the fused results. Deeper fallback: When direct retrieval finds no match, it falls back to deeper RAG or agentic search. 11+ independent dense embedding fields per chunk. 2,000 ingredients in the retrieval experiments. 10K+ formulations the search is engineered for. Sole engineer, end to end, Bettrlabs, 2026.
Problem.
Product data spans many attributes, and a single blended embedding flattens the specific signals a query depends on.
How it works
- Database-first retrieval: exact lookups with custom fallback rules, including trigram matching, resolve direct matches before any vector search runs.
- Multi-field embeddings: 11+ independent dense embedding fields per chunk, so each product attribute contributes its own similarity signal instead of one blended embedding.
- Hybrid search: dense (ANN) and lexical (BM25) results are combined with reciprocal rank fusion, then reranked.
- Query-dependent logic: custom retrieval rules apply different retrieval logic depending on the query.
- Agentic fallback: when direct retrieval finds no match, search escalates to deeper RAG or agentic search.
- Scale: engineered for 10K+ formulations, with retrieval also tested across a 2,000-ingredient dataset.
Outcome
11+
independent dense embedding fields per chunk
2,000
ingredients in the retrieval experiments
10K+
formulations the search is engineered for
Stack
- Retrieval
- Database-first lookup
- Trigram matching
- BM25
- Reciprocal rank fusion
- Reranking
- Vector search
- ANN search
- Dense embeddings
- Multi-field embeddings (11+ fields)
- Fallback
- RAG fallback
- Agentic search

