How To Guide: Lexical Question Answering

  • Understand search intent from the input with OpenAI ChatGPT
  • Search using the parsed intent on a HTTP API (news API in this case)
  • Pass the top results as context to OpenAI to synthesize an answer
  • Build a search UI with a ChatGPT prompt
Lexical QA How-to hero

Interactive demo of lexical question answering based search UI that we will build in the following steps

ReactiveSearch Features Used

Pipelines

Pipelines

Power the most demanding search workflows with a declarative authoring format

Learn More
HTTP API

HTTP API as the search data source

This tutorial shows use of an external API as the primary search system. ReactiveSearch pipelines allow flexibility to search over any data source.

AI Answer

AI Answer

Allow users to ask natural language questions, provide a direct answer along with relevant search results

Learn More

Step 1: Author the search backend with ReactiveSearch pipeline

In this pipeline, we will show how to search on an external data source (News API) over HTTP, use OpenAI to translate user input to search keywords as well as generate an answer from the top search results. The pipeline will use caching, pre-built stage for HTTP request, and async JavaScript stages for an optimized runtime flow.

Step 2: Build the search UI with ChatGPT

We will use the pipeline's HTTP route definition and expected response to ask ChatGPT to come up with a search UI. An alternative choice here would be to use ReactiveSearch UI kits or UI builder to do this.

Try Lexical Question Answering

Get a 14-day free trial