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

  Рет қаралды 4,887

Leon van Zyl

Leon van Zyl

Күн бұрын

#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

Пікірлер: 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!!
@tony99659
@tony99659 3 ай бұрын
Leon this content is amazing, you definitely have a skill to teach!
@leonvanzyl
@leonvanzyl 3 ай бұрын
Thank you
@mlTS7626
@mlTS7626 18 күн бұрын
For such nice tutorial, It's worth sharing the code as well :D
@karimshakirov
@karimshakirov 3 ай бұрын
This is the best LangChain playlist on youtube! Thank you a lot for doing it!
@leonvanzyl
@leonvanzyl 3 ай бұрын
Thank you for the support ❤️
@udaynj
@udaynj 2 ай бұрын
Thanks Leon. Great teaching style. I just subscribed
@leonvanzyl
@leonvanzyl 2 ай бұрын
Thank you 🙏
@akshitha986
@akshitha986 Ай бұрын
Wow! Subscribed. Keep Going. Love from 🇮🇳
@patotegonzalez
@patotegonzalez 2 ай бұрын
Great series, very helpful man
@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 😁
@CreatewwwPl
@CreatewwwPl 2 ай бұрын
Amazing tutorials. Thanks for all
@leonvanzyl
@leonvanzyl 2 ай бұрын
You're welcome 🤗
@nadershalabi6241
@nadershalabi6241 5 күн бұрын
Thank you for the great work on these series. Q: We do not need to add the Embeddings functionality when using Memory?
@leonvanzyl
@leonvanzyl 5 күн бұрын
You can have both. Long term memory for recalling your past conversations, and RAG (Embeddings) for accessing knowledge bases.
@htmlfivedev
@htmlfivedev 19 күн бұрын
Thanx for this ... subscribed!!
@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 ?
@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!
@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?
@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?
@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?
LangChain Tutorial (JS) #7: Long Term Conversation Memory
19:06
Leon van Zyl
Рет қаралды 3,6 М.
КАРМАНЧИК 2 СЕЗОН 7 СЕРИЯ ФИНАЛ
21:37
Inter Production
Рет қаралды 492 М.
Vivaan  Tanya once again pranked Papa 🤣😇🤣
00:10
seema lamba
Рет қаралды 30 МЛН
Sigma Girl Past #funny #sigma #viral
00:20
CRAZY GREAPA
Рет қаралды 31 МЛН
LangChain Tutorial (Python) #6: Self-Reasoning Agents with Tools
13:21
Python RAG Tutorial (with Local LLMs): AI For Your PDFs
21:33
pixegami
Рет қаралды 135 М.
Memory in LangChain | Deep dive (python)
20:40
Eden Marco
Рет қаралды 9 М.
LangChain Tutorial (Python) #1: Intro & Setup
9:58
Leon van Zyl
Рет қаралды 13 М.
LangGraph Simplified: Master Custom AI Agent Creation
43:51
Data Centric
Рет қаралды 16 М.
Understand Ollama and LangChain Chat History in 10 minutes
11:30
Fast and Simple Development
Рет қаралды 1,8 М.
I wish every AI Engineer could watch this.
33:49
1littlecoder
Рет қаралды 61 М.
Спутниковый телефон #обзор #товары
0:35
Product show
Рет қаралды 2 МЛН
Blue Mobile 📲 Best For Long Audio Call 📞 💙
0:41
Tech Official
Рет қаралды 1 МЛН
Собери ПК и Получи 10,000₽
1:00
build monsters
Рет қаралды 2,2 МЛН