How do you maintain historical context in repeat API calls?

Hi @adriaanbalt

Just to correct your statement so we are technically accurate, Redis or Pinecode are not required for the tasks described and can easily be accomplished using most any SQL database.

Redis is useful, and very helpful, but is not a absolute requirement as you mentioned.

It’s probably best to filter out words and chars which have little information content (value) to save a few tokens here and there.

LOL. You should be careful referencing an ChatGPT technical guidance. ChatGPT is a type of text prediction, auto-completion engine AI and not an expert system AI. ChatGPT more-often-than-not will “cobble up something” which is not fully accurate to generate a completion.

Oh, when will they ever learn ? Oh, when will they ever learn ? - Peter, Paul and Mary (1955)

Note:

OpenAI API is just an API which provides access to the OpenAI API endpoints. It’s not a “full blown chat bot application” so to maintain historical context you should use a database to store the prompt and completions. How you implement your database, filter and summarize prompts and completions, and feed historical information back into an API completion call will depend on your use case and requirements.

HTH

1 Like