Aracılara Bellek ve Konuşma Durumu Kazandırma
LangChain aracılarına kısa ve uzun süreli bellek ekleyerek dönüşler arasında bağlamı hatırlamalarını ve tutarlı, çok adımlı konuşmalar üretmelerini sağlayın.
Aracılara Bellek ve Konuşma Durumu Kazandırma, CoddyKit'te ücretsiz bir AI Agents with LangChain & Autonomous Workflows dersidir. Bu, 4 dersinin 4. dersidir. Aşağıdan dersin tamamını ücretsiz okuyabilir, sonra tarayıcıda yerleşik kod editörü ve 7/24 yapay zeka koçu ile uygulamalı olarak pratik yapabilirsin. Bu, AI Agents with LangChain & Autonomous Workflows öğrenme yolunun bir parçasıdır ve ilerlemeniz web ve CoddyKit uygulaması arasında senkronize olur. AI Agents with LangChain & Autonomous Workflows kursu toplamda 4 dersten oluşur.
Bu dersin bazı bölümleri henüz çevrilmemiş olup İngilizce olarak gösterilmektedir.
Why Agents Need Memory
LLMs are stateless: each call knows nothing about the last unless you tell it. Without memory, an agent forgets your name the instant you say it.
The Context Window
Memory ultimately means stuffing prior info into the context window. That window is finite, so the real challenge is deciding what to keep and what to drop.
Buffer Memory
Buffer memory stores the whole conversation and replays it every turn. Accurate, but it grows without bound and eventually overflows the context window.
from langchain.memory import ConversationBufferMemory
memory = ConversationBufferMemory()
memory.save_context({'input': 'Hi, I am Lena'}, {'output': 'Hello Lena!'})Windowed Memory
Windowed memory keeps only the last N exchanges. It bounds size and forgets older context — perfect when only recent turns matter.
from langchain.memory import ConversationBufferWindowMemory
memory = ConversationBufferWindowMemory(k=4)Summary Memory
Summary memory periodically condenses older turns with the LLM, keeping the gist plus recent messages — preserving meaning in a small footprint.
from langchain.memory import ConversationSummaryMemory
memory = ConversationSummaryMemory(llm=llm)Short-Term vs Long-Term
Two flavors serve different needs: short-term memory holds the current chat in the prompt, while long-term persists facts across sessions in a store.
Long-Term Memory with Vectors
For knowledge that must survive sessions, store messages as embeddings in a vector store and retrieve the most relevant ones by similarity instead of replaying everything.
from langchain.memory import VectorStoreRetrieverMemory
memory = VectorStoreRetrieverMemory(retriever=vectorstore.as_retriever())Wiring Memory into a Chain
Wire memory into a conversation chain. Each call loads prior context, runs the model, and saves the new exchange automatically.
from langchain.chains import ConversationChain
chain = ConversationChain(llm=llm, memory=memory)
print(chain.predict(input='What is my name?'))Session and User Scoping
Real apps serve many users at once. Scope memory by session or user id so separate conversations never leak into each other.
store = {}
def get_memory(session_id):
if session_id not in store:
store[session_id] = ConversationBufferMemory()
return store[session_id]Cost and Privacy Tradeoffs
More memory means more tokens — higher cost and latency. Long-term stores may hold sensitive data, so mind retention limits and what you're allowed to keep.
Choosing a Memory Strategy
Choosing a strategy: buffer or window for short chats, summary for long ones, vector for cross-session facts — always scoped per user and mindful of cost.
Quick Check
You've met several memory types — which fits when? Time to put it to the test.
Recap
Recap: memory feeds prior context into a finite window. Buffer, window, and summary trade accuracy for size, vector stores enable long-term recall — always scope and watch cost.
Sıkça Sorulan Sorular
“Aracılara Bellek ve Konuşma Durumu Kazandırma” dersi ücretsiz mi?
Evet — “Aracılara Bellek ve Konuşma Durumu Kazandırma” dersin tüm metni burada web'de ücretsiz olarak okunabilir. Etkileşimli olarak pratik yapmak (yerleşik kod editörü ve 7/24 yapay zeka koçu) ve AI Agents with LangChain & Autonomous Workflows kursunun geri kalanını açmak için CoddyKit PRO'ya yükselt. AI Agents with LangChain & Autonomous Workflows kursu toplamda 4 dersten oluşur.
“Aracılara Bellek ve Konuşma Durumu Kazandırma” dersinde ne öğreneceğim?
LangChain aracılarına kısa ve uzun süreli bellek ekleyerek dönüşler arasında bağlamı hatırlamalarını ve tutarlı, çok adımlı konuşmalar üretmelerini sağlayın. AI Agents with LangChain & Autonomous Workflows ile uygulamalı kodu tarayıcıda doğrudan çalıştırarak pratik yaparsın ve 7/24 yapay zeka koçu dersi çalışırken sorularını yanıtlar.
AI Agents with LangChain & Autonomous Workflows öğrenmeye başlamak için deneyim gerekli mi?
Önceden deneyim gerekmez. CoddyKit'te AI Agents with LangChain & Autonomous Workflows, başlangıçtan ileri seviyeye kadar yapılandırıldığı için buradan başlayabilir veya başından başlayıp kendi hızında ilerleme yapabilirsin. Bu, 4 dersinin 4. dersidir.
“Aracılara Bellek ve Konuşma Durumu Kazandırma” dersi ne kadar sürer?
Çoğu CoddyKit dersi yaklaşık 5–10 dakika sürer. Her biri kısa ve etkileşimli olduğu için sabit ilerleme yaparsın ve web ile uygulama arasında tam olarak bıraktığın yerden devam edebilirsin.
Bu AI Agents with LangChain & Autonomous Workflows dersinde kod yazıp çalıştırabilir miyim?
Evet. Her AI Agents with LangChain & Autonomous Workflows dersi yerleşik bir kod editörü içerir, bu sayede tarayıcıda gerçek kod yazıp çalıştırabilir ve anlık yapay zeka geri bildirimi alırsın — yerel kurulum gerekli değildir.
Bu kursun tüm dersleri
- Yapay Zeka Ajanlarını ve LLM'leri Anlamak
- LangChain Temel Bileşenleri Açıklaması
- İlk Basit Aracınızı Oluşturma
- Aracılara Bellek ve Konuşma Durumu Kazandırma