Bring AI-Based Search to Your Web App

Rate this content
Bookmark

ChatGPT took the tech world by storm. Everyone talks about it, from your CTO to your hairdresser (at least my barber does). And there are many reasons why we should all be excited about it and many other AI/ML innovations.


But how do you bring them into your tech stack, your website/backend, to work with your data and provide AI-driven search and data augmentation?


There is a new generation of AI Native databases, which use deep learning models to find answers to natural language queries. We are talking about the ability to search through text, images, videos, DNA, or any unstructured data, all with a single query.


The rule of thumb: if there is an ML model, we can search through it.


Join me to learn about the foundation blocks (LLMs and vector embeddings, Vector Databases), how they all play together and most importantly - how you can build something yourself with open-source tech.


And, of course!!! There will be a live-coding demo, where I will take you through the experience of building an AI-based search – with Weaviate, an open-source Vector Database – and adding it to an app. Now the question... should this be done in Angular, React, Vue or just pure JS ;)


#MayTheDemoGodsBeWithUs


This talk has been presented at JSNation 2023, check out the latest edition of this JavaScript Conference.

FAQ

Machine learning (ML) is a field of artificial intelligence (AI) that focuses on building systems that learn from data, identify patterns, and make decisions with minimal human intervention. It involves training algorithms on data sets to create models that can perform tasks such as recognition, prediction, and decision-making.

No, you do not need a PhD to understand machine learning. Many resources and tools are designed to make ML accessible to individuals without advanced degrees in the field.

Semantic search in machine and natural language processing involves understanding the intent and contextual meaning of a search query, rather than just matching keywords. It aims to improve the accuracy of search results by understanding the semantics, or meaning, of the words in the query.

Vector embeddings are mathematical representations of text or other data in a high-dimensional space. Machine learning models convert data into vectors of numbers that capture the essence of the data. These vectors are then used in various ML tasks, such as finding similarities between items or classifying data.

Machine learning has a wide range of applications including speech recognition, image recognition, medical diagnosis, predictive analytics, personalization in retail, and more. It is used to automate decision-making processes and create more personalized user experiences.

ChargPT appears to be a typographical error in the text, likely referring to 'ChatGPT', a variant of the GPT (Generative Pre-trained Transformer) models developed by OpenAI. These models use machine learning to generate human-like text based on the input they are given.

There are many tools available for implementing machine learning models, including TensorFlow, PyTorch, OpenAI's API, Hugging Face's Transformers, and others. These tools provide the infrastructure and pre-trained models that can be used to develop and deploy machine learning applications.

Search plays a crucial role in machine learning as it is often the starting point for gathering information and gaining insights. Improving search capabilities using ML can lead to more efficient data retrieval, better user experiences, and enhanced decision-making processes.

Sebastian Witalec
Sebastian Witalec
31 min
01 Jun, 2023

Comments

Sign in or register to post your comment.

Video Summary and Transcription

The Talk discusses the use of machine learning in search engines, specifically focusing on semantic search and vector embeddings. It explores the integration of JavaScript and machine learning models, using Weaviate as an open-source vector database. The Talk demonstrates how to connect to Weaviate, query data, and perform machine learning queries. It also highlights the benefits of Weaviate, such as its superior developer experience and performance. Additionally, the Talk addresses customization options, data privacy concerns, and the varying effectiveness of different machine learning models.

1. Introduction to Machine Learning and Search

Short description:

I'm super excited to introduce you to this topic. I didn't have any idea about it a year ago. Let's get cracking. My journey begins with a conference talk on machine learning. At first, I was confused and thought I needed a PhD. But then I realized that machine learning tools have become accessible to everyone. I will focus on the topic of search using machine learning, as everything on the internet begins with search.

So, thank you for this very nice introduction. And I'm super excited to introduce you to this topic that, let's face it, a year ago I didn't have any idea about. So I'm going to bring you on my one year journey with me. So let's get cracking.

So you heard the introduction, my name is Sebastian Vitales, I build cool stuff, and I want to talk to you about it. So my journey begins a few years ago, a long long time ago in a galaxy far away. I went to a conference and there was a very interesting talk that I was very excited about that promised that you don't need a PhD to understand machine learning. And obviously I was super excited about it because A, I didn't have any clue about ML but I really wanted to get into it, like, hey, there was a promise, like, maybe I didn't need to study for five years to do something around ML. The thing is that 10 minutes into that talk I was so confused I didn't even know what my name was. And immediately my assumption was like, yep, you need a PhD, I'm never touching ML again in my life, you know. That's it. Over. But then I was like, OK, I'm not going to give up.

The thing that changed and is happening lately, and I'm sure you're all experiencing that, is that everybody's talking about ChargPT, AI, ML, like, all those things that you're hearing. Like, I currently live in Denmark. I don't speak any Danish but if I'm in a café there's, like, people speaking randomly Danish and catching ChargPT, something, something, like, you keep catching it. I went to get a haircut, right, like, and my hairdresser got confused. It was like, OK, I'm going to ask ChargPT what kind of haircut will go with you. Even ChargPT can help with it so that's OK. And the thing is, like, what changed? Why is everyone now talking again about machine learning? Where is this buzz coming from? Why is everyone excited, not just even people in tech, but even, like, regular people that, you know, don't, you know, don't use computers for professional stuff, right? And what changed is actually that those machine learning tools became accessible, right? Like, suddenly, they're, like, at your fingertips. Suddenly, you can go, you know, to OpenAI and, like, create a login, and then you could start writing prompts and ask questions to the AI and this is mind-blowing. And there are so many different applications, all sort of, like, image generation, all sort of things happening. But I only have 20 minutes for the talk. And the organizers, like, asked me already five times. So, I'm going to finish on time. So, I'm going to narrow down and only talk about, like, a very specific thing of the machine learning, especially I have 20 minutes and I want to do some live coding as well. So, let's stick to that.

So the topic of the presentation was search or using machine learning, search. And let's face it, everything that we do on the internet begins with search, right? You want to listen to music? You search. You want to watch a movie? You're going shopping? You want to find some information? You go to Wikipedia, you always search.

2. Challenges with Traditional Search

Short description:

Search works, but it could be better. Traditional search engines may not understand the meaning of a question, leading to irrelevant results. Semantic search, on the other hand, focuses on the meaning of the question and can provide more accurate answers. By using machine learning, we can enhance the power of semantic search.

And I mean, you probably think it's like, okay, what's the problem? We've been doing that for decades. Search works. Well, I beg to differ, right? Like, it kind of works, but it could be better. And let me give you an example. So, with traditional search, you may face some challenges. So, if you went and asked, like, a traditional search engine, like, why do airplanes fly? So, maybe you have a whole database of documents that explain it. You may get an answer like, why you should fly with expensive airplanes? And it's like, well, I mean, it's pretty good because it matches airplanes, it matches why do and fly and all this. Why is this guy complaining? It's like a perfect match. Well, I mean, in reality, we asked how planes fly, and we were told to fly with expensive airlines. Well, that solves it for me. Thank you. Well, the solution for me is kind of like looking for the question from the semantic point of view. What is the meaning of the question and what sort of answer can I find for you? And actually, if you put this question into Google Search, you'll get an answer like this. You go and we'll find the dynamics of fly from NASA. And then in there, the bit that helped us find the answer was like airplanes wings are shaped to make air move faster over the top of the wing, blah, blah, blah, blah, blah. Like we don't really have any of the keyword matches, but the meaning is there, right. And that's basically the power of semantic search. So by looking at those two examples and the kind of things that you can get between the two, I mean, the conclusion is pretty straightforward, right? Like we should be going and looking more at the semantic type of search and like using machine learning for it.

QnA

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

Building a Voice-Enabled AI Assistant With Javascript
JSNation 2023JSNation 2023
21 min
Building a Voice-Enabled AI Assistant With Javascript
Top Content
This Talk discusses building a voice-activated AI assistant using web APIs and JavaScript. It covers using the Web Speech API for speech recognition and the speech synthesis API for text to speech. The speaker demonstrates how to communicate with the Open AI API and handle the response. The Talk also explores enabling speech recognition and addressing the user. The speaker concludes by mentioning the possibility of creating a product out of the project and using Tauri for native desktop-like experiences.
AI and Web Development: Hype or Reality
JSNation 2023JSNation 2023
24 min
AI and Web Development: Hype or Reality
Top Content
This talk explores the use of AI in web development, including tools like GitHub Copilot and Fig for CLI commands. AI can generate boilerplate code, provide context-aware solutions, and generate dummy data. It can also assist with CSS selectors and regexes, and be integrated into applications. AI is used to enhance the podcast experience by transcribing episodes and providing JSON data. The talk also discusses formatting AI output, crafting requests, and analyzing embeddings for similarity.
The Rise of the AI Engineer
React Summit US 2023React Summit US 2023
30 min
The Rise of the AI Engineer
Watch video: The Rise of the AI Engineer
The rise of AI engineers is driven by the demand for AI and the emergence of ML research and engineering organizations. Start-ups are leveraging AI through APIs, resulting in a time-to-market advantage. The future of AI engineering holds promising results, with a focus on AI UX and the role of AI agents. Equity in AI and the central problems of AI engineering require collective efforts to address. The day-to-day life of an AI engineer involves working on products or infrastructure and dealing with specialties and tools specific to the field.
Web Apps of the Future With Web AI
JSNation 2024JSNation 2024
32 min
Web Apps of the Future With Web AI
Web AI in JavaScript allows for running machine learning models client-side in a web browser, offering advantages such as privacy, offline capabilities, low latency, and cost savings. Various AI models can be used for tasks like background blur, text toxicity detection, 3D data extraction, face mesh recognition, hand tracking, pose detection, and body segmentation. JavaScript libraries like MediaPipe LLM inference API and Visual Blocks facilitate the use of AI models. Web AI is in its early stages but has the potential to revolutionize web experiences and improve accessibility.
Building the AI for Athena Crisis
JS GameDev Summit 2023JS GameDev Summit 2023
37 min
Building the AI for Athena Crisis
Join Christoph from Nakazawa Tech in building the AI for Athena Crisis, a game where the AI performs actions just like a player. Learn about the importance of abstractions, primitives, and search algorithms in building an AI for a video game. Explore the architecture of Athena Crisis, which uses immutable persistent data structures and optimistic updates. Discover how to implement AI behaviors and create a class for the AI. Find out how to analyze units, assign weights, and prioritize actions based on the game state. Consider the next steps in building the AI and explore the possibility of building an AI for a real-time strategy game.
Code coverage with AI
TestJS Summit 2023TestJS Summit 2023
8 min
Code coverage with AI
Codium is a generative AI assistant for software development that offers code explanation, test generation, and collaboration features. It can generate tests for a GraphQL API in VS Code, improve code coverage, and even document tests. Codium allows analyzing specific code lines, generating tests based on existing ones, and answering code-related questions. It can also provide suggestions for code improvement, help with code refactoring, and assist with writing commit messages.

Workshops on related topic

AI on Demand: Serverless AI
DevOps.js Conf 2024DevOps.js Conf 2024
163 min
AI on Demand: Serverless AI
Top Content
Featured WorkshopFree
Nathan Disidore
Nathan Disidore
In this workshop, we discuss the merits of serverless architecture and how it can be applied to the AI space. We'll explore options around building serverless RAG applications for a more lambda-esque approach to AI. Next, we'll get hands on and build a sample CRUD app that allows you to store information and query it using an LLM with Workers AI, Vectorize, D1, and Cloudflare Workers.
How to Solve Real-World Problems with Remix
Remix Conf Europe 2022Remix Conf Europe 2022
195 min
How to Solve Real-World Problems with Remix
Featured Workshop
Michael Carter
Michael Carter
- Errors? How to render and log your server and client errorsa - When to return errors vs throwb - Setup logging service like Sentry, LogRocket, and Bugsnag- Forms? How to validate and handle multi-page formsa - Use zod to validate form data in your actionb - Step through multi-page forms without losing data- Stuck? How to patch bugs or missing features in Remix so you can move ona - Use patch-package to quickly fix your Remix installb - Show tool for managing multiple patches and cherry-pick open PRs- Users? How to handle multi-tenant apps with Prismaa - Determine tenant by host or by userb - Multiple database or single database/multiple schemasc - Ensures tenant data always separate from others
Leveraging LLMs to Build Intuitive AI Experiences With JavaScript
JSNation 2024JSNation 2024
108 min
Leveraging LLMs to Build Intuitive AI Experiences With JavaScript
Featured Workshop
Roy Derks
Shivay Lamba
2 authors
Today every developer is using LLMs in different forms and shapes, from ChatGPT to code assistants like GitHub CoPilot. Following this, lots of products have introduced embedded AI capabilities, and in this workshop we will make LLMs understandable for web developers. And we'll get into coding your own AI-driven application. No prior experience in working with LLMs or machine learning is needed. Instead, we'll use web technologies such as JavaScript, React which you already know and love while also learning about some new libraries like OpenAI, Transformers.js
Llms Workshop: What They Are and How to Leverage Them
React Summit 2024React Summit 2024
66 min
Llms Workshop: What They Are and How to Leverage Them
Featured Workshop
Nathan Marrs
Haris Rozajac
2 authors
Join Nathan in this hands-on session where you will first learn at a high level what large language models (LLMs) are and how they work. Then dive into an interactive coding exercise where you will implement LLM functionality into a basic example application. During this exercise you will get a feel for key skills for working with LLMs in your own applications such as prompt engineering and exposure to OpenAI's API.
After this session you will have insights around what LLMs are and how they can practically be used to improve your own applications.
Table of contents: - Interactive demo implementing basic LLM powered features in a demo app- Discuss how to decide where to leverage LLMs in a product- Lessons learned around integrating with OpenAI / overview of OpenAI API- Best practices for prompt engineering- Common challenges specific to React (state management :D / good UX practices)
Working With OpenAI and Prompt Engineering for React Developers
React Advanced Conference 2023React Advanced Conference 2023
98 min
Working With OpenAI and Prompt Engineering for React Developers
Top Content
Workshop
Richard Moss
Richard Moss
In this workshop we'll take a tour of applied AI from the perspective of front end developers, zooming in on the emerging best practices when it comes to working with LLMs to build great products. This workshop is based on learnings from working with the OpenAI API from its debut last November to build out a working MVP which became PowerModeAI (A customer facing ideation and slide creation tool).
In the workshop they'll be a mix of presentation and hands on exercises to cover topics including:
- GPT fundamentals- Pitfalls of LLMs- Prompt engineering best practices and techniques- Using the playground effectively- Installing and configuring the OpenAI SDK- Approaches to working with the API and prompt management- Implementing the API to build an AI powered customer facing application- Fine tuning and embeddings- Emerging best practice on LLMOps
Relational Database Modeling for GraphQL
GraphQL Galaxy 2020GraphQL Galaxy 2020
106 min
Relational Database Modeling for GraphQL
Top Content
WorkshopFree
Adron Hall
Adron Hall
In this workshop we'll dig deeper into data modeling. We'll start with a discussion about various database types and how they map to GraphQL. Once that groundwork is laid out, the focus will shift to specific types of databases and how to build data models that work best for GraphQL within various scenarios.
Table of contentsPart 1 - Hour 1      a. Relational Database Data Modeling      b. Comparing Relational and NoSQL Databases      c. GraphQL with the Database in mindPart 2 - Hour 2      a. Designing Relational Data Models      b. Relationship, Building MultijoinsTables      c. GraphQL & Relational Data Modeling Query Complexities
Prerequisites      a. Data modeling tool. The trainer will be using dbdiagram      b. Postgres, albeit no need to install this locally, as I'll be using a Postgres Dicker image, from Docker Hub for all examples      c. Hasura