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

Enable Advanced Context Management for LLM Conversations #23

Open
DmitryHudrich opened this issue Jan 7, 2025 · 0 comments
Open

Enable Advanced Context Management for LLM Conversations #23

DmitryHudrich opened this issue Jan 7, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@DmitryHudrich
Copy link
Member

DmitryHudrich commented Jan 7, 2025

User Story

  1. As a user,
    I want Asya to store and reference conversation history even when LLM functions are activated,
    so that I can have a seamless and context-aware interaction with the assistant.

  2. As a user,
    I want to export the current conversation context in JSON/XML format,
    so that I can review or edit it outside the application for further customization.

  3. As a user,
    I want to upload an edited context back into the conversation in JSON/XML format,
    so that I can modify the flow or provide additional context for Asya to consider.

  4. As a user,
    I want to clear the existing conversation context,
    so that I can reset the session and reduce token usage for more efficient interactions.


Current Behavior

  • Asya does not provide users with options to export or modify conversation context.
  • Context cannot be reset manually during a session.
  • LLM responses may unnecessarily consume tokens when historical context is large.

Proposed Solution

  1. Conversation History Storage:
    Retain conversation history when LLM is activated, as outlined in the previous request.

  2. Export Context:

    • Provide a "Download Context" feature that exports the current conversation history in JSON or XML format.
    • Include metadata such as message timestamps, sender type (user/assistant), and any additional session details.
  3. Upload Edited Context:

    • Allow users to upload a modified JSON/XML file containing the conversation context.
    • Validate the uploaded file for structure and content integrity.
    • Update the session with the new context, enabling users to shape the assistant's responses.
  4. Clear Context:

    • Add a "Clear Context" button or command to reset the conversation history.
    • Notify users that clearing the context will start a fresh session and reduce token usage.

Use Case Scenarios

  1. Scenario 1: Export Context

    • A user is working on a collaborative project with Asya.
    • They export the current conversation in JSON format to share with a teammate for further analysis.
  2. Scenario 2: Edit and Upload Context

    • A user wants Asya to reference additional information not covered in the initial conversation.
    • They edit the exported context to include new data and upload the file back to Asya.
    • Asya uses the updated context to refine its responses.
  3. Scenario 3: Clear Context

    • During a long session, the user notices that earlier parts of the conversation are no longer relevant.
    • They clear the context to start a new session, optimizing token usage and improving Asya's focus on the current topic.

Implementation Considerations

  1. Export Functionality:

    • Use a REST API endpoint or in-app feature to generate downloadable JSON/XML files.
    • Example structure:
      {
        "session_id": "abc123",
        "messages": [
          { "sender": "user", "timestamp": "2025-01-07T12:00:00Z", "content": "Hello, Asya!" },
          { "sender": "asya", "timestamp": "2025-01-07T12:00:05Z", "content": "Hi! How can I assist you?" }
        ]
      }
  2. Upload Functionality:

    • Create a secure mechanism to upload JSON/XML files via UI or API.
    • Validate the uploaded file to ensure it meets structural requirements.
  3. Clear Context:

    • Implement a session reset function that removes stored context and notifies the user.
  4. UI Enhancements:

    • Add buttons for exporting, uploading, and clearing context in the settings or conversation interface.
    • Provide feedback on actions (e.g., success, error messages).
@artemilin-2023 artemilin-2023 changed the title Asya with activated llm functions won't store conversation history Enable Advanced Context Management for LLM Conversations Jan 7, 2025
@artemilin-2023 artemilin-2023 added the enhancement New feature or request label Jan 7, 2025
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
Development

No branches or pull requests

2 participants