OpenSearch

2024-06-10

Revolutionizing Search: Unveiling Conversational Search in OpenSearch

I'll guide you through the fascinating world of Conversational Search, its implementation, and its potential impact.

Machine Learning Engineer

Introduction

Welcome to an exciting overview of Conversational Search, a revolutionary technique in the realm of OpenSearch. My name is Lucas Jeanniot, a Junior Machine Learning Engineer at Eliatra, and today, I’ll guide you through the fascinating world of Conversational Search, its implementation, and its potential impact.

What is Conversational Search?

Conversational Search leverages the power of Generative AI to parse through data and retrieve insights through natural language. This innovative approach allows users to interact with their data conversationally, refining answers by asking follow-up questions in natural language, thereby creating an ongoing dialogue between the user and the data.

How Does Conversational Search Work?

Key components that make Conversational Search effective include:
    Conversation History: This enables the Language Model (LLM) to remember the context of your conversation, avoiding repetitions and learning as you do.
    Retrieval-Augmented Generation (RAG): This technique supplements the static knowledge of the LLM with your data, reducing hallucinations by grounding responses in concrete, real data.

Revolutionizing Search: Unveiling Conversational Search

I gave a talk at the OpenSearchCon in Berlin a few weeks ago about the Vector Search and Conversational Search capabilities of OpenSearch and how you can use OpenSearch as a Semantic Search Platform.

Setting Up Conversational Search

To set up Conversational Search, you’ll need:
    A Machine Learning Configured Node
    An API Access Key for a Chat Agent (e.g., OpenAI, Claude)
    An Index for your RAG Data
The setup involves enabling necessary plugins on your cluster, configuring an index with the RAG search pipeline, and integrating a chat agent API.

Creating and Registering Your Connector

A connector acts as a bridge between your data cluster and the LLM. Here‚ is an example of creating a connector for OpenAI ChatGPT Connector:
copy
POST /_plugins/_ml/connectors/_create
{
  "name": "OpenAI Chat Connector",
  "description": "The connector to public OpenAI model service for GPT-3.5",
  "version": 2,
  "protocol": "http",
  "parameters": {
    "endpoint": "api.openai.com",
    "model": "gpt-3.5-turbo",
    "temperature": 0
  },
  "credential": {
    "openAI_key": "<YOUR_OPENAI_KEY>"
  },
  "actions": [
    {
      "action_type": "predict",
      "method": "POST",
      "url": "https://${parameters.endpoint}/v1/chat/completions",
      "headers": {
        "Authorization": "Bearer ${credential.openAI_key}"
      },
      "request_body": "{ "model": "${parameters.model}", "messages": ${parameters.messages}, "temperature": ${parameters.temperature} }"
    }
  ]
}

Deploying and Registering Your Model

After creating your connector, you need to register and deploy your model. This involves using the connector ID obtained from the previous step to register your model, which provides a model ID for deployment.

Creating the RAG Search Pipeline

To create your RAG Search Pipeline, you need to define how your data will interact with the LLM. Here‚ is an example of setting up a RAG pipeline:
copy
PUT /_search/pipeline/rag_pipeline
{
  "response_processors": [
    {
      "retrieval_augmented_generation": {
        "tag": "openai_pipeline_demo",
        "description": "Demo pipeline using OpenAI Connector",
        "model_id": "gnDIbI0BfUsSoeNT_jAw",
        "context_field_list": ["text"],
        "system_prompt": "You are a helpful assistant",
        "user_instructions": "Generate a concise and informative answer in less than 100 words."
      }
    }
  ]
}

Utilizing Conversational Search

Once your RAG pipeline is set up, it can be integrated into your index as the default search pipeline. This allows seamless interaction with your data through natural language queries, producing responses that leverage both the LLM’s capabilities and your specific data context.

Considerations and Future Directions

While Conversational Search offers immense potential, there are cost considerations, particularly related to API usage. Scaling this feature can lead to significant expenses, so it’s crucial to evaluate the cost-effectiveness for your specific use case.
Looking ahead, there are exciting possibilities, such as building connectors to locally hosted models to keep data private and refine search capabilities even further.

Conversational Search: An Ever-Evolving Process

The RAG process is continuously evolving. As new data is ingested and the system learns from ongoing interactions, the quality and accuracy of responses improve. This dynamic evolution ensures that Conversational Search remains at the cutting edge of AI-driven data retrieval.

Conclusion

Conversational Search represents a significant advancement in how we interact with data, making complex data retrieval as simple as having a conversation. At Eliatra, we are dedicated to supporting and improving OpenSearch to help businesses unlock the full potential of their data.
For more information or to get in touch, feel free to contact me at [email protected] or connect with me on LinkedIn.
Ready to get started?!
Let's work together to navigate your OpenSearch journey. Send us a message and talk to the team today!
Get in touch