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

fix: Remove document truncation and replace DB inserts with upserts #973

Merged
merged 10 commits into from
Feb 9, 2024

Conversation

sarahwooders
Copy link
Collaborator

@sarahwooders sarahwooders commented Feb 8, 2024

Repeatedly running memgpt load... or /attach would result in PostgreSQL errors and/or duplicated data. The Passage.id field has been updated to be a hash of the text, and if there already exists that ID insert and insert_many will do an upsert unless otherwise specified.

Relevant issues: #949

Note that the current implementation of insert_many is very hacky as it uses a different insert method for Passage objects versus everything else -- eventually we should try to clean this up, perhaps by moving to pydantic/sqlmodel.

@cpacker cpacker changed the title Remove document truncation fix: Remove document truncation Feb 8, 2024
@sarahwooders sarahwooders changed the title fix: Remove document truncation fix: Remove document truncation and replace DB inserts with upserts Feb 8, 2024
@sarahwooders sarahwooders marked this pull request as draft February 8, 2024 22:57
@sarahwooders sarahwooders marked this pull request as ready for review February 8, 2024 23:09
@sarahwooders sarahwooders marked this pull request as draft February 9, 2024 04:00
@cpacker cpacker self-requested a review February 9, 2024 04:03
@sarahwooders sarahwooders marked this pull request as ready for review February 9, 2024 04:22
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.

2 participants