When retrieving additional context for the latest user query, the query string (used for KNN against the pinecone embeddings) includes the system prompt (as well as some of the users previous queries).
Whilst the users previous user queries might be useful (although we already have context for these in theory), the system prompt (AI instructions + initial context) doesn't seem relevant or useful here (querying for additional context) and seems likely to cause the additional context to not be a great match for the latest user query.
Looks like a bug to me, but perhaps I am missing something?
https://github.com/mtenenholtz/chat-twitter/blob/f889b688aa35d38a9823e0dde5c0cff94a6ae1fc/backend/main.py#LL168C17-L168C31
When retrieving additional context for the latest user query, the query string (used for KNN against the pinecone embeddings) includes the system prompt (as well as some of the users previous queries).
Whilst the users previous user queries might be useful (although we already have context for these in theory), the system prompt (AI instructions + initial context) doesn't seem relevant or useful here (querying for additional context) and seems likely to cause the additional context to not be a great match for the latest user query.
Looks like a bug to me, but perhaps I am missing something?
https://github.com/mtenenholtz/chat-twitter/blob/f889b688aa35d38a9823e0dde5c0cff94a6ae1fc/backend/main.py#LL168C17-L168C31