Technology Sharing

Experimentation Playground: Run RAG experiments in minutes using Bedrock Anthropic Models and Elasticsearch

2024-07-12

한어Русский языкEnglishFrançaisIndonesianSanskrit日本語DeutschPortuguêsΕλληνικάespañolItalianoSuomalainenLatina

Author: From ElasticJoe McElroy, Aditya Tripathi

We recently released Elasticsearch Playground, a new low-code interface for developers to iterate and build production RAG applications by A/B testing LLMs, adjusting prompts, and chunking data. Today, we are announcing that Amazon Bedrock supports Playground, bringing you more choices of foundational models from Amazon, Anthropic, and other leading providers. Developers using Amazon Bedrock and Elasticsearch can now use private or proprietary data (indexed into one or more Elasticsearch indices) to optimize searches to get answers.

A/B testing of LLM and retrieval using Amazon Bedrock for inference

The Playground interface allows you to experiment and A/B test different LLMs from leading model providers such as Amazon and Anthropic. However, choosing a model is only part of the problem. Developers must also consider how to retrieve relevant search results to closely match the model's context window size (i.e., the number of tokens the model can process). Retrieving text passages longer than the context window may result in truncation, resulting in loss of information. Text smaller than the context window may not be embedded correctly, resulting in inaccurate representation. The next complexity can come from having to combine retrieval from different data sources.

The Playground combines many Elasticsearch features into a simple yet powerful interface for tweaking your RAG workflow:

  • Use a growing list of model sources, including Amazon Bedrock, to choose the LLM that best suits your needs
  • use semantic_text, adjust the chunking strategy to suit the data and context window size
  • use retrievers Added multi-stage retrieval pipeline (including reranking)

Once you have adjusted the context sent to the model to your desired production standards, you can export the code and complete your application using the Python Elasticsearch language client or the LangChain Python integration.

Today’s announcement was made through Open Inference API The integration provides access to models hosted on Amazon Bedrock and the use of newsemantic_text We really hope you enjoy this experience!

Playgrounds takes all of these composable elements and brings you a true developer toolset for rapid iteration and development at the speed developers demand.

Using Playground

In Kibana (Elasticsearch UI), navigate to "PlaygroundFirst, you need to connect to a model provider to provide the LLM of your choice. Playground completes the model (such as Anthropic) through Amazon Bedrock support chat.

This blog provides detailed steps and instructions for connecting and configuring the Playground experience.

Once you connect LLM and select an Elasticsearch index, you can start asking questions about the information in the index. LLM will provide answers based on the context of your data.

Connect selected LLMs with Elasticsearch indices and private proprietary information
Chat with your data instantly and evaluate the response of the model (such as Anthropic Claude 3 Haiku in this example)

Review and customize text and retriever queries for indexes storing vector embeddings

Using retrievers and hybrid search to get the best context

ElasticHybrid SearchHelps you build optimal context windows. Effective context windows are built from various types of vectorized and plain text data that can be distributed across multiple indexes. Developers can now take advantage of the new query retrievers To simplify query creation. Starting with version 8.14, Elastic CloudServerless Three new searchers are available on the , and can be used with just one unified queryRRF Normalized hybrid search. You can store vectorized data and use a kNN searcher, or add metadata and context to create hybrid search queries. Soon, you can also addSemantic Re-Rankingto further improve search results.

Delivering conversational search quickly with Playgrounds

Building a conversational search experience can involve a variety of approaches, and the choices can be overwhelming, especially given the pace of innovation of new re-ranking and retrieval technologies, both of which are applicable to RAG applications.

With our Playgrounds, these choices become simple and intuitive even as developers have access to multiple capabilities. Our unique approach immediately builds on hybrid search as a main pillar, intuitively understands the shape of selected and chunked data, and expands access to multiple external providers of LLMs.

Earlier this year, Elastic acquired AWS Generative AI Capability Award, an honor bestowed upon a select few AWS partners that offer differentiated generative AI tools. Elastic’s approach to adding Bedrock support to the Playground experience follows the same principle – bringing new and innovative capabilities to developers on Elastic Cloud on AWS.

Build, test, and have fun with Playgrounds

Go now Playground documentationGet started! Explore GitHub Search Labs on GitHub for new cookbooks and integrations from providers like Cohere, Anthropic, Azure OpenAI, and more.

Ready to try it yourself? Get startedFree Trial
Want to get Elastic certified? Find out about the next issueElasticsearch Engineer TrainingWhen does it start!

original:Playground: Experiment with RAG using Bedrock Anthropic Models and Elasticsearch in minutes — Elastic Search Labs