Smart API Search: Hybrid BM25 + FAISS Retrieval over API Specifications at MTS

Igor Gustomyasov, Nikita Boyandin25 Mar 2025

Problem

MTS runs an Integration Platform whose number of API specifications grew fast. Past a certain count a catalog stops helping: users rarely know the global context of their task and just want to find the right interface. Many specs are old and poorly documented, and the documentation language is tied to a product or technology domain, so a good query is hard to write. The team needed search that answers in about a second and keeps confidential API data inside the company.

Example from the article: most search queries are in Russian while all APIs are in English.

Solution in brief

The team moved from catalog browsing and full-text search to semantic search over specifications with LangChain and an in-house LLM, then switched to hybrid retrieval. The final setup combines BM25 with a FAISS index (data in MongoDB) built on a lightweight English embedding model.

Questions this case answers
  • How to make a growing catalog of technical specifications searchable when documentation is sparse and queries use different wording than the documents
  • How to retrieve relevant documents when the query language differs from the document language and data cannot leave the company perimeter
  • How to let engineers find the right API in an internal catalog of thousands of specifications
  • How to search poorly documented API specs when full-text search fails on vague or domain-specific wording

Tools and methods

  • Hybrid search (BM25 + vector) — merges keyword and embedding retrieval in one ranking.
  • LangChain (RetrievalQA, EnsembleRetriever) — wraps the in-house LLM and combines retrievers.
  • FAISS — vector index; data stored in MongoDB.
  • Sentence Transformers all-MiniLM-L6-v2 — lightweight English embedding model.
  • Weaviate — chosen after comparing Qdrant, ChromaDB and Weaviate; the final search uses FAISS.
  • ruBERT and Russian bi-encoder — tried for Russian queries; rejected after validation.
Continue reading — it's free

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