Elastic Ebook Building Ai Powered Search Experiences
Elastic Ebook Building Ai Powered Search Experiences
Elastic Ebook Building Ai Powered Search Experiences
search experiences
A blueprint for success with search
elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 1
Table of contents
The (search) construction zone 3 Monitoring and analysis 27
Retrieval-augmented generation 9
Community 31
Unstructured data 14
Ingestion 18
elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 2
The (search) In the end, no two homes or search experiences are
construction zone
alike. Especially after you’ve “lived” in them for a while,
maintained them over time, and added those personalized,
special touches to make them into “home.”
Building search for your app or your content and building a This guide — a blueprint of sorts — touches on the various
house have a lot in common. Communication, planning, and considerations for building in the age of AI, creating a solid
prep are paramount. The foundation is critical for a long- foundation for successful search experiences.
lasting, sturdy structure. Architecture plays a big role. What’s
happening behind the scenes — or inside the walls, if you will
This guide will
— keeps everything operating smoothly: maintenance, fine- also make quite
tuning, upkeep, and updates. The little, personalized details a few (hopefully
can make all the difference. And so on. helpful) home-
building analogies
along the way.
Technology continuously redefines what homeowners and
search users expect. Modern homes with efficient, intelligent
systems and materials. Smarter search experiences that move
beyond simple, keyword-based searches toward AI-powered
relevance and narrative response that draw ever closer to
human-like understanding.
elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 3
Search relevance
When a home’s foundation isn’t well built, it can create all sorts Traditional search relies on keyword matching
of structural integrity issues for the house built on top of it. to provide results that align with a user’s query.
The same is true for search relevance, which is the all- Users need to know the exact keywords to
important foundation of any well-built search experience. get optimal results and then must sort through
those results to choose the one that looks like
Search relevance is the measure of how well search results the one they need.
align with the user’s intent and expectations. It’s not just
about finding the correct information but also about ranking AI, however, is quickly changing the way search
the results in a meaningful order and highlighting the relevant experiences are measured. With AI and machine
snippets. Or it can provide direct, helpful answers in a human- learning (ML) techniques, you can build more
like, narrative format in the case of generative AI. accurate search tools that improve relevance,
drive personalization, better understand natural
Relevance is not only complex but also a bit of a gray area. language queries and user intent, and get closer
What is relevant to one person may not be relevant to another, to providing human-like responses.
and queries can be phrased in many different ways. Without
additional context, it can be challenging to understand
precisely what kind of answers your search users are looking
for. And relevance is tied to personalization: Search results
that take into account a user’s personal preferences can make
choices feel more relevant.
elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 4
Search relevance
Vector search
Vector search, a fundamental feature of vector You enhance the vector search experience further by
databases, is a key component for building combining vector search with BM25 or SPLADE “sparse”
AI-powered search. vectors to provide a multimodal search experience that
allows you to rank by vector similarity while providing
Where traditional search relies on mentions of keywords, better rankings for text.
lexical similarity, and the frequency of word occurrences,
vector search utilizes the power of ML and AI to Vector search can also be used to augment large
understand the semantic relationships between words language models (LLMs) and generative AI applications,
and documents. This means that rather than relying on as it enables question-answering systems by converting
keyword matching, vector search creates a mathematical documents into text embeddings and delivering
representation of documents and queries, enabling it accurate answers.
to understand the context, relevance, and similarity of
different pieces of information.
elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 5
Search relevance
Vector databases
Vector databases are ideal for models. These embeddings, known While it might sound complex, vector
grappling with the task of managing as “dense” vectors, take the form databases have been created with
unstructured data and extracting of numerical representations of developers in mind, as they use APIs
meaningful insights from it — and for data objects, which can be fed to enable a user-friendly interface
those who want to ensure they are into ML algorithms to determine to simplify the vector search
building an agile search experience. semantic similarity. experience. There are a number of
other benefits to vector databases:
A vector database is a data These embeddings also enable
management solution that enables vector databases to index and Scales with growing data volumes
metadata storage and filtering, is search across a massive dataset
Supports real-time data updates
scalable, allows for dynamic data of unstructured data and semi-
that allow for dynamic changes to
changes, performs backups, and structured data (data that does
the data
offers built-in security features. not conform to a data model
but has some structure). Vector Handles the routine operation of
These databases are designed to databases are built to manage backing up all the data stored in
store and manage unstructured vector embeddings and therefore the database
data, such as text, images, or audio offer a complete solution for the
in vector embeddings, also known management of unstructured and
as high-dimensional vectors, which semi-structured data.
are generated by LLMs and other AI
elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 6
Search relevance
Generative AI
Generative AI, once the domain of science fiction and
theory, is becoming part of everyday life for many tasks.
While the hype surrounding this technology until now
has been limited to tools such as ChatGPT, DALL-E, and
Image similarity search
Bard, few generative AI use cases have driven as much
A popular use case is users searching by image enthusiasm as generative search.
and finding similar images available in your
dataset. It uses k-nearest neighbor (kNN), a Organizations looking to harness the power of generative
popular algorithm to achieve this, which finds AI need a model that is tuned for their enterprise
the k-nearest vectors to a query vector. environments rather than the ones consumers use, as
these are limited by public training data and lack domain-
However, on the large data sets you’d typically specific data, language, and content.
process in image search applications, kNN
requires very high computational resources Using a generative AI model trained on relatively generic,
and can lead to excessive execution times. As a public data also raises concerns regarding data security,
solution, approximate nearest neighbor (ANN) access controls, privacy, and bias — where an AI model
search sacrifices perfect accuracy in exchange produces content based on data sets that contain
for executing efficiently in high-dimensional human biases.
embedding spaces, at scale.
For development teams, creating generative search
experiences might seem like a goal out of reach due to the
complexities surrounding LLMs and generative AI. You’re
not alone.
elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 7
Search relevance
This will help you move past the limits of traditional search and leverage data more effectively
and deeply. You can apply it to conversational apps that can answer complex questions, produce
accurate summaries that synthesize many sources, and help people get the information they
need, faster.
elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 8
Search relevance
elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 9
Case Study: CISCO
Cisco Systems builds Before
technology used by more
11,000 support engineers needed search tools to retrieve content from millions
than 87% of the world’s of documents to help resolve the more than 2 million service requests received
Fortune 500 companies. each year. Search results accuracy at the speed at which results are returned
Using Cisco’s website is critical. A delay of just half a second can impact the website click-through
search function, visitors rate or the customer experience when in touch with a support engineer.
elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 10
Search relevance
Improved accuracy: By retrieving relevant information first, RAG can provide more
accurate responses, especially in information retrieval or question-answering tasks.
Controllability: The retrieval mechanism allows you to control the scope of the generated
responses by choosing the appropriate retrieval database or providing specific queries.
Engagement: RAG-based search experiences are highly engaging for the people who use
them. Enriched by nuance and context from internal private data, RAG-based systems can
deliver insightful and engaging responses.
Reduced generation bias: By using retrieved context, RAG can help mitigate some of
the generation biases commonly observed in pure generative models.
elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 11
Data and data ingestion
Your home’s plumbing is a convenience that’s very difficult to live without.
Easy access to drinking water, restroom facilities, and clothes-washing
options are critical, even life-saving, benefits. The data that feeds your search
experience is quite similar.
Before we dive into the ingestion tools, let’s take a look at the types of data
you’ll be dealing with.
elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 12
Data and data ingestion
Structured data
Much of an organization’s data will take the form of structured data. This is highly organized and formatted, so it can
be quickly processed by machine learning algorithms and humans alike. Examples of structured data include metrics,
dates, names, ZIP codes, and credit card numbers.
Helps to interpret customers’ search behaviors with data Limited and can only be used for its
points like their names, purchase histories, and geolocation. intended purpose.
Enables customer relationship management (CRM), Can also be of low quality due to the huge
where businesses manage customer relationships with amounts of data collected by organizations,
relational databases that can analyze customer behavior. which is often synonymous with data
duplicates or data that is no longer relevant.
Can be easily stored in relational databases, NoSQL
databases, data warehouses, data lakes, in-memory
databases, and more, thanks to its organized nature.
elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 13
Data and data ingestion
Unstructured data
Unstructured data is abundant in organizations — and it’s constantly being generated.
80%
Unstructured data accounts
430%
Unstructured data volume will
for 80% of existing data.* grow by 430% from 2018 to 2025.*
elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 14
Data and data ingestion
Unstructured data
Often contains rich, detailed information that Requires analysis to be turned into valuable insights.
isn’t available in structured data.
Unorganized and high in volume, making it more
Helps enterprises understand their customers challenging to analyze.
and market shifts better to train natural language
Difficult to manage manually.
processing (NLP) models and provide predictive
data analytics. For example, ecommerce Many databases and tools cannot handle the
businesses can track customer interactions volume and variety.
and collect real-time data, helping to identify
Specific tools and tech are often needed to store
spending patterns and customer behavior,
and process its exponentially growing data volumes.
create personalized experiences, and inform
pricing strategies. Quality can also be inconsistent. It often contains
errors, inconsistencies, or irrelevant information that
Can provide businesses with a deeper
can make it challenging to get accurate information,
understanding of their customers’ intent
particularly when used in search.
and behavior.
Reprocessing or cleaning unstructured data
to improve its quality can be a time-consuming,
complex task.
elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 15
Data and data ingestion
If RAG and AI search are so good, why is keyword search still around?
Keyword-based, or lexical, search has been around for decades, and it remains an
important piece of the overall search experience puzzle. Even while advanced, AI-enhanced
techniques are becoming more commonplace.
Lexical search is obviously still a great fit for searches that demand exact matches, such as
finding product SKUs, error codes, user IDs, support tickets, code snippets, and so on.
One other reason keyword search remains popular is simply the number of search products
and apps that are in use that rely on keywords. It’s not easy, or sometimes just may
not be necessary, to move these applications to new approaches such as vector
or semantic search.
When you pair keyword search with vector search and semantic
search capabilities, you get the best of both worlds: exact
matching relevance, plus natural language understanding that
can gauge user intent. This approach may be necessary if you
want to combine newer data with existing systems and data.
elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 16
Data and data ingestion
CHEAT SHEET
A variety of storage technologies and data processing methods enable you to store, manage, and analyze unstructured data:
elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 17
Data and data ingestion
Ingestion
Now that you’ve considered what data you want to search, the next step is to bring it to your
search engine. Data ingestion is the process of collecting large, assorted data from multiple
sources — or your sources of truth. This can be a taxing process. Increasing volumes and
varieties of data sources make collecting, compiling, and transforming data into something
cohesive and usable a persistent challenge. For example:
Privacy concerns: There may also be metadata that you want to ensure you’re not
showing to end users, or personally identifiable information (PII) may need to be cleaned
out before it is ingested.
Erroneous data: It’s also likely that data will contain errors, inconsistencies, or missing
values that need to be identified and corrected before ingestion.
Speed and freshness of data: How many days or months of business records do you
want to keep in a layer that enables rapid search? What is the cutoff point for data to go
into archival layers that are slower but also more cost-effective?
Manual ingestion: Writing code to ingest this data and manually creating mappings for
extracting, cleaning, and loading data can be cumbersome.
Cost: The infrastructure you need to support the various data sources and tools can be
costly in the long run.
elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 18
Data and data ingestion
API
elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 19
Connectors
Ingest pipelines
Ingest pipelines
With pipelines, you can perform common transformations on data before storing it.
All ingest pipelines are composed of an ordered list of processors, which define the
behavior of the pipeline. These can be particularly helpful by providing a layer of
customization and post-processing of documents. For example:
Providing consistent sanitization steps (removing PII like phone numbers or SSNs)
Production-ready pipelines can be a lot of work to set up and manage from scratch.
Considerations such as error handling, conditional execution, sequencing, versioning,
and modularization must all be taken into account.
elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 20
Personalized
user experiences
Where you live is more than just a structure, house, or building.
It’s home. Personalizing our spaces creates a comfortable vibe
and a coziness. Maybe you use Feng Shui practices to harmonize
with your home’s environment. Maybe it’s mood lighting, or a cozy
fire, or your favorite artworks. The user experience for search is
much the same. You want to make your customers, prospects, and
users feel comfortable, with search capabilities that feel familiar,
useful, quick, guiding, and relevant. Help them find exactly what
they need — and maybe a few things they didn’t even know they
needed. Users will definitely notice if the experience feels clunky,
serves up not-so-relevant results, or doesn’t quite understand
natural language.
elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 21
Section title -user
Personalized remove
experiences
if not needed
Semantic search
Thanks to semantic search and LLMs, modern search engines have become
more intelligent and can now produce more relevant and personalized search
results than ever.
elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 22
Case Study: LABELBOX
At the forefront of the AI revolution, Before
Labelbox offers a collaborative
Labelbox Catalog, one of the company’s most popular tools,
data training platform that creates searches and analyzes unstructured data for improved
and manages labeled data for ML training model performance. For years, Catalog ran on top of a
applications. Rather than companies PostgreSQL database, which made it difficult to build filters for
building their own expensive tools more accurate results. Searches were also time-consuming — in
some cases, it took up to 20 seconds to respond to a request.
to create or manage training data,
customers use Labelbox.
elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 23
Personalized user experiences CHEAT SHEET
elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 24
Data privacy and
access controls
Parallels between data security and home security are pretty apparent. We want to feel safe
in our homes and ensure that our possessions are protected. Likewise, users of your search
applications want to make sure their data is safe and that standard privacy protocols are
followed. And you want to be sure that your organization’s private data is protected as well.
This adds another layer of complexity for developers hoping to build an agile search experience.
The rise of generative AI, which looks set to revolutionize enterprise search, has brought
with it a number of privacy and security challenges due to its ability to process personal data
and generate potentially sensitive information. This means that businesses, and developers
experimenting with AI-driven search experiences, must be vigilant in safeguarding sensitive data
to avoid potential disasters.
For example, suppose training data contains sensitive data, like medical records, financial
information, or other identifiers. In that case, there’s a risk of unintentionally generating sensitive
information that violates privacy regulations across jurisdictions and puts individuals at risk.
What’s more, if proper security measures are not in place, generative AI tools may be vulnerable
to data breaches, resulting in unauthorized access or disclosure of sensitive user information,
which again could lead to privacy violations and the potential misuse of personal data.
elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 25
Data privacy and access controls
Developers must also ensure they are balancing innovation with privacy protection to avoid
potential misuse of sensitive information. This includes incorporating advanced anomaly
detection and monitoring systems and carrying out continuous security audits to ensure
adherence to relevant data protection regulations.
Implementing these features and carrying out various privacy assessments isn’t a task owned
by developers alone. Work with IT security, IT maintenance, information systems managers,
and analysts across the IT organization. Third parties can also help scale and ensure your
organization automatically complies with the growing list of data privacy regulations.
elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 26
Monitoring and analysis
You can have incredible, well-designed, well-decorated spaces in your house.
But without well-maintained heating and cooling, plumbing, and electricity,
you’re sitting in a dark room that’s too hot or too cold, with no running water,
and all your food has gone bad in the fridge.
elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 27
Monitoring and analysis
elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 28
Monitoring and analysis
elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 29
Monitoring and analysis
Application performance
monitoring (APM)
APM is another tool that can make ongoing maintenance
a less daunting task. APM solutions collect, monitor,
and analyze telemetry data from websites and services, Benefits of APM
providing development teams with end-to-end visibility
Increase stability and uptime
across their applications so they can understand
application and service dependencies and address any Reduce incidents
errors or slowdowns.
Resolve issues faster
Teams can leverage these insights to get on top of any Release high-quality software
issues, rather than waiting for users to flag the issues —
Identify infrastructure improvements
or, worse, leave your site and never return. Developers can
also set up alerts for degradations in user experience in Improve productivity
order to make more informed decisions on where
Create better user experiences
to make improvements.
Drive revenue
APM solutions also store and utilize historical data to
surface trends and detect outliers for technical key
performance indicators (KPIs), such as latency and
throughput, as well as business KPIs.
elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 30
Community
Friendly neighbors can make or break the neighborhood where you live. And a thriving, helpful
software user community can also go a long way toward solving tough issues, generating ideas,
and ensuring success with your search experiences.
By joining the Elastic community, you gain a network of support as you build your experience
with Elasticsearch.
With a front-row seat in the Elastic community, you and your team can benefit from the shared
knowledge of other developers on the same journey:
From the earliest days, our
community relied on three
Elastic Community products (which are now part of
one experience) — Elasticsearch,
Elastic Contributor program and awards
Logstash, and Kibana, or ELK
for short. The ELK Stack, as it
Elastic Community forums
became known, was represented
elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 31
The house that search built
As this guide has demonstrated, building an agile enterprise search experience
— much like building your dream home — can be a challenging yet rewarding process.
Elastic can help. With one of the industry’s most popular search and analytics engines —
Elasticsearch — we’re bridging the gap between LLMs and search to enable you to build
custom generative AI applications with your company’s data.
elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 32
Thank you.
elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 33