Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(chat): Fix LLM RAG workflow issue to use RAG for nuanced or rephrased queries. #339

Open
oindrila-b opened this issue Feb 27, 2025 · 0 comments
Assignees

Comments

@oindrila-b
Copy link
Contributor

Currently, the RAG workflow in our app has an issue where, if a user asks a question about a specific topic and then rephrases the question, the app relies solely on conversation history rather than using RAG to provide a more accurate response. As a result, the app can get "stuck in a loop," repeatedly pulling answers from previous messages without re-engaging RAG — even when the question's wording changes. This pattern continues until a query about an entirely different topic is introduced.

The logs reflect this behavior with the following message:
We were able to find the answer/respond to user's query in the conversation itself so not applying RAG.

To address this, we want to adjust the logic as follows:

Use conversation history for simple or contextual queries: The app should continue using the conversation history for straightforward interactions, such as greetings (e.g., "Hi") or basic fact-checking where the answer is already in context.

Use RAG for rephrased queries: When users ask slightly more complex questions — especially when they revisit a topic with different wording — the app should prioritise RAG over relying solely on past messages. This ensures we deliver the most relevant and accurate information without getting stuck in a conversational loop.

While this is an immediate fix, we plan to implement a more refined approach in the future to better balance the use of conversation history and RAG.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant