Skip to content

session import feature for in-memory sessions #3050

@akshaypachpute-1998

Description

@akshaypachpute-1998

** Please make sure you read the contribution guide and file the issues in the right place. **
Contribution guide.

Is your feature request related to a problem? Please describe.
When developing or debugging complex, multi-turn conversational Actions, I often need to test an intent that only becomes active after a specific conversational state has been reached. To do this with the current testing utilities, I have to write setup code that programmatically simulates every user turn leading up to that state.

For example, to test a "confirm order" intent, my test must first simulate launching the Action, adding items to a cart, and providing user information. This process is repetitive, time-consuming, and makes the test setup unnecessarily complex, which slows down the development and debugging cycle. I'm always frustrated when I have to write extensive boilerplate code just to get the session into the correct state for a single test case.

Describe the solution you'd like
I would like the ability to import already exported session json file into newly initialized in_memory session. When the tools are any underlying code is updated the session is lost and user have to do all the multi-turn chat with agent again. This feature will reduce the development time for the users so that they can start the session from where they left off.

Describe alternatives you've considered
The only alternative I've considered is the current method: writing a series of calls within the test setup function to simulate the entire user journey. This works, but it is inefficient and makes tests more brittle and harder to maintain.

One could also try to monkey-patch the internal attributes of the in_memory_session object after it's created, but this is not a stable solution as it relies on internal implementation details that could change in future versions of the library.

Additional context
This feature would dramatically improve developer productivity by simplifying the process of writing tests for specific conversational states. It allows for a "state-based" approach to testing rather than a "journey-based" one, which is much faster for isolating and debugging issues that occur deep inside a conversation flow. This is a common pattern in other testing frameworks, where hydrating state from a known checkpoint is a standard feature.

Metadata

Metadata

Assignees

Labels

services[Component] This issue is related to runtime services, e.g. sessions, memory, artifacts, etc

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions