Conversation tree branching in `@ably/ai-transport`
Blog post from Ably
@ably/ai-transport` introduces a branching conversation model that allows for non-linear interaction in AI-assisted dialogues, addressing issues like message editing and tool retrying without losing historical context. Unlike traditional linear chats where past interactions can become cluttered or overwritten, this model utilizes a tree structure where each message can create branches, preserved with identifiers like `msgId`, `parentId`, and `forkOf`. This system allows users to compare different iterations of messages side-by-side, facilitating tasks such as customer support, content drafting, and interactive storytelling. The methodology maintains a comprehensive record of conversation paths, enabling seamless navigation and selection of active branches for further interactions. This branching approach, while requiring more storage and presenting some UI complexities, offers significant advantages in maintaining clarity and choice in dynamic conversational environments.