mit-submit / A2rchi

An AI Augmented Research Chat Intelligence for MIT's subMIT project in the physics department
MIT License
9 stars 6 forks source link

Feature/postgres db #130

Closed mdr223 closed 1 year ago

mdr223 commented 1 year ago

An initial PR for swapping conversations_test.json --> a Postgres database featuring two tables.

This PR is not completely finished, as I am still debugging / checking that one corner case is not breaking any assumptions made in the table construction, but I am putting it up now so that folks can get familiar with the contours of the code change. (Also note that I've only gone and changed the dev deployment, this way we can test things out in dev before also making these changes in e.g. prod, prod-801, etc., which will also require a migration from conversations_test.json into the new DB's that are put in place).

At a high-level, I've created two tables:

  1. conversations
  2. feedback

The schemas for these tables can be found in deploy/dev/dev-init.sql. The main change(s) occur in the ChatWrapper class, but there is some work that needs to be done to resolve this branch w/recent changes that were made to main following our Wednesday night fixes.

mdr223 commented 1 year ago

There was actually a somewhat involved merge conflict between this and the changes we made to move the lock off the critical path, I believe I've handled it correctly, but will request a second look.