# Store से दीर्घकालिक स्मृति — LangGraph Agents और Multi-Agent Systems

Source: https://www.geekswithgeeks.com/hi/langgraph-agents/m-longterm

> Threads के पार तथ्य रखें, जैसे user की पसंद।

## एक बातचीत से परे

Thread state एक बातचीत तक सीमित **अल्पकालिक** स्मृति है। जिन तथ्यों को बातचीतों के पार टिकना चाहिए (user का नाम, भाषा, पसंद, पिछले निर्णय) उनके लिए LangGraph **store** देता है: **namespaces** (जैसे `("users", user_id)`) से व्यवस्थित key-value जैसी स्मृति, जो nodes से उपयोग होती है और वैकल्पिक रूप से semantic खोज योग्य है। तय करें क्या याद रखना है (user के स्पष्ट कथन, पुष्ट तथ्य), उसे सोच-समझकर लिखें, users को उसे **देखने, सुधारने और हटाने** दें, और स्पष्ट उद्देश्य व सहमति के बिना संवेदनशील डेटा बाहर रखें। सब कुछ prompt में डालने की जगह वर्तमान कार्य से प्रासंगिक कुछ स्मृतियाँ ही retrieve करें।

## अल्पकालिक बनाम दीर्घकालिक स्मृति

डिज़ाइन निर्णयों के लिए तुलना।

```text
Short-term (thread state)                Long-term (store)
scope: one conversation (thread_id)      scope: across conversations (namespace, e.g. ("users", id))
content: messages, intermediate values   content: preferences, facts, summaries
saved by: checkpointer after each step   saved by: your nodes, on purpose
lifetime: as long as the thread is kept  lifetime: until deleted; user can view/edit/delete
risk: long threads inflate cost          risk: remembering wrong or sensitive things
```

**Quiz:** दीर्घकालिक स्मृति में क्या आता है?

- [ ] Node का स्थानीय चर
- [ ] एक चरण का बीच का tool परिणाम
- [x] बातचीतों के पार user की पसंदीदा भाषा
- [ ] Recursion counter

*Answer:* बातचीतों के पार user की पसंदीदा भाषा. बातचीतों के पार के तथ्य store में रहते हैं; प्रति-run ब्योरे thread state में।
