Context generation for chat based Q&A bot

Each new completion prompt only contains a. the system message, b. the standalone question and c. context documents. No need to resend the entire chat history for each completion. I only send the chat history to get the standalone question.

This is how use of the standalone question was explained to me: Chat Completion Architechture - #2 by AgusPG

This is a more detailed chart of my process:

If you have articles you are retrieving that consume 2K in tokens each, you may want to consider chunking them into smaller pieces. In these semantic searches, you only need to find the relevant content, which will usually be found in a paragraph or two. You can always return the link to the full article in your response.

1 Like