Does ConversationBufferMemory actually save conversation twice?
Labels: name: area: memory, name: auto:bug

### System Info

When I set `verbose=True` when creating chains using ConversationBufferMemory as memory and **redirect** the output to a txt/log file, the return messages shows that the ConversationBufferMemory saves same round conversation twice. You can get the example in later part of this issue.

**This problem will not happen if I just print the return messages in terminal instead of redirecting them into files.**

Does ConversationBufferMemory actually save conversation twice? If so, this will waste half of the input tokens to LLMs. How can I set some variables to make it only save once with any round of conversation?

### Who can help?

@agola11 

### Information

- [ ] The official example notebooks/scripts
- [X] My own modified scripts

### Related Components

- [X] LLMs/Chat Models
- [ ] Embedding Models
- [ ] Prompts / Prompt Templates / Prompt Selectors
- [ ] Output Parsers
- [ ] Document Loaders
- [ ] Vector Stores / Retrievers
- [X] Memory
- [ ] Agents / Agent Executors
- [ ] Tools / Toolkits
- [X] Chains
- [ ] Callbacks/Tracing
- [ ] Async

### Reproduction

```python
from langchain.chains import ConversationChain
from langchain.memory import ConversationBufferMemory
from langchain.chat_models import ChatOpenAI

llm = ChatOpenAI(model_name = 'gpt-4-1106-preview', temperature = 0.0)
def_memory = ConversationBufferMemory(memory_key="history", return_messages=True)
def_chain = ConversationChain(
            llm = llm,
            memory = def_memory,
            verbose = True)

def_queries = ['When answering questions below, you should play a role as a vehicle system engineer. Your job is to read the VDR (Vehicle Digital Requirement) form and evaluate the quality of the VDR completion. Make your answer as brief as you can. If you understand what I said, reply only [UNDERSTAND].',
               'You can see duplication in memory of this query.']
for def_q in def_queries:
    ret = def_chain.run(def_q)
    def_memory.save_context({"input": def_q}, {"output": ret})

# pls redirect the output into some .txt or .log file
``` 

### Expected behavior

### Below is my redirected gh.log file, I bold the duplicate part

[1m> Entering new ConversationChain chain...[0m
Prompt after formatting:
[32;1m[1;3mThe following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know.

Current conversation:
[]
Human: When answering questions below, you should play a role as a vehicle system engineer. Your job is to read the VDR (Vehicle Digital Requirement) form and evaluate the quality of the VDR completion. Make your answer as brief as you can. If you understand what I said, reply only [UNDERSTAND].
AI:[0m

[1m> Finished chain.[0m


[1m> Entering new ConversationChain chain...[0m
Prompt after formatting:
[32;1m[1;3mThe following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know.

Current conversation:
**[HumanMessage(content='When answering questions below, you should play a role as a vehicle system engineer. Your job is to read the VDR (Vehicle Digital Requirement) form and evaluate the quality of the VDR completion. Make your answer as brief as you can. If you understand what I said, reply only [UNDERSTAND].'), AIMessage(content='[UNDERSTOOD]'), HumanMessage(content='When answering questions below, you should play a role as a vehicle system engineer. Your job is to read the VDR (Vehicle Digital Requirement) form and evaluate the quality of the VDR completion. Make your answer as brief as you can. If you understand what I said, reply only [UNDERSTAND].'), AIMessage(content='[UNDERSTOOD]')]**
Human: You can see duplication in memory of this query.
AI:[0m

[1m> Finished chain.[0m