hoangsonww/AI-RAG-Assistant-Chatbot

Conversation Branching and Side-by-Side Branch Compare

Offen

#37 geöffnet am 17.02.2026

 (0 Kommentare) (0 Reaktionen) (1 zugewiesene Person)TypeScript (14 Forks)auto 404
bugdocumentationenhancementgood first issuehelp wantedquestion

Repository-Metriken

Stars
 (43 Sterne)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

Summary

Allow users to branch from any earlier message in a conversation, continue the branch as a separate thread, and compare outcomes side-by-side.

Problem

Current conversations are linear. If a user wants to explore an alternative prompt/path, they must overwrite context in the same thread or manually create a new conversation, losing traceability.

Proposed Solution

Add first-class branching to conversation history so users can fork from any message and explore alternatives without losing the original path.

Backend

  • Extend conversation/message metadata to support branching:
    • parentConversationId (optional)
    • branchedFromMessageId (optional)
    • branchLabel (optional)
  • Add endpoints:
    • POST /api/conversations/:id/branch (fork from a message)
    • GET /api/conversations/:id/branches (list child branches)
    • GET /api/conversations/:id/compare/:branchId (return normalized compare payload)
  • Preserve immutable source thread messages; branch starts with copied context up to fork point.

Frontend

  • Add “Branch from here” action on user/assistant messages.
  • Add branch switcher in sidebar (tree or grouped list).
  • Add branch compare view:
    • message count, latest response, citation count, last updated
    • optional side-by-side transcript panel

Docs

  • Update openapi.yaml for branch and compare endpoints.
  • Document conversation branching behavior in README.

Acceptance Criteria

  • User can fork from any message in an authenticated conversation.
  • New branch keeps context up to fork point and diverges independently afterward.
  • Original conversation remains unchanged.
  • Branches are discoverable and selectable in UI.
  • Compare endpoint/view shows key differences between base and branch.
  • Tests cover branching logic, auth boundaries, and compare payload correctness.

Out of Scope

  • Real-time multi-user collaborative editing.
  • Merge-back of branch content into base conversation.

Suggested Tasks

  • Add branch metadata to conversation model.
  • Implement branch create/list/compare endpoints.
  • Add UI branch action + branch navigation.
  • Add compare view and summary metrics.
  • Add integration tests + docs updates.

Contributor Guide