Тёмный

LangChain Tutorial (Python) #7: Long Term Chat Memory with Upstash Redis 

Leon van Zyl
Подписаться 19 тыс.
Просмотров 4,9 тыс.
50% 1

#openai #langchain
The Memory modules in Langchain make it simple to permanently store conversations in a database, so that we can recall and continue those conversations in the future - just like the conversations in ChatGPT.
📑 Useful Links:
Langchain Python docs: python.langchain.com/docs/get...
Source Code: github.com/leonvanzyl/langcha...
Upstash: upstash.com/?Leon_...
☕ Buy me a coffee:
www.buymeacoffee.com/leonvanzyl
💬 Chat with Like-Minded Individuals on Discord:
/ discord
🧠 I can build your chatbots for you!
www.cognaitiv.ai
🕒 TIMESTAMPS:
00:00 - Introduction to Chat Memory
00:28 - Project setup
02:00 - Benefit of Memory over manual history
03:19 - Adding ConversationBufferMemory
04:59 - LLMChain Class
07:30 - Upstash Redis Chat Memory
10:56 - Attach Redis History to Memory
12:18 - Adding Memory to Agents

Наука

Опубликовано:

 

7 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 37   
@MatheusTassoo
@MatheusTassoo 2 месяца назад
best LangChain series i’ve seen on youtube! would be awesome if you make a series about LangGraph
@leonvanzyl
@leonvanzyl 2 месяца назад
LangGraph series coming soon
@fformentif
@fformentif Месяц назад
@@leonvanzyl awesome!!
@karimshakirov
@karimshakirov 4 месяца назад
This is the best LangChain playlist on youtube! Thank you a lot for doing it!
@leonvanzyl
@leonvanzyl 4 месяца назад
Thank you for the support ❤️
@tony99659
@tony99659 3 месяца назад
Leon this content is amazing, you definitely have a skill to teach!
@leonvanzyl
@leonvanzyl 3 месяца назад
Thank you
@mlTS7626
@mlTS7626 20 дней назад
For such nice tutorial, It's worth sharing the code as well :D
@akshitha986
@akshitha986 Месяц назад
Wow! Subscribed. Keep Going. Love from 🇮🇳
@jo_ji
@jo_ji 2 месяца назад
Perfect lesson, thank you so much. I will be on heaven when langgraph series come
@leonvanzyl
@leonvanzyl 2 месяца назад
Coming soon 😁
@udaynj
@udaynj 2 месяца назад
Thanks Leon. Great teaching style. I just subscribed
@leonvanzyl
@leonvanzyl 2 месяца назад
Thank you 🙏
@patotegonzalez
@patotegonzalez 2 месяца назад
Great series, very helpful man
@CreatewwwPl
@CreatewwwPl 2 месяца назад
Amazing tutorials. Thanks for all
@leonvanzyl
@leonvanzyl 2 месяца назад
You're welcome 🤗
@inaminute00
@inaminute00 4 месяца назад
Hey, thank you so much for making these content so digestible. Could you please also make tutorials on LangServe.
@leonvanzyl
@leonvanzyl 4 месяца назад
For sure!
@andy111007
@andy111007 4 месяца назад
@@leonvanzyl is the code available ?
@Oliver-zy8sq
@Oliver-zy8sq Месяц назад
How to have it not always put the entire Chat history into the answer? Please help me with this. And another question. Will the chatbot be able to retrieve memory from even the oldest messages stored in the database and if so does this clutter up the token usage?
@nadershalabi6241
@nadershalabi6241 7 дней назад
Thank you for the great work on these series. Q: We do not need to add the Embeddings functionality when using Memory?
@leonvanzyl
@leonvanzyl 7 дней назад
You can have both. Long term memory for recalling your past conversations, and RAG (Embeddings) for accessing knowledge bases.
@udaynj
@udaynj 2 месяца назад
Seems would be cheaper in production to just use sqlite or postgres etc...by the time you add up all the 3rd party components, you are adding enormous cyber security risk + costs for each of these components, although they make delivery so much easier. What is your opinion?
@chakerayachi8468
@chakerayachi8468 3 месяца назад
really thanks for the video buti have a question is it possible to add upstash redis into agents memory ?
@leonvanzyl
@leonvanzyl 3 месяца назад
Absolutely!
@quangtho29101990
@quangtho29101990 2 месяца назад
Amazing tut. Thank you so much! In your implementation, what if the chat memory have millions of history messages? Can we still use this technique or Should we vectorized and embedded the chat history into vector database?
@leonvanzyl
@leonvanzyl 2 месяца назад
There are a few approaches that you could follow. With those many messages I would definitely "archive" order messages by adding them to the Vector Store. These conversations could also be summarised before being added to the Vector DB as well.
@quangtho29101990
@quangtho29101990 2 месяца назад
@@leonvanzyl Thank you. But why did you use ConversationBufferMemory instead of VectorStoreRetrieverMemory? I still don't get it, I thought we should use VectorStoreRetrieverMemory type because we're using VectorDB to save the chat history!
@quangtho29101990
@quangtho29101990 2 месяца назад
​@@leonvanzyl Why did you use ConversationBufferMemory instead of VectorStoreRetrieverMemory? I thought we should use VectorStoreRetrieverMemory with VectorDB? Could you please explain more?
@alaminegueye3218
@alaminegueye3218 4 месяца назад
Hello ! This video was just crystal clear, thank you for that ! I Am currently looking for a way to implement upstash redis with LCEL chains (RunnableWithMemory class), there are examples in the LangChain documentation but they use a file as database for simplicity Could you make a video about that ?
@leonvanzyl
@leonvanzyl 4 месяца назад
I really want to create a series on LCEL. It seems to be a topic that a lot people struggle with. It's honestly easy once you get the hang of it. Honestly though, I wouldn't go LCEL unless I really had to.
@alaminegueye3218
@alaminegueye3218 4 месяца назад
@@leonvanzyl Yes it's pretty controversed. I personnally use it because many templates and examples from the langchain documentation are based off of LCEL so it is easier for me to get up and running fast
@seththunder2077
@seththunder2077 4 месяца назад
@@leonvanzylSadly the issue right now is that langchain is forcing us to use LCEL. I checked the github link you provided but it seems its the wrong link. Could you update it please
@fformentif
@fformentif Месяц назад
@@leonvanzyl What would you use instead of LCEL for production code?
@htmlfivedev
@htmlfivedev 21 день назад
Thanx for this ... subscribed!!
Далее
Python RAG Tutorial (with Local LLMs): AI For Your PDFs
21:33
Luiza Rasulova #luizarasulova
00:37
Просмотров 613 тыс.
Gặp 2 thánh troll | CHANG DORY | ometv
00:42
Просмотров 24 млн
Memory in LangChain | Deep dive (python)
20:40
Просмотров 9 тыс.
LangChain: Giving Memory to LLMs
15:48
Просмотров 20 тыс.
LangGraph Simplified: Master Custom AI Agent Creation
43:51
TOP 6 Mistakes in RxJS code
18:35
Просмотров 13 тыс.
Acer Predator Тараканьи Бега!
1:00
Просмотров 173 тыс.