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

Add dates to conversations #1295

Merged
merged 3 commits into from
Dec 14, 2024
Merged

Add dates to conversations #1295

merged 3 commits into from
Dec 14, 2024

Conversation

Josh-XT
Copy link
Owner

@Josh-XT Josh-XT commented Dec 14, 2024

This pull request includes significant improvements to the agixt package, focusing on optimizing database queries, adding timestamp columns, and ensuring safe migrations. The most important changes include optimizing the retrieval of conversations, updating timestamps on interactions, and adding a migration script for SQLite databases.

Optimizations and new features:

  • agixt/Conversations.py: Optimized the get_conversations and get_conversations_with_ids methods to use a single query with a join to retrieve only conversations with messages, and ordered the results by the updated_at timestamp.
  • agixt/Conversations.py: Updated the log_interaction method to update the updated_at timestamp for conversations whenever an interaction is logged. [1] [2]

Database schema changes:

  • agixt/DB.py: Added created_at and updated_at timestamp columns to the Conversation class.

Migration script:

  • agixt/DB.py: Added a run_safe_migration function to safely add the new timestamp columns to the conversation table in SQLite databases, ensuring existing rows are updated with current timestamps.

@Josh-XT Josh-XT marked this pull request as ready for review December 14, 2024 16:45
@Josh-XT Josh-XT merged commit 4b54573 into main Dec 14, 2024
7 checks passed
@Josh-XT Josh-XT deleted the add-dates-to-conversations branch December 14, 2024 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant