I want GPT to remember our certain number of chats

I don’t think it works like that, run the tools manualy, without the agent to search for the cheapest, and used a predefined search parameters, the response comes back with 55 pages of flight offers, even though i used the cheapest.
the api end point, doesn’t really return the cheapest, but instead , it return all the available flights then search for the cheapest.
Thats why i was thinking of creating a function inside the tool to return the response and store it in a vector store backed retriever https://python.langchain.com/docs/modules/data_connection/retrievers/vectorstore , then use the VectorStoreRetrieverMemory from langchain . https://python.langchain.com/docs/modules/memory/types/vectorstore_retriever_memory
The idea is to make the openai agent function calling uses the tool >>> the tool will store the resonse in the vector database >>>> the memory for the agent will be the database that retrun the top k results >>>> then the llm will pass it to the user as natural language.
not sure if im missing something or the idea could be done.