LLM without search is a hallucination generator. How we dealt with it while building search for the intranet

Dmitry Kirpa20 May 2026

Problem

A company with 50+ internal systems (wiki, task tracker, code repository) and over a billion documents cannot expect people to find knowledge by hand. A quick LLM prototype over a vector database tends to hallucinate, because it never retrieves the documents it needs. Without good search, people stop writing documentation, which makes search worse, and colleagues keep asking each other in direct messages. Assessors cannot label relevance either: the questions are too specialized.

Example from the article: Yandex's internal search started as BM25 with a synonym dictionary, then grew into a ranker over about 2,000 factors and the generative AI Chat.

Solution in brief

Build search first and use its ranker as the retrieval layer of the generative assistant. Train a CatBoost ranker on the company's own logs, with click and visit signals, personal features and an intent classifier as the main factors. Then give the LLM the top documents, with source filters and a query reformulation step.

Questions this case answers
  • How to rank documents for a small closed user population when expert relevance labels are unavailable and the only supervision is behavioral logs
  • How to ground an LLM answer in retrieved documents so that its quality can be measured and improved through the ranker
  • How to rank documents in a corporate intranet search across dozens of systems when assessors cannot label the queries?
  • How to use click and visit signals as the first and strongest ranking features with a small user base?

Tools and methods

  • CatBoost — final ranker, trained as a combination of a dwell-time model and a pairwise model
  • BM25 features — text match per document part (title, body, ticket comments)
  • DSSM (two-tower model) — query-document embeddings and a personal user-document score
  • Intent classifier — decides which queries get a generative answer
  • LLM query reformulator — replaces document embedding for candidate generation
  • A/B tests — proof for every change
Continue reading — it's free

Google or a one-time email code. No password.