NodeJS & AI: Building Smarter Applications

This ad is not shown to multipass and full ticket holders
React Summit
React Summit 2025
June 13 - 17, 2025
Amsterdam & Online
The biggest React conference worldwide
Learn More
In partnership with Focus Reactive
Upcoming event
React Summit 2025
React Summit 2025
June 13 - 17, 2025. Amsterdam & Online
Learn more
Bookmark
Rate this content

Unlock the potential of AI in Node.js applications through practical, real-world implementations. This session demonstrates how to integrate both open-source and closed AI models to build intelligent features like semantic search and autonomous agents. Attendees will learn production-ready patterns for RAG systems, vector embeddings, and AI agents while understanding the core architectural decisions behind each implementation. Perfect for developers ready to move beyond basic API calls to building sophisticated AI-enhanced applications.

This talk has been presented at Node Congress 2025, check out the latest edition of this JavaScript Conference.

FAQ

A model in AI is a specialized program trained on massive amounts of data to recognize patterns and make predictions or decisions. These models perform specific tasks, such as understanding text, generating content, or classifying images.

Large language models are designed to understand and generate human language, and they are based on transformer architecture. The foundational paper for this architecture is 'Attention is All You Need.'

Closed models, like ChatGPT or Gemini, are accessed via API and come with a cost, whereas open-source models can be downloaded and run locally or hosted on cloud infrastructure. Examples of open-source models include Lama and DeepSeq.

RAC, which stands for Retrieve of Method Generation, helps reduce hallucination in AI models by providing relevant information to improve accuracy and enable the use of private data for more powerful models.

Embedding transforms data, particularly text, into a list of numbers to capture its semantic meaning. This positions the text in a high-dimensional space where similar meanings are closer together, facilitating retrieval tasks like similarity search.

Vectors represent the semantic meaning of text and are stored in vector databases. They allow for similarity searches to retrieve information based on how close and semantically similar the meanings are.

The retrieval techniques mentioned include keyword or term-based, semantic, and hybrid retrieval. In the example, semantic retrieval is used to match user queries with relevant information.

An agent in AI is a system that works to achieve specific goals by planning, reasoning, and using tools. Unlike simple prompt-response models, agents plan their approach, maintain context, and adapt to fulfill tasks rather than just provide static responses.

The React pattern involves defining functions (tools), setting a mission or goal, reasoning through the mission, executing actions with appropriate tools, observing the results, and synthesizing a response based on the gathered context.

Aileen Villanueva
Aileen Villanueva
19 min
17 Apr, 2025

Comments

Sign in or register to post your comment.
  • Christos kuznos
    Christos kuznos
    None
    are they more than the 2 types of models, closed and open source?
Video Summary and Transcription
Today's Talk explored combining Node.js and artificial intelligence to build smart applications. Two types of models, closed and open source, were discussed, with closed models accessed via an API and open source models hosted locally or on the cloud. The use of RAC (Retrieve of Method Generation) to enhance models was explained, along with the process of obtaining data and improving retrieval performance. Chunking, embedding, and vector databases were introduced as techniques for organizing and transforming data. The Talk also covered data retrieval using semantic search and the generation of human-readable answers using models. The concept of enhancing models with agents was discussed, focusing on how agents break down complex goals and utilize external functions. The use of tools and the React pattern in implementing agents was highlighted. Lastly, the Talk touched on implementing agent patterns and enhancing LLMs, with demos and code available for further exploration.

1. Introduction to Node.js and AI

Short description:

Today we'll explore combining Node.js and artificial intelligence to build smart applications. Models are specialized programs trained on data to recognize patterns and make predictions. We'll be using large language models that excel at understanding and generating human language. There are two types of models: closed and open source. Closed models like chat GPT and Gemini are accessed via an API. Open source models like Lama and Gemma can be hosted locally or on the cloud. While these models are powerful, they have limitations. That's where new techniques come into play.

Hi all, I'm excited to talk today about how we can combine Node.js and one part of artificial intelligence to build applications that aren't just functional, but smart. There has been an increasing importance of artificial intelligence in software, and I want to encourage you TypeScript and JavaScript developers to learn and apply these technologies.

My name is Aileen. I'm currently working as a software developer at Orama, and I've been doing software for 10 years now. I organize technology meetups at my city, and I'm really passionate about the intersection of AI and software.

But before we dive in, I want us to align with some concepts that we'll be talking about. And let's start with defining what is a model. And I want you to think of a model as a specialized program that has been trained on massive amounts of data to recognize patterns and make predictions or decisions. These models have been trained to do specific tasks, like understanding text, generating content or classifying images. And we're going to interact with them by providing these models an input. It would use all of these learned patterns and generate an output. This output could be an inference, a generation or a prediction.

Today we're going to be using large language models. And a large language model is a model that is good at understanding and generating human language. They're based on transformer architecture. There's a paper called Attention is All You Need, and I really recommend it to read it if you really want to understand how they work underneath it. They're trained on large amounts of data, and they work for many tasks. So they can do summarizations. They can do question answering or translation. Today we're going to talk about two types of models, which is the closed models. And these models are models like chat GPT, like Cloud, From Anthropic, like Gemini, and some of Mistral models. These models are accessed via an API, and they come with a cost. You cannot download it, so you basically rely on these providers to use these models. The other type of models are open source models. And these models, you can find them hosted in Hug and Face. You can download them and run them on your local machine using Olama. You could also download them and host them on any cloud infrastructure, and these models are models like Lama, like DeepSeq, or like Gemma from Google. But as you can see, these models are really powerful, and we can definitely make them more powerful. Let's remember that these models have been trained with huge amounts of data, and it's no question that these models are not good at math or very specific needs or niche of an industry. So that's when a new technique comes into play.

2. Using RAC to Enhance Models

Short description:

RAC (Retrieve of Method Generation) reduces hallucination by providing accurate information to models. Private data use and RAC can make models more powerful. However, models may be outdated or lack knowledge. For example, when asked about the speakers of Node Congress 2025, a model's knowledge was cut off in October 2024. To address this, we'll walk through creating and enhancing the model with RAC. The first step is obtaining data, which can be in various formats like PDFs, JSON, or crawled from websites. Next, we use splitting to make it easier to find relevant information and improve retrieval performance. The LimeChain library and recursive characters text splitter function can be used for this purpose.

And that technique is RAC. RAC stands for Retrieve of Method Generation. And RAC definitely helps out on things like hallucination. While it does not eliminate hallucination, it could definitely reduce it. Because if a model doesn't know something, it might have made up an answer that's not accurate. So with RAC, if we provide that information, that model can answer correctly. Or we can enable private data use. So definitely, if they were not trained with data that you have available only for you, it would definitely help make your model more powerful.

But also, let's remember that maybe all of these models are not trained daily. So there's knowledge that they don't have, or they might be outdated. And there is a specific use case that I want to show you. So I asked Claude who are going to be the speakers of Node Congress 2025. And as you can see in the answer, it mentions that the knowledge of that model at this current date was cut off on October 2024. So it doesn't know who are going to be the speakers of this conference. And so for today's exercise, I'm going to go and walk you through how to create and enhance this model with RAC to actually answer this question. We're going to follow a couple of steps. And our first step is data. So there's many ways that you can encounter data for this improvement of our models with RAC. And that could be a PDF, that could be a JSON, a CSV file, a crawler, a DocuSign site, or a database. In this case, I'm using a crawler to go into all of the Node Congress web page. And I'm just adding some markdown files that I'll later have available for them to read. So this is an example of how the markdown looks based on the crawler that I did for this web page.

The next step is the split. So large documents can be overwhelming, and our AI model can make it hard for you to find relevant information across all of this data. So with splitting, we're going to cut it and maybe make it easier to look for something like in a book. So you can look for information in a chapter rather than reading the whole book. So split is a good technique that is used to improve retrieval performance. And also, it's very good at representing context. In here, I'm using a library called LimeChain, and I'm using the function recursive characters text splitter. This is also something that you will need to decide based on your use case.

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

It's a Jungle Out There: What's Really Going on Inside Your Node_Modules Folder
Node Congress 2022Node Congress 2022
26 min
It's a Jungle Out There: What's Really Going on Inside Your Node_Modules Folder
Top Content
The talk discusses the importance of supply chain security in the open source ecosystem, highlighting the risks of relying on open source code without proper code review. It explores the trend of supply chain attacks and the need for a new approach to detect and block malicious dependencies. The talk also introduces Socket, a tool that assesses the security of packages and provides automation and analysis to protect against malware and supply chain attacks. It emphasizes the need to prioritize security in software development and offers insights into potential solutions such as realms and Deno's command line flags.
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
Top Content
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.
ESM Loaders: Enhancing Module Loading in Node.js
JSNation 2023JSNation 2023
22 min
ESM Loaders: Enhancing Module Loading in Node.js
Top Content
ESM Loaders enhance module loading in Node.js by resolving URLs and reading files from the disk. Module loaders can override modules and change how they are found. Enhancing the loading phase involves loading directly from HTTP and loading TypeScript code without building it. The loader in the module URL handles URL resolution and uses fetch to fetch the source code. Loaders can be chained together to load from different sources, transform source code, and resolve URLs differently. The future of module loading enhancements is promising and simple to use.
Towards a Standard Library for JavaScript Runtimes
Node Congress 2022Node Congress 2022
34 min
Towards a Standard Library for JavaScript Runtimes
Top Content
There is a need for a standard library of APIs for JavaScript runtimes, as there are currently multiple ways to perform fundamental tasks like base64 encoding. JavaScript runtimes have historically lacked a standard library, causing friction and difficulty for developers. The idea of a small core has both benefits and drawbacks, with some runtimes abusing it to limit innovation. There is a misalignment between Node and web browsers in terms of functionality and API standards. The proposal is to involve browser developers in conversations about API standardization and to create a common standard library for JavaScript runtimes.

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.
AI for React Developers
React Advanced 2024React Advanced 2024
142 min
AI for React Developers
Top Content
Featured Workshop
Eve Porcello
Eve Porcello
Knowledge of AI tooling is critical for future-proofing the careers of React developers, and the Vercel suite of AI tools is an approachable on-ramp. In this course, we’ll take a closer look at the Vercel AI SDK and how this can help React developers build streaming interfaces with JavaScript and Next.js. We’ll also incorporate additional 3rd party APIs to build and deploy a music visualization app.
Topics:- Creating a React Project with Next.js- Choosing a LLM- Customizing Streaming Interfaces- Building Routes- Creating and Generating Components - Using Hooks (useChat, useCompletion, useActions, etc)
Working With OpenAI and Prompt Engineering for React Developers
React Advanced 2023React Advanced 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
Free webinar: Building Full Stack Apps With Cursor
Productivity Conf for Devs and Tech LeadersProductivity Conf for Devs and Tech Leaders
71 min
Free webinar: Building Full Stack Apps With Cursor
Top Content
WorkshopFree
Mike Mikula
Mike Mikula
In this webinar I’ll cover a repeatable process on how to spin up full stack apps in Cursor.  Expect to understand techniques such as using GPT to create product requirements, database schemas, roadmaps and using those in notes to generate checklists to guide app development.  We will dive further in on how to fix hallucinations/ errors that occur, useful prompts to make your app look and feel modern, approaches to get every layer wired up and more!  By the end expect to be able to run your own ai generated full stack app on your machine!
Node.js Masterclass
Node Congress 2023Node Congress 2023
109 min
Node.js Masterclass
Top Content
Workshop
Matteo Collina
Matteo Collina
Have you ever struggled with designing and structuring your Node.js applications? Building applications that are well organised, testable and extendable is not always easy. It can often turn out to be a lot more complicated than you expect it to be. In this live event Matteo will show you how he builds Node.js applications from scratch. You’ll learn how he approaches application design, and the philosophies that he applies to create modular, maintainable and effective applications.

Level: intermediate
Build and Deploy a Backend With Fastify & Platformatic
JSNation 2023JSNation 2023
104 min
Build and Deploy a Backend With Fastify & Platformatic
Top Content
WorkshopFree
Matteo Collina
Matteo Collina
Platformatic allows you to rapidly develop GraphQL and REST APIs with minimal effort. The best part is that it also allows you to unleash the full potential of Node.js and Fastify whenever you need to. You can fully customise a Platformatic application by writing your own additional features and plugins. In the workshop, we’ll cover both our Open Source modules and our Cloud offering:- Platformatic OSS (open-source software) — Tools and libraries for rapidly building robust applications with Node.js (https://oss.platformatic.dev/).- Platformatic Cloud (currently in beta) — Our hosting platform that includes features such as preview apps, built-in metrics and integration with your Git flow (https://platformatic.dev/). 
In this workshop you'll learn how to develop APIs with Fastify and deploy them to the Platformatic Cloud.