Supercharging OpenSearch for RAG: Lessons From a Large-scale GenAI Deployment

Nabeel Janjua, Akarsha Sehwag9 May 2025

Problem

Customer agents at HDI, a German insurer, must answer questions such as "is the customer insured for this?" while the customer waits on the phone. The answer sits in several SharePoints and databases, and some documents run over 100 pages (a few reach 300), with the needed fact anywhere in them. A RAG assistant over this material has far more design choices than a team can test: parsing, chunk size, embedding model, index parameters, reranking and metrics. The team estimated more than 30,000 combinations.

Solution in brief

Put all documents in one secure store, build questions with expected answers together with the business, and run about 120 experiments on parsing, chunking and retrieval until document recall passes 85%. Release an MVP, then tune the HNSW (graph-based vector index) parameters to cut latency. Result: about 88% recall and about 800 users in two business lines. This is a process report (stop rule, baseline, Markdown chunking, HNSW tuning direction), not a tuned recipe: final parameter values are not disclosed.

Questions this case answers
  • How to choose settings for a retrieval-augmented assistant over heterogeneous documents when the number of configuration combinations is far too large to test
  • How to keep context when splitting long structured documents with tables into retrievable pieces
  • How to trade vector-search recall against latency when the user waits for the answer
  • How to tune a RAG assistant over scattered enterprise documents without testing every combination of settings?

Tools and methods

  • OpenSearch — managed vector store with HNSW indexing
  • hybrid search with custom reciprocal rank fusion — keyword and vector results merged from the start
  • Markdown-based chunking — chunks keep headings and table headers
  • Amazon Bedrock (LLM calls, baseline), SageMaker (custom embedding endpoint), Textract (PDF layout)
  • RAGAS — open-source evaluation metrics, compared with the team's custom ones
Continue reading — it's free

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