Laya for search and RAG
In retrieval pipelines Laya works best as a judge: is this passage relevant, does this evidence support the claim, should traversal continue. Projects use it to filter results and gate hallucinations. One published experiment found it is not a good general-purpose re-ranker.
0 projects
Filter and verify search results
zero-api-key-web-search searches the web without API keys and can add a local Laya relevance sieve:
pip install "zero-api-key-web-search[laya]" # pulls laya + torch
zero-search "react state management" --laya --laya-threshold 0.6 --json
zero-verify "Python 3.13 is the latest stable release" --laya --json
Without Laya installed, it falls back to a lexical verifier.
RAG claim checking
layaAsRagJudge runs the whole pipeline in the browser: chunking, MiniLM embeddings, top-k retrieval, then a Laya question asking whether the evidence supports the claim. An evaluation page scores 72 labelled claims.
GraphRAG
laya-jev-GraphRAG uses score, noul and choice questions for edge verification, entity disambiguation, A* traversal and a hallucination gate. It works across Neo4j, Memgraph, Apache AGE and Kùzu, with local Laya or cloud Jev.
Code retrieval
laya-codex ranks code for Claude Code with tree-sitter, BM25 and a Laya re-ranker (tindang/laya-code).
Long documents
laya-multilingual reads up to 8,192 tokens with max_len=8192. The core README reports 16 to 18 of 20 requests correct with up to about 4,000 tokens of text, and more variable results beyond that.
result = router.predict(long_document, questions, model="multilingual", max_len=8192)
Caveat: re-ranking
ai-experiments (nadeem4) re-ranked BM25 results for all 323 BEIR NFCorpus test queries. Jev improved nDCG@10 by +0.0347 and a MiniLM cross-encoder by +0.0204, while both Laya checkpoints ranked worse than doing nothing. Use Laya for yes/no relevance gates and claim checks. Measure before using it to reorder a ranked list.
More ways to use Laya