Skip to main contentü¶úÔ∏èüîó LangChainDocsUse casesIntegrationsAPICommunityChat our docsLangSmithJS/TS DocsSearchCTRLKGet startedIntroductionInstallationQuickstartLangChain Expression LanguageInterfaceHow toCookbookLangChain Expression Language (LCEL)Why use LCEL?ModulesModel I/‚ÄãORetrievalChainsMemoryChat MessagesMemory typesConversation BufferConversation Buffer WindowEntityConversation Knowledge GraphConversation SummaryConversation Summary BufferConversation Token BufferBacked by a Vector StoreMemory in LLMChainMemory in the Multi-Input ChainMemory in AgentMessage Memory in Agent backed by a databaseCustomizing Conversational MemoryCustom MemoryMultiple Memory classesAgentsCallbacksModulesSecurityGuidesMoreModulesMemoryMemory typesEntityOn this pageEntityEntity memory remembers given facts about specific entities in a conversation. It extracts information on entities (using an LLM) and builds up its knowledge about that entity over time (also using an LLM).Let's first walk through using this functionality.from langchain.llms import OpenAIfrom langchain.memory import ConversationEntityMemoryllm = OpenAI(temperature=0)memory = ConversationEntityMemory(llm=llm)_input = {"input": "Deven & Sam are working on a hackathon project"}memory.load_memory_variables(_input)memory.save_context(    _input,    {"output": " That sounds like a great project! What kind of project are they working on?"})memory.load_memory_variables({"input": 'who is Sam'})    {'history': 'Human: Deven & Sam are working on a hackathon project\nAI:  That sounds like a great project! What kind of project are they working on?',     'entities': {'Sam': 'Sam is working on a hackathon project with Deven.'}}memory = ConversationEntityMemory(llm=llm, return_messages=True)_input = {"input": "Deven & Sam are working on a hackathon project"}memory.load_memory_variables(_input)memory.save_context(    _input,    {"output": " That sounds like a great project! What kind of project are they working
Entity memory remembers given facts about specific entities in a conversation. It extracts information on entities (using an LLM) and builds up its knowledge about that entity over time (also using an LLM).
Entity memory remembers given facts about specific entities in a conversation. It extracts information on entities (using an LLM) and builds up its knowledge about that entity over time (also using an LLM). ->: Skip to main contentü¶úÔ∏èüîó LangChainDocsUse casesIntegrationsAPICommunityChat our docsLangSmithJS/TS DocsSearchCTRLKGet startedIntroductionInstallationQuickstartLangChain Expression LanguageInterfaceHow toCookbookLangChain Expression Language (LCEL)Why use LCEL?ModulesModel I/‚ÄãORetrievalChainsMemoryChat MessagesMemory typesConversation BufferConversation Buffer WindowEntityConversation Knowledge GraphConversation SummaryConversation Summary BufferConversation Token BufferBacked by a Vector StoreMemory in LLMChainMemory in the Multi-Input ChainMemory in AgentMessage Memory in Agent backed by a databaseCustomizing Conversational MemoryCustom MemoryMultiple Memory classesAgentsCallbacksModulesSecurityGuidesMoreModulesMemoryMemory typesEntityOn this pageEntityEntity memory remembers given facts about specific entities in a conversation. It extracts information on entities (using an LLM) and builds up its knowledge about that entity over time (also using an LLM).Let's first walk through using this functionality.from langchain.llms import OpenAIfrom langchain.memory import ConversationEntityMemoryllm = OpenAI(temperature=0)memory = ConversationEntityMemory(llm=llm)_input = {"input": "Deven & Sam are working on a hackathon project"}memory.load_memory_variables(_input)memory.save_context(    _input,    {"output": " That sounds like a great project! What kind of project are they working on?"})memory.load_memory_variables({"input": 'who is Sam'})    {'history': 'Human: Deven & Sam are working on a hackathon project\nAI:  That sounds like a great project! What kind of project are they working on?',     'entities': {'Sam': 'Sam is working on a hackathon project with Deven.'}}memory = ConversationEntityMemory(llm=llm, return_messages=True)_input = {"input": "Deven & Sam are working on a hackathon project"}memory.load_memory_variables(_input)memory.save_context(    _input,    {"output": " That sounds like a great project! What kind of project are they working