Hi all,
I’m currently using the OpenAI API with the latest SDK and GPT-4.1. Here’s a simplified version of my code:
new_prompt = ‘…xyz’
from openai import OpenAI
client = OpenAI(api_key = your_api_key)
response = client.responses.create(
model=“gpt-4.1”,
tools=[{“type”: “web_search_preview”}],
input= new_prompt)
According to the docs, API calls should be stateless — i.e., the model should not retain memory of previous prompts unless I explicitly include them in the messages
list. However, I’m observing behavior that suggests the model is remembering previous interactions, even when I send an entirely new prompt.
I’ve verified that:
- I’m not reusing the
messages
list. - I’m not using any wrapper like LangChain or memory-enabled classes.
Is there any caching, tool memory, or known behavior in GPT-4.1 (especially when using tools like web_search_preview) that might explain this? Has anyone else encountered something similar?