kyma-project / kyma-companion

A tool that brings AI to Kyma
Apache License 2.0
3 stars 12 forks source link

Investigate and Propose Unification of Conversation History Management #203

Closed Teneroy closed 1 month ago

Teneroy commented 1 month ago

Goal

The objective of this spike is to research and propose a solution to unify the conversation history management system used in our Kyma Companion project. Currently, we are using both Redis LangGraph Checkpointers and Redis LangChain History. The goal is to evaluate and propose the use of Redis LangGraph Checkpointers for handling all conversation history, removing the use of Redis LangChain History entirely. The proposed solution should consider various aspects like token usage, performance, and functionality across different scenarios and endpoints.

Timebox

5 working days

Tasks

  1. Current System Analysis:

    • Analyze how conversation history is currently being managed across all three main endpoints.
    • Understand the differences between Redis LangGraph Checkpointers and Redis LangChain History in terms of performance, functionality, and token usage.
  2. Impact on Endpoints:

    • Investigate the potential impact of switching entirely to Redis LangGraph Checkpointers across all three endpoints.
    • Ensure the system continues to function properly when users switch between tabs or different views.
    • Identify any edge cases where conversation history may not be handled correctly with Redis LangGraph Checkpointers (e.g., restoring states or managing long-term sessions).
  3. Performance and Token Usage Evaluation:

    • Propose a strategy which maintains a balance between efficient performance and reasonable token usage
  4. Solution Proposal:

    • Propose a solution to unify the conversation history using Redis LangGraph Checkpointers as the sole history management system.
    • Ensure the solution is scalable and able to handle the switching of tabs
    • Consider how this change will impact state management and checkpointing within the agents.
  5. Team Discussion & Agreement:

    • Present the proposed solution to the team.
    • Discuss and iterate on the proposal based on feedback from the team, ensuring that it aligns with both technical and business goals.
  6. Architecture Update:

    • Once the solution is agreed upon, update the architecture diagram to reflect the changes in conversation history management.
  7. Update the codebase with the solution

    • Ensure that all relevant modules are updated to remove the old Redis LangChain History management and replace it with Redis LangGraph Checkpointers.

Deliverables

Success Criteria

mfaizanse commented 1 month ago

POC PR:

Todo(s):