Building a ReAct AI Agent (Tutorial)

Elvis Saravia · Beginner ·🛠️ AI Tools & Apps ·1y ago

Key Takeaways

This video demonstrates how to build a simple ReAct AI agent using Flowise, a tool built on top of Lang Chain, and integrates it with a language model from OpenAI and a calculator tool. The agent uses the ReAct logic to decide what action to take and is optimized for use with chat models.

Full Transcript

in this demonstration we're going to use flse to create our first basic react agent inside of flowes you will choose chop flows then you will choose add new then you will start off with a blank canvas okay so now what we can do here is we can start off with our language model so we need a language model this is going to help power this agent capabilities such as planning and reasoning and we're going to use chat open AI so here we have chat open Ai and you should have already set up your credentials so we have a video about that as well in the previous section where we introduced LCI and you will take that credential and you're going to set it up here so I'm going to choose my credential here because I already have it stored and then for this I'm going to use the GPD 40 mini which is the one of the latest models from openi and I need to use one of the latest models because I want to use the model that has really good reasoning capabilities but you can experiment with any of these models or different providers as well so we have this model here and then what we need is we need our react agent so instead of flow wise because it's built on top of Lang chain we have the ability to use Lang Chain's react agent functionality so if we go under agents right here you will see that there are several types of agents that have been built in into the FL I tool and so the one that we're going to use is this react agent for chat models so agent that uses the react logic to decide what action to take optimize to be used with chat models so I'm just going to drag this here and so now we have two of the core components that makes this react agent so what I need to do is I need to connect this now and we have our chat model right here and then we're missing two components here we discuss the ability of the react agent to use these external tools so we can connect an external tool right here so we can use for instance something like a calculator as a very basic example here so I'm going to go here and you will see that there's also a tool section so here's a tool section and under Tools we have this calculator tool so I can go and drag that here and now we have a calculator tool it's not asking me to do anything special it's just a calculator but I can now connect that to allow tools so I can continue to add more tools if I want but for this demonstration I'm going to keep it very basic in future use cases and demonstrations we're going to be using all kinds of very complex tools such as search engines and so forth then the last component here is memory so I'm going to take a memory component from here so if we go to the list here we have memory and under memory we have different kinds of memory components one type of memory component that we can use here is this buffer memory and what does it do it retrieve chat messages stored in a database so basically it's going to allow the react agent to use its chat history if it needs to access whatever information it had pulled already from the external tool so I'm just going to drag it here and then I'm just going to connect it right here we have our memory component we have our chat model and we have our calculator so that's it we have developed a very basic react agent and now we can save this so I'm going to go here to this button I'm going to save and I'm going to give it a name I'm going to call this basic react I'm going to save this and the cool thing about flowise is that I can very quickly test this idea so we have this chat feature here that I can go and open and then I can start to interact with my agent so I can type a question like how much is 98,000 times I'm giving it a m problem here I want agent to actually use the calculator because that is what it has access to I'm just going to ask you this question for problems like this you really don't want to trust a language model to do Tas like this so it's going to be very useful for the agent to access this calculator and it's going to see it it's going to see oh I have a sort of mat problem here and it's going to decide okay I need to take these two different numbers and I need to give and provide that to the calculator as some type of input and then the calculator is going to respond back with the result and then it's going to have the result and then the language mod will compose a final answer for us that's sort of what the process is here so you can see here it says 98,000 * 150,000 is this huge number here so again for calculations like this we really want to use like a calculator tool to do this so this is the first example of a basic react agent with OP the different components that we discussed in this module and in upcoming modules we are going to build on top of this idea and build more complex agentic systems that are going to leverage complex tools and leverage this idea of the ability of an agent to use memory to use different tools and use a very powerful large language model to complete very complex tasks

Original Description

Learn more about how to build AI agents in my new course: https://dair-ai.thinkific.com/courses/introduction-ai-agents Use code AGENTS20 to get an extra 20% off. -- Tutorial on how to build a simple ReAct AI agent. #ai #chatgpt #tech
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Elvis Saravia · Elvis Saravia · 0 of 60

← Previous Next →
1 101 ways to solve search (by Pratik Bhavsar)
101 ways to solve search (by Pratik Bhavsar)
Elvis Saravia
2 TLDR Generation of Scientific Documents | ML Interview #1 with Isabel Cachola
TLDR Generation of Scientific Documents | ML Interview #1 with Isabel Cachola
Elvis Saravia
3 Sentiment Analysis: Key Milestones, Challenges and New Directions
Sentiment Analysis: Key Milestones, Challenges and New Directions
Elvis Saravia
4 Discriminative Adversarial Search for Abstractive Summarization (by Thomas Scialom)
Discriminative Adversarial Search for Abstractive Summarization (by Thomas Scialom)
Elvis Saravia
5 Question Understanding: COVID-Q: 1,600+ Questions about COVID-19
Question Understanding: COVID-Q: 1,600+ Questions about COVID-19
Elvis Saravia
6 Getting Started with NLP
Getting Started with NLP
Elvis Saravia
7 Building tools and frameworks for large-scale social media mining (by Dr. Juan M. Banda)
Building tools and frameworks for large-scale social media mining (by Dr. Juan M. Banda)
Elvis Saravia
8 TextAttack: A Framework for Data Augmentation and Adversarial Training in NLP
TextAttack: A Framework for Data Augmentation and Adversarial Training in NLP
Elvis Saravia
9 Dive into Deep Learning (Study Group): Introduction to Deep Learning | Session 1
Dive into Deep Learning (Study Group): Introduction to Deep Learning | Session 1
Elvis Saravia
10 Dive into Deep Learning (Study Group): Multilayer Perceptrons | Session 4
Dive into Deep Learning (Study Group): Multilayer Perceptrons | Session 4
Elvis Saravia
11 How I read and annotate ML papers
How I read and annotate ML papers
Elvis Saravia
12 Keep Learning ML  (Session 1) | DSV, CompLex, Modern tools for emotions
Keep Learning ML (Session 1) | DSV, CompLex, Modern tools for emotions
Elvis Saravia
13 Dive into Deep Learning (Study Group): Preliminaries | Session 2
Dive into Deep Learning (Study Group): Preliminaries | Session 2
Elvis Saravia
14 Keep Learning ML #2 | Language-conditioned policy learning, Effective ML Testing, EagerPy
Keep Learning ML #2 | Language-conditioned policy learning, Effective ML Testing, EagerPy
Elvis Saravia
15 Dive into Deep Learning (Study Group): Linear Neural Networks | Session 3
Dive into Deep Learning (Study Group): Linear Neural Networks | Session 3
Elvis Saravia
16 Dive into Deep Learning (Study Group): Multilayer Perceptrons | Session 4
Dive into Deep Learning (Study Group): Multilayer Perceptrons | Session 4
Elvis Saravia
17 Keep Learning ML #3 | Contrastively Trained Structured World Models
Keep Learning ML #3 | Contrastively Trained Structured World Models
Elvis Saravia
18 Dive into Deep Learning (Study Group): Deep Learning Computation with PyTorch |  Session 5
Dive into Deep Learning (Study Group): Deep Learning Computation with PyTorch | Session 5
Elvis Saravia
19 Dive into Deep Learning (Study Group): Convolutional Neural Networks | Session 6
Dive into Deep Learning (Study Group): Convolutional Neural Networks | Session 6
Elvis Saravia
20 Dive into Deep Learning (Study Group): Modern CNNs | Session 7
Dive into Deep Learning (Study Group): Modern CNNs | Session 7
Elvis Saravia
21 101 ways to solve neural search with Jina
101 ways to solve neural search with Jina
Elvis Saravia
22 (Hopefully-Reusable) Life Lessons for PhD Students in NLP
(Hopefully-Reusable) Life Lessons for PhD Students in NLP
Elvis Saravia
23 How to save the world and forward your career in 5 easy steps | Women in NLP Talks
How to save the world and forward your career in 5 easy steps | Women in NLP Talks
Elvis Saravia
24 Prompt Engineering Overview
Prompt Engineering Overview
Elvis Saravia
25 Getting Started with the OpenAI Playground
Getting Started with the OpenAI Playground
Elvis Saravia
26 LM-Guided Chain of Thought
LM-Guided Chain of Thought
Elvis Saravia
27 Elements of a Prompt
Elements of a Prompt
Elvis Saravia
28 Reasoning with Intermediate Revision and Search with LLMs #chatgpt #ai #llms #science #programming
Reasoning with Intermediate Revision and Search with LLMs #chatgpt #ai #llms #science #programming
Elvis Saravia
29 General Tips for Designing Prompts
General Tips for Designing Prompts
Elvis Saravia
30 Efficient Infinite Context Transformers #ai #machinelearning #research #llms #science
Efficient Infinite Context Transformers #ai #machinelearning #research #llms #science
Elvis Saravia
31 Best Practices and Lessons Learned on Synthetic Data for Language Models #ai #machinelearning #genai
Best Practices and Lessons Learned on Synthetic Data for Language Models #ai #machinelearning #genai
Elvis Saravia
32 Reducing Hallucinations in Structured Outputs via RAG #chatgpt #ai #llms #programming
Reducing Hallucinations in Structured Outputs via RAG #chatgpt #ai #llms #programming
Elvis Saravia
33 Basic Prompt Examples for LLMs
Basic Prompt Examples for LLMs
Elvis Saravia
34 LLM In Context Recall is Prompt Dependent  #llms #ai #chatgpt #machinelearning
LLM In Context Recall is Prompt Dependent #llms #ai #chatgpt #machinelearning
Elvis Saravia
35 Zero-shot Prompting Explained
Zero-shot Prompting Explained
Elvis Saravia
36 RAG Faithfulness #llms #ai #gpt4
RAG Faithfulness #llms #ai #gpt4
Elvis Saravia
37 Understanding LLM Settings
Understanding LLM Settings
Elvis Saravia
38 Llama 3 is here! | First impressions and thoughts
Llama 3 is here! | First impressions and thoughts
Elvis Saravia
39 Llama 3 is Here! #ai #llms #llama3
Llama 3 is Here! #ai #llms #llama3
Elvis Saravia
40 Microsoft introduces Phi-3 | The most capable small language model?
Microsoft introduces Phi-3 | The most capable small language model?
Elvis Saravia
41 Microsoft introduces Phi-3! #ai #llms #microsoft
Microsoft introduces Phi-3! #ai #llms #microsoft
Elvis Saravia
42 Make Your LLM Fully Utilize the Context #ai #llms #machinelearning
Make Your LLM Fully Utilize the Context #ai #llms #machinelearning
Elvis Saravia
43 When to Retrieve? #ai #llms #machinelearning
When to Retrieve? #ai #llms #machinelearning
Elvis Saravia
44 Training an LLM to effectively use information retrieval
Training an LLM to effectively use information retrieval
Elvis Saravia
45 State-of-the-art open-source LLM judges #ai #machinelearning #gpt4
State-of-the-art open-source LLM judges #ai #machinelearning #gpt4
Elvis Saravia
46 Better and Faster LLMs via Multi-token Prediction
Better and Faster LLMs via Multi-token Prediction
Elvis Saravia
47 AlphaMath Almost Zero #ai #science #machinelearning
AlphaMath Almost Zero #ai #science #machinelearning
Elvis Saravia
48 SWE-Agent | An LLM-based Software Engineering Agent
SWE-Agent | An LLM-based Software Engineering Agent
Elvis Saravia
49 [LLM NEWS] AlphaFold 3, xLSTM, OpenAI's Model Spec, DeepSeek-V2, OpenDevin CodeAct 1.0
[LLM NEWS] AlphaFold 3, xLSTM, OpenAI's Model Spec, DeepSeek-V2, OpenDevin CodeAct 1.0
Elvis Saravia
50 LLM-powered tool for web scraping #ai #chatgpt #engineering
LLM-powered tool for web scraping #ai #chatgpt #engineering
Elvis Saravia
51 Learn about LLMs in this NEW course #ai #chatgpt #engineering
Learn about LLMs in this NEW course #ai #chatgpt #engineering
Elvis Saravia
52 [LLM NEWS] KANs, Gemma 10M Context, OpenAI Updates?, Automatic Prompt Engineering, Tokenizer Arena
[LLM NEWS] KANs, Gemma 10M Context, OpenAI Updates?, Automatic Prompt Engineering, Tokenizer Arena
Elvis Saravia
53 [LLM News] GPT4-o, Project Astra, Veo, Copilot+ PCs, Gemini 1.5 Flash, Chameleon
[LLM News] GPT4-o, Project Astra, Veo, Copilot+ PCs, Gemini 1.5 Flash, Chameleon
Elvis Saravia
54 Enhancing Answer Selection in LLMs #ai #machinelearning #engineering
Enhancing Answer Selection in LLMs #ai #machinelearning #engineering
Elvis Saravia
55 On exploring LLMs #ai #promptengineering #chatgpt
On exploring LLMs #ai #promptengineering #chatgpt
Elvis Saravia
56 Transformers Can Do Arithmetic with the Right Embeddings #ai #machinelearning #engineering
Transformers Can Do Arithmetic with the Right Embeddings #ai #machinelearning #engineering
Elvis Saravia
57 [LLM News] xAI Series B, Codestral, LLM Guide, AutoGen Course, Symbolic Chain-of-Thought
[LLM News] xAI Series B, Codestral, LLM Guide, AutoGen Course, Symbolic Chain-of-Thought
Elvis Saravia
58 PR-Agent #ai #gpt4 #software
PR-Agent #ai #gpt4 #software
Elvis Saravia
59 Extracting features from Claude 3 Sonnet
Extracting features from Claude 3 Sonnet
Elvis Saravia
60 Has prompt engineering been solved?
Has prompt engineering been solved?
Elvis Saravia

This video teaches how to build a simple ReAct AI agent using Flowise and integrate it with a language model and a calculator tool. The agent uses the ReAct logic to decide what action to take and is optimized for use with chat models. This is a basic example of how to build an agent-based system that can leverage complex tools and memory to complete tasks.

Key Takeaways
  1. Choose the Flowise tool and create a new project
  2. Select the ReAct agent component and add it to the project
  3. Integrate a language model from OpenAI with the ReAct agent
  4. Add a calculator tool as an external tool to the ReAct agent
  5. Connect the memory component to the ReAct agent
  6. Save and test the ReAct agent
💡 The ReAct AI agent can be used to leverage complex tools and memory to complete tasks, and the use of a language model and external tools can improve the agent's capabilities.

Related AI Lessons

Up next
Salesforce Flow New Features (Summer '26) | Open Record, URL & Show Toast Messages
AITECHONE
Watch →