No Code RAG Agents? You HAVE to Check out n8n + LangChain

Cole Medin
25 Aug 202417:45

Summary

TLDRThis video demonstrates how to create a full-fledged RAG (Retrieval-Augmented Generation) AI agent without writing any code, using n8n, a workflow automation tool, and LangChain, an AI development library. By integrating Google Drive as the knowledge base, the AI agent can answer questions from stored documents. The creator walks through building this no-code agent step-by-step, leveraging n8n's workflow features, including triggers, actions, and LangChain’s tools for chat memory and vector databases. Viewers can download the workflows and easily implement the solution themselves for powerful AI-driven automation.

Takeaways

  • 🤖 Building AI agents using RAG (retrieval-augmented generation) can be done without coding by using n8n and LangChain.
  • 🔧 n8n is a no-code workflow automation tool that allows users to create advanced AI agents with tool calling and RAG.
  • 📂 The AI agent can utilize Google Drive as its knowledge base by uploading documents for the agent to access and answer questions.
  • 💡 n8n workflows are simple to set up, consisting of triggers and actions that connect to AI models, databases, and external tools like Google Drive.
  • 🚀 The LangChain AI agent node in n8n simplifies complex tasks like tool calling, memory management, and interaction with vector databases.
  • 💬 The n8n interface provides a built-in chat window to easily test and iterate AI agents directly within the UI.
  • 📄 Users can customize their vector databases and memory settings, with options to store data locally or use services like Supabase and Pinecone.
  • 🔄 AI agents can retrieve documents from the vector database, which are indexed based on user queries and stored as vector embeddings using OpenAI models.
  • 📊 Workflow nodes allow integration with Google Drive, enabling the AI agent to find, download, and add files to its knowledge base.
  • 🌐 The workflow can be embedded into websites, allowing users to deploy the AI chatbot with RAG capabilities via a simple HTML embed code.

Q & A

  • What does the speaker mean by 'RAG AI agent'?

    -RAG stands for Retrieval-Augmented Generation, a technique used in AI where external data, like documents, are retrieved and incorporated into a language model's responses. In this case, the speaker builds a RAG AI agent using Google Drive as a knowledge base, allowing the AI to answer questions based on uploaded documents.

  • How does n8n help in building AI workflows without code?

    -n8n is a no-code workflow automation tool that allows users to build complex AI workflows by connecting different nodes, such as triggers and actions. It integrates with tools like LangChain, enabling the creation of RAG AI agents without writing code. Users can import or create workflows, including those for AI agents, using simple drag-and-drop functionality.

  • What role does LangChain play in the workflow?

    -LangChain is a library for AI development that simplifies the integration of advanced AI capabilities like tool calling and memory. In the workflow described, LangChain powers the AI agent by enabling it to interact with tools, handle memory, and retrieve information from a vector database without requiring manual coding.

  • What is the benefit of self-hosting n8n over using services like Zapier?

    -Self-hosting n8n offers significant cost advantages, as users can avoid expensive monthly fees associated with services like Zapier. Additionally, it provides greater control over the workflows and scaling capabilities, allowing users to customize and expand their setup without restrictions.

  • What is the significance of using a vector store in the AI agent?

    -A vector store is crucial in RAG workflows because it allows the AI agent to retrieve and store document embeddings as vectors. This enables the AI to efficiently search for and retrieve relevant documents based on user queries. In the speaker's setup, the vector store holds documents from Google Drive, which the AI uses to answer questions.

  • How does the AI agent retrieve documents from Google Drive?

    -The AI agent is programmed to search for files in Google Drive using a query provided by the user. It downloads the file, extracts the text, and stores it in the vector database for future use. The AI agent can later retrieve this information to answer questions based on the content of those documents.

  • Why is Superbase recommended for production use?

    -Superbase is recommended for production environments because it provides a more scalable and robust solution for managing both chat memory and vector storage. Unlike the in-memory storage option, which is more suitable for local or demo purposes, Superbase can handle larger datasets and ensures better data persistence and synchronization across workflows.

  • What options does the AI agent offer for different language models?

    -The AI agent supports multiple language models, including OpenAI's GPT models, Anthropic's Claude, Meta's Llama, and Grok. Users can select the model based on their needs and easily configure the credentials for accessing these models.

  • What is the purpose of chunking documents when adding them to the vector database?

    -Chunking documents into smaller parts (in this case, 1,000 characters) helps optimize the retrieval process. When a document is queried, the AI searches the vector database for the most relevant chunks, making the process more efficient and accurate than trying to retrieve an entire large document at once.

  • How can the AI agent be embedded into a website?

    -The AI agent can be easily embedded into a website using a code snippet generated by n8n. The speaker demonstrates how to copy the code and insert it into an HTML editor or website, creating a chat widget that allows users to interact with the AI agent directly on the site.

Outlines

00:00

🤖 Building an AI Agent without Code Using n8n and LangChain

This paragraph introduces the concept of creating advanced AI agents using RAG (Retrieval-Augmented Generation) without writing any code. The speaker plans to demonstrate how to use the no-code workflow automation tool n8n in combination with LangChain to build an AI agent that answers questions using documents stored in Google Drive. They emphasize that even though they enjoy coding, using no-code tools like n8n can be more efficient for many projects.

05:00

⚙️ Workflow Automation with n8n: Triggers and Actions

The paragraph explains how workflows in n8n are structured around triggers and actions. Triggers start the workflow, such as receiving a chat message, while actions execute tasks, like interacting with AI models or Google Drive. The user can easily add a chat window in the UI for testing purposes. The LangChain integration in n8n simplifies setting up AI agents by automatically providing tools, memory, and chat models. It supports multiple AI models like OpenAI and others, making it versatile for various applications.

10:01

🧠 Integrating RAG: Tools and Vector Stores

This section covers the integration of custom tools and vector stores into the RAG agent. The speaker explains how n8n offers built-in tools like a vector store, which stores and retrieves documents based on user queries. They recommend using Superbase for production environments to manage both chat memory and vector stores. For quick demonstrations, everything is stored locally in memory, with embedding models using OpenAI for document processing. The speaker highlights the flexibility of n8n, which allows for customizing workflows and tool usage without writing code.

15:02

📂 Managing Documents with Google Drive and Vector Databases

This paragraph dives into how documents from Google Drive can be added to the RAG agent's knowledge base. A specific workflow is set up to search, download, and add documents to the vector database for future queries. The speaker demonstrates how users can instruct the agent to retrieve and store relevant files from Google Drive. They also explain the importance of controlling which documents get added to the knowledge base to avoid bloating the vector database. The process involves setting up parameters for querying Google Drive and handling the text extraction and embedding tasks.

🔄 File Querying and Knowledge Base Testing

Here, the speaker tests the AI agent’s functionality by asking it a question that it cannot answer initially because the required document hasn’t been added yet. After adding the document from Google Drive to the knowledge base, they repeat the question, and the agent retrieves the correct information. This test showcases how the AI agent can dynamically add files to its knowledge base and answer questions based on the newly added data. They also mention the option of scheduling automatic updates to the vector database.

🔧 Workflow Troubleshooting: Handling Workflow IDs and Memory Keys

The speaker discusses a technical issue in n8n where the workflow ID used to call tools must differ from the ID of the main workflow, resulting in errors if not handled correctly. The workaround involves setting up a separate workflow to reference the correct memory key when interacting with the vector database. This ensures that data retrieval and insertion use the same workflow, avoiding conflicts. They explain how using Superbase as a vector store eliminates this issue by allowing dynamic memory key management.

🌐 Embedding Chatbots in Websites and Future Plans

This final section demonstrates how to embed the AI chatbot into a website using a simple code snippet. The speaker highlights how the chat widget can interact with users and answer questions based on the RAG integration. They conclude by teasing future content, focusing on deploying the system into production environments and integrating with Superbase. They encourage viewers to provide feedback and express interest in more advanced tutorials on RAG and no-code AI development.

Mindmap

Keywords

💡RAG (Retrieval-Augmented Generation)

RAG is a technique in AI where a model retrieves relevant documents from a knowledge base (like Google Drive) to answer questions or generate content. In the video, RAG is used to empower an AI agent to access specific documents from a vector store, ensuring that the AI can provide contextually accurate answers based on the user’s uploaded files.

💡n8n

n8n is a no-code workflow automation tool that integrates with various platforms like Google Drive and LangChain. In the video, n8n is highlighted for its ability to build AI agents with RAG capabilities without writing any code. The speaker praises its flexibility, scalability, and the ease with which users can self-host it, unlike expensive alternatives such as Zapier.

💡LangChain

LangChain is a framework designed for building applications powered by language models. It allows developers to integrate tools like memory, embeddings, and vector stores into AI workflows. In the video, LangChain is seamlessly integrated into n8n, enabling the creation of a RAG AI agent without coding. The speaker demonstrates its role in handling chat models, tool calling, and memory management.

💡Vector Database

A vector database stores and retrieves data in vector form, which is critical for tasks like semantic search and information retrieval in AI. In the video, the vector database is used to store and retrieve document embeddings (vectorized versions of documents) that the AI agent uses to answer queries. The speaker demonstrates adding Google Drive documents to this database for future use by the AI agent.

💡Google Drive Integration

Google Drive integration allows the AI agent to access documents stored in the user’s Google Drive. In the video, the workflow enables the AI agent to search, retrieve, and extract text from Google Drive files to update its knowledge base, demonstrating how external documents can be seamlessly incorporated into the RAG system.

💡Chat Memory

Chat memory allows an AI agent to remember past interactions and conversations. In the video, the speaker uses local chat memory for storing previous chats but also mentions other options, such as using databases like Postgres or Redis. This memory enables the AI agent to provide continuity and context in conversations by recalling earlier parts of the interaction.

💡Embeddings

Embeddings are vector representations of data (text, images, etc.), which capture the semantic meaning of that data. In the video, the speaker uses OpenAI’s text-embedding models to convert Google Drive documents into vectors that the AI can retrieve and use in answering user queries. This process is essential for the RAG functionality of the AI agent.

💡No-code AI Development

No-code AI development refers to building AI systems without writing any programming code, often by using drag-and-drop platforms or workflow automation tools. The video focuses heavily on how n8n allows users to create a RAG-powered AI agent without coding, showing how powerful AI models and workflows can be constructed through visual tools and pre-built integrations.

💡API Integration

API integration refers to the process of connecting applications to external services via their APIs (Application Programming Interfaces). In the video, the AI agent connects to services like OpenAI for language models, Google Drive for document storage, and even LangChain’s AI agent node through APIs. The integration is shown to be seamless within the n8n workflow environment.

💡Superbase

Superbase is a platform that offers hosted databases and backend services. In the video, Superbase is recommended for production-level RAG setups, particularly because it can manage both chat memory and vector databases. The speaker highlights it as a superior choice for long-term, scalable solutions over using local memory or in-memory databases.

Highlights

Using n8n and LangChain, you can build a full-blown RAG AI agent using Google Drive as a knowledge base with zero coding required.

n8n is a workflow automation tool that is self-hosted, scalable, and cheaper than alternatives like Zapier.

RAG (Retrieval-Augmented Generation) AI agents can be built simply with n8n, integrating directly with LangChain for advanced AI development.

The agent can retrieve documents from Google Drive and answer user queries by utilizing a vector database and LangChain’s capabilities.

The no-code approach allows for rapid AI agent development, using pre-built workflows that handle chat models, memory, and document retrieval.

Testing the AI agent is easy with a built-in chat window in n8n, allowing real-time feedback and adjustments.

You can use multiple chat models like OpenAI, Claude, Grok, or LLaMA for flexible integration in the AI agent setup.

Custom tools can be added to the AI agent workflows in n8n, including any n8n workflows packaged as tools for multi-step processes.

Google Drive documents can be added dynamically to the AI agent's knowledge base via vector store retrieval, ensuring precise control over what information is accessed.

The integration allows vector databases to store chunks of documents for later retrieval, ensuring efficient RAG-based answers.

Using embeddings from OpenAI’s text models, documents are processed into vectors for effective knowledge retrieval.

The workflow includes an option to search for Google Drive documents by query, download them, and add them to the vector database for RAG integration.

A workaround is required in n8n to call a secondary workflow for vector database operations, ensuring seamless data insertion and retrieval.

The embedded chat interface can be added to any website, offering a smooth user experience while interacting with the AI agent.

This no-code workflow setup can be scaled to production using tools like Supabase for both chat memory and vector storage, further enhancing the AI’s capabilities.

Transcripts

play00:00

building Advanced AI agents with rag is

play00:02

definitely not something that's limited

play00:04

to complex and custom coded applications

play00:07

today I'm going to show you how to use

play00:08

my favorite workflow automation tool n8n

play00:11

along with my favorite library for AI

play00:14

development Lang chain to build a

play00:16

full-blown rag AI agent using my Google

play00:19

Drive as my knowledge base so the agent

play00:21

can answer questions using the documents

play00:23

that I upload and when I say no code I

play00:26

mean that today we are literally going

play00:27

to write zero lines of code to build our

play00:30

AI agent and don't get me wrong I love

play00:32

to code my own agents but I would be

play00:35

dumb to code them myself every single

play00:37

time when a lot of the times I can make

play00:39

them very simply without code using n8n

play00:42

n8n is a workflow automation tool

play00:44

similar to make.com or zapier but it is

play00:48

way better because you can self-host it

play00:50

so you don't have to pay hundreds and

play00:51

hundreds of dollars a month like I did

play00:53

at one point for zapier and you can

play00:55

scale it infinitely so definitely more

play00:57

on that in a future video but on top on

play01:00

top of that which already makes n8n

play01:01

amazing it integrates directly with Lang

play01:04

chain so it is so so easy to build AI

play01:07

agents that are really powerful with

play01:08

tool calling and rag just like what I'm

play01:10

about to show you now so without further

play01:13

Ado let's get right into the meat of it

play01:14

and see how easy it is to build a rag

play01:17

agent with no code all right so I have

play01:20

already fully built out these NN

play01:22

workflows for my rag AI agent because I

play01:25

just want to walk through it with you

play01:26

very very smoothly to give you a lot of

play01:28

value very quickly you can also steal

play01:30

these workflows from me if you want I've

play01:32

got a link to a GitHub repository in the

play01:34

description of this video so you can

play01:35

download these workflows as Json files

play01:38

and then you go into your own n8n

play01:40

instance in the top right here you click

play01:41

on the three dots and then import from

play01:43

file and in seconds you can bring in

play01:45

this entire workflow into your own n8n

play01:47

instance so you can take this further

play01:50

and build something amazing with Rag and

play01:52

so with that we can actually dive into

play01:53

what this workflow looks like so just

play01:55

like with make.com and zapier every

play01:57

workflow in N an is made up of two four

play02:00

parts you have your triggers which is

play02:01

what starts these workflows and then you

play02:03

have your actions the nodes within the

play02:05

workflow that actually do things like

play02:07

interacting with AI or your Google drive

play02:10

or your vector database whatever it

play02:11

might be so the trigger for this and and

play02:14

workflow is a chat input so when chat

play02:17

message received if you click into this

play02:18

the options are quite simple you just

play02:20

give authentication optionally then also

play02:22

the initial message that's going to be

play02:24

there in the chat widget for the user

play02:26

when they first click on it to interact

play02:28

with the agent in a chat bot and then

play02:30

when you add this as a trigger to an NA

play02:32

end workflow you're immediately given

play02:34

this option in the bottom middle here to

play02:35

open up a chat window and this is one of

play02:37

my favorite Parts about n it makes it so

play02:40

easy to quickly test your AI agents

play02:42

because you have a chat window directly

play02:44

in the UI to test things out as you're

play02:47

iterating on the prompt or the tools or

play02:49

the vector database whatever it might be

play02:52

so this just makes it so easy to test

play02:54

things and iterate on things and so

play02:55

we'll even be looking at this later when

play02:57

I give a demonstration of this AI agent

play02:59

with Rag and so we have our trigger here

play03:02

that I just covered and when there's a

play03:04

chat message that comes through it flows

play03:06

immediately into our rag AI agent which

play03:08

is a tools agent that uses Lang chain

play03:10

under the hood and so the way that I

play03:12

know that this uses Lang chain aside

play03:14

from just the documentation telling me

play03:16

if I click on the plus icon here to add

play03:18

a new node to the workflow and I search

play03:20

for Lang chain sure enough AI agent

play03:23

which that's the node that I chose here

play03:25

is the second option and this just does

play03:28

everything for me I don't have to code

play03:30

anything to have my tools my memory and

play03:32

my chat model if I want to get more

play03:34

custom with it I can use the Lang chain

play03:36

code node to actually code things if I

play03:39

want something more robust that maybe no

play03:41

code can't do for me because no code

play03:43

can't do everything but it can do most

play03:45

things and so with this use case I can

play03:47

just use the AI agent from laying chain

play03:49

here and it's got everything for me it's

play03:51

got the chat model so I'm using open AI

play03:53

in this case and I can use any model

play03:55

that I want it's really easy to set up

play03:57

my credentials as well I just need an

play03:58

API key

play04:00

and then also if I wanted a different

play04:01

chat model I can click on this connector

play04:03

here I could use claw if I want to

play04:06

select anthropic I could use grock for

play04:08

llama 3.1 I could use ol llama um open

play04:12

AI like I already have selected pretty

play04:13

much everything that I actually care

play04:15

about is here already and so even if

play04:17

there's something else like if I wanted

play04:19

to use fireworks for example maybe I

play04:21

could set up custom code here but for

play04:23

most cases I'm happy with everything

play04:25

here so it is just amazing no code

play04:27

needed for all these Integrations and

play04:29

then also for the chat memory there's a

play04:31

lot of options for that so I'm just

play04:33

using chat memory which is basically

play04:34

going to be stored locally on my n

play04:36

instance um but there are other options

play04:39

as well so if I click on the memory

play04:40

connector here we could use something

play04:42

like postgress chat memory so having a

play04:44

SQL table that manages all the

play04:46

conversations or using reddis for

play04:48

example a lot of options here as well

play04:51

and then for the tool calling the best

play04:53

part of the AI agent where we actually

play04:55

have the rag integration there are a lot

play04:58

of options for Tool as well so if I

play05:00

click on this connector there are a lot

play05:02

of custom tools that are already

play05:03

provided for you like a calculator or a

play05:05

vector store which is how I actually

play05:07

retrieve the documents to answer

play05:09

questions with rag um and then my

play05:12

favorite part is you can literally call

play05:15

any n8n workflow as a tool and so you

play05:18

set up a workflow to do something like

play05:20

interacting with Google Drive and a

play05:22

multi-step workflow which I'll show a

play05:23

little bit and then you just tell the AI

play05:26

agent how to use this workflow like what

play05:28

parameters to give and then also you

play05:30

tell it when to use that workflow just

play05:33

like you would with any tool that you

play05:34

might Define in custom code and so you

play05:36

can literally have all the power of any

play05:38

na workflow you want even if there's a

play05:40

ton of steps there just packaged as a

play05:42

neat little tool that you can just shove

play05:44

onto your rag AI agent and so yeah just

play05:46

really cool stuff um and so there's two

play05:49

tools that I have here for this agent

play05:51

the first one is that built-in Vector

play05:53

store tool where I retrieve the

play05:55

documents based on a user query um to

play05:58

answer a question or something like like

play05:59

that and so I add this on as a tool

play06:02

that's connected here and then it asks

play06:04

me to supply a vector store and so I'm

play06:06

just using an in-memory Vector store so

play06:08

similar to my chat memory it's going to

play06:10

just be stored locally on my n8n

play06:12

instance so there'll be like files that

play06:14

are there on the server that I am

play06:15

hosting my n8n there are other options

play06:18

as well though so you could use um for

play06:20

example a sua base Vector store or a

play06:22

pine cone Vector store uh if you want my

play06:25

recommendation I would actually highly

play06:27

recommend to go with super base here and

play06:29

the reason that is if I go back to the

play06:31

chat memory here this is just a nice

play06:33

little gold nugget for you here uh you

play06:35

can use a super based postgress table

play06:38

for your chat memory and then you can

play06:40

also set up a superbase vector store so

play06:43

you can have everything managed for your

play06:45

Rag and your chat memories all within

play06:47

one place in super base so that's my

play06:49

recommendation if you want to take

play06:50

something like this to production but

play06:52

just for a quick demonstration purpose

play06:53

here I'm running everything locally for

play06:55

my memory and my Vector store uh and

play06:58

then for your embedding models there's a

play07:00

lot of options for that as well I'm just

play07:02

using open AI for my embeddings as well

play07:05

so same credentials and then I'm just

play07:06

using the text embedding three large

play07:08

model uh from open AI for my embedding

play07:10

so that's what actually takes the

play07:12

different chunks of documents that I put

play07:14

into my Vector database and turns them

play07:16

into vectors for retrieval

play07:19

later um and then on top of that I have

play07:21

a model that's associated with this tool

play07:24

to retrieve information so I'm just

play07:25

using the same uh GPT 40 mini here as

play07:29

well um because you're going to get the

play07:30

documents from the vector database and

play07:33

you need a large language model to

play07:34

process that and pick out the right

play07:36

information and so I'm using GPT for

play07:38

that again as well so that is everything

play07:40

for the rag retrieval the actual

play07:42

retrieval part of rag now to put

play07:45

documents in the vector database

play07:47

knowledge base I have another tool here

play07:51

and this is a NN workflow as a tool like

play07:55

I was mentioning earlier and so the way

play07:57

that my chatot works here and you could

play07:58

take this in a milon different ways is

play08:01

it's going to start out with nothing in

play08:03

the vector database but I have infinite

play08:06

access to my Google Drive so I can talk

play08:08

to my AI chat bot and say I have this

play08:10

file in Google Drive I want you to add

play08:12

it to your knowledge base for future

play08:13

reference and so what it's going to do

play08:15

for this tool here is I have a little

play08:18

description that says use this to search

play08:20

for a file in Google Drive so the user

play08:22

might say I want my meeting notes from

play08:24

last week to be added to the knowledge

play08:26

base so it'll search for those meeting

play08:28

notes in Google Drive download it and

play08:30

add it to the vector database knowledge

play08:32

base for future querying so that's the

play08:34

description to tell my AI agent when to

play08:36

use this tool and then I have parameters

play08:38

so in a Json example here I tell the AI

play08:41

agent what parameters to give this

play08:43

workflow so that it can execute properly

play08:45

and so in this case I'm just giving one

play08:47

parameter here which is a query how are

play08:49

you going to search Google drive to find

play08:51

that file to download and then add to

play08:54

the vector database very very simple

play08:57

couple of other options here like the

play08:58

workflow ID so this tells it what

play09:01

workflow and na end to actually execute

play09:03

for this tool and then also the field

play09:05

that's going to be outputed from that

play09:06

workflow that you want to use as the

play09:08

response that would then tell the large

play09:10

language model what happened when it

play09:11

invoked that tool very very simple stuff

play09:15

and so the workflow that I have for this

play09:17

is actually this one right here so it

play09:20

starts out with a web hook and so this

play09:24

gets the query and then it passes it

play09:26

into the Google Drive and so let me

play09:28

click into this and show you it's going

play09:30

to search for a file or a folder based

play09:32

on the query here and so if you search

play09:35

for um 822 meeting notes for example it

play09:38

would find that word doc file that has

play09:42

those meeting notes in your Google Drive

play09:44

and then on the next action it's going

play09:45

to download that file then after it

play09:48

downloads it it's going to extract the

play09:50

text from that file and so now at this

play09:53

point in the workflow I have all the

play09:54

text from that file that I've downloaded

play09:56

from Google Drive and I can now put it

play09:58

into my Vector database so it's added as

play10:00

the knowledge base so the AI agent can

play10:02

use that to answer questions later and

play10:05

so for this I'm just using the same user

play10:07

documents memory key so the way that I

play10:10

retrieve my documents is using this

play10:12

memory key and the way that I insert

play10:14

documents is also using this key

play10:15

otherwise those two things are not going

play10:17

to sync up um and then it's kind of a

play10:19

similar setup here where I just have to

play10:21

choose my embeddings which I'm going to

play10:23

use gbt 40 or not gbt 40 that's for the

play10:26

llm I'm going to use the text 3 large

play10:29

and beddings from open Ai and then I

play10:31

have a default data loader so this is

play10:33

going to basically Define how I take my

play10:36

text and put it as vectors in my Vector

play10:39

database and so I'm going to split into

play10:41

chunks basically just using a 1,000

play10:43

chunk size text splitter so all the same

play10:46

kind of stuff that you would see if you

play10:48

were to code a rag agent yourself um but

play10:51

you have all the power and customization

play10:52

still within n with absolutely no code

play10:55

and so I'm not really losing out on much

play10:57

here doing it in a workflow with no code

play10:59

which is the best part of it um and so

play11:02

with all this together I can now test

play11:04

this out a little bit so let me show one

play11:06

quick thing here I'm going to go to a

play11:09

couple of files that I have here for rag

play11:12

I've got two meeting notes Here one from

play11:14

822 and one from 823 and these this is

play11:17

just fake data that I made up just to

play11:19

have something here for rag um and so

play11:21

what I'm going to do is I'm going to

play11:23

tell my AI agent to add these to its

play11:26

knowledge base and then I'm going to ask

play11:28

a question that could only be answered

play11:30

when it has this in its knowledge base

play11:32

so I'm going to go back to my rag agent

play11:34

here I'm going to save it and then I'll

play11:36

go to the chat window in the bottom

play11:37

middle and first I'm going to ask it a

play11:40

question that it shouldn't know at this

play11:41

point because it doesn't have these

play11:43

meeting notes in its knowledge base I'm

play11:44

going to say what are the action items

play11:47

from the meeting on

play11:50

8:22 and it's going to take a little bit

play11:52

to get a response try to find it in the

play11:54

vector database and sure enough I don't

play11:56

have access to that specific um folder

play11:59

or that specific file right here and so

play12:01

I'll say okay cool uh find the

play12:05

822 meeting notes in the drive and add

play12:10

them to your knowledge base I don't have

play12:13

to get really specific in my quest like

play12:15

this but I'm just doing it right now to

play12:16

absolutely make sure that it works for a

play12:18

good demo here and there we go and that

play12:20

was like super quick too which is also a

play12:22

really huge plus with na it is as fast

play12:24

so I have successfully added the meeting

play12:26

notes to my knowledge base so now I'm

play12:28

going to ask the exact same question

play12:30

here and this time it's going to have an

play12:31

answer and it's going to be based on

play12:33

this file that we have here so the

play12:35

action items from the meeting on 8:22 R

play12:37

plan a budget make a bunch of money

play12:39

everything that we have exactly right

play12:41

here in our Google drive file so I

play12:43

proved that it didn't have this

play12:44

information before I showed in real time

play12:46

how I was able to add it and then get an

play12:49

answer from this document and the reason

play12:51

you might want to do it this way the

play12:52

other way you could do it is you could

play12:54

just feed in every single file in your

play12:56

Google drive into the vector database

play12:58

automatically like every morning or

play13:00

every hour something like that and then

play13:02

that would be there automatically in the

play13:03

knowledge base um but that when you do

play13:05

it that way sometimes your vector

play13:07

database can get bloated by a ton of

play13:08

files that you don't necessarily want to

play13:10

have available for Rag and so this way I

play13:12

have control over exactly what I give to

play13:15

my agent to have knowledge of later on

play13:18

when I want to reference something again

play13:20

in a conversation like maybe to remember

play13:21

something like the action items here so

play13:24

that's why I have it set it up this way

play13:26

um but yeah there are a lot of ways that

play13:27

you could do this the best part about n

play13:30

is however you want to do it you can do

play13:31

it very easily in these workflows like

play13:33

it was it just took minutes to create

play13:34

this workflow to find a file in Google

play13:37

Drive download it and put it in the

play13:38

vector database but you could set up

play13:39

something similar that you'd run on a

play13:41

schedule basis to uh maybe pull files

play13:43

from a specific folder and constantly

play13:46

hydrate your vector database with those

play13:48

files there's a ton of things you could

play13:49

do U so it's very very powerful stuff

play13:52

the one thing that I wanted to mention

play13:54

is that I have a second workflow

play13:56

involved here and that is simply a

play13:58

workflow to call this web hook so

play14:03

there's kind of a little issue with naan

play14:05

that's unfortunate but I found a really

play14:06

solid work around here when you have a

play14:09

tool that references a workflow ID you

play14:12

can't reference the workflow ID of the

play14:15

workflow that has the agent so I can't

play14:17

just take what I have right here is my

play14:19

workflow ID and dump that in here

play14:22

because it gives some weird errors

play14:24

saying that there's like not credentials

play14:25

or something like that so you have to

play14:27

reference a separate workflow

play14:29

so I just have this workflow that then

play14:31

hooks right back into um this web hook

play14:34

within my original workflow um and the

play14:36

reason you need to do that is because in

play14:39

my in-memory Vector store here my memory

play14:41

key it says here that it's prefixed by

play14:43

the workflow ID to avoid Collision so if

play14:45

I am inserting into a vector database in

play14:48

a different workflow it's going to have

play14:50

a different memory key because it's

play14:51

prefixed by a separate workflow ID so I

play14:54

have to have my retrieval be the exact

play14:57

same workflow as

play14:59

I have the insertions the data

play15:01

insertions into the vector database

play15:03

otherwise they'll be prefixed by

play15:04

different workflow IDs and so that data

play15:05

won't actually be available for the

play15:07

agent so it's like a really really

play15:09

technical thing that I just had to solve

play15:11

but I have it solved for you now and so

play15:12

that's why there'll be two workflows in

play15:14

the GitHub repository um but yeah it's

play15:16

just like a tiny little thing that you

play15:18

had to do unfortunately um but however

play15:20

if you were to use um a production

play15:23

Vector database like super base then you

play15:25

would't have to worry about this because

play15:27

when you set up a a supera base Vector

play15:29

store here as the tool for the regag AI

play15:32

agent you get to define the memory key

play15:35

in a more Dynamic way where it's not

play15:36

going to be prefixed by the workflow ID

play15:38

that's something that's just done for

play15:39

the inmemory vector store so you

play15:41

wouldn't have this issue and you could

play15:42

actually have this whole tool to add a

play15:44

Google drive file to a vector database

play15:47

as that separate workflow instead of

play15:49

having this weird workaround where you

play15:50

need to invoke this separate workflow

play15:52

that just hooks then right back into

play15:54

this part of uh this whole workflow

play15:56

setup that I have here so I hope that

play15:58

makes s it's all Built For You at this

play16:00

point so now you can just take these

play16:02

workflows that I have steal them for

play16:04

yourselves and expand upon this to make

play16:06

the vector database production or to add

play16:08

more tools or to improve upon the rag or

play16:10

the prompts whatever you want to do this

play16:12

is yours to play around with no code at

play16:14

all and you can even embed this in a

play16:16

website so I'll show that really quick

play16:18

as well just to give you a lot here so I

play16:20

can take um the embed so I go to more

play16:23

info right here uh when I open my chat

play16:26

window and I know that this is code we

play16:28

didn't have have to write any code

play16:29

though and you don't have to know code

play16:31

to be able to embed this you can just

play16:32

take this right here copy it you and you

play16:35

can go over to your website I'm just

play16:36

going to go to an online HTML editor

play16:39

here you can paste it in here and then

play16:41

when I click run I have this chat widget

play16:43

in the bottom right like you see on a

play16:45

lot of websites where I can click into

play16:47

this and there we go we've got our chat

play16:49

bot now and I can say something like Hi

play16:51

how are you and then after it gives me

play16:53

an answer super super fast um I can say

play16:56

what are the action items from 820 too

play16:59

and so that's going to again reference

play17:00

the document with rag giv me the answers

play17:03

because I've already inserted that into

play17:04

the vector database super cool um so

play17:07

yeah that's pretty much everything for

play17:08

this

play17:09

workflow um I'm definitely going to be

play17:11

making more videos on rag with NN in the

play17:14

future because this is super powerful

play17:15

stuff and one thing that I'm probably

play17:17

going to do is also focus on super base

play17:20

and getting things deployed in

play17:21

production so if you're interested in

play17:23

that let me know I would really

play17:24

appreciate knowing just so I can know

play17:26

that that's something that you want to

play17:27

see and then uh I'll probably make a

play17:29

video on it so yeah more on rag to come

play17:32

I hope that you found this useful and

play17:34

that you're able to build really cool

play17:35

things with Rag and N using this as your

play17:38

foundation if you found this helpful I

play17:40

would really really appreciate a like

play17:42

and a subscribe and with that I will see

play17:44

you in the next video

Rate This

5.0 / 5 (0 votes)

相关标签
AI automationno-code toolsLangChainn8n workflowRAG AIGoogle Drivevector databaseworkflow automationAI developmentchatbots
您是否需要英文摘要?