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

Use session_id to maintain ongoing chat in RAG playground example #1869

Closed
MichaelClifford opened this issue Apr 3, 2025 · 0 comments · Fixed by #1870
Closed

Use session_id to maintain ongoing chat in RAG playground example #1869

MichaelClifford opened this issue Apr 3, 2025 · 0 comments · Fixed by #1870
Assignees
Labels
enhancement New feature or request

Comments

@MichaelClifford
Copy link
Contributor

🚀 Describe the new functionality needed

When using the RAG playground example the chatbot should maintain a conversation history so that users can ask follow up questions.

This should be achievable by including the agent's session_id in the session_state and using stremlit's cache_resource feature to prevent the agent from re-initializing constantly.

💡 Why is this needed? What if we don't build it?

This functionality is needed as it is a common feature in many existing chatbot applications. Also, it will allow for an improved user experience.

Other thoughts

No response

@MichaelClifford MichaelClifford added the enhancement New feature or request label Apr 3, 2025
leseb pushed a commit that referenced this issue Apr 8, 2025
…ation (#1870)

# What does this PR do?

This PR updates the [playground RAG
example](llama_stack/distribution/ui/page/playground/rag.py) so that the
agent is able to use its builtin conversation history. Here we are using
streamlit's `cache_resource` functionality to prevent the agent from
re-initializing after every interaction as well as storing its
session_id in the `session_state`. This allows the agent in the RAG
example to behave more closely to how it works using the python-client
directly.

[//]: # (If resolving an issue, uncomment and update the line below)
Closes #1869 

## Test Plan

Without these changes, if you ask it "What is 2 + 2"? followed by the
question "What did I just ask?" It will provide an obviously incorrect
answer.

With these changes, you can ask the same series of questions and it will
provide the correct answer.

[//]: # (## Documentation)

Signed-off-by: Michael Clifford <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
1 participant