mem0 icon indicating copy to clipboard operation
mem0 copied to clipboard

Error Handling (Empty Database)

Open cachho opened this issue 2 years ago • 3 comments

We have to come up with a way to handle errors.

The most common issue is

retrieve_from_database
    content = result_formatted[0][0].page_content

cachho avatar Jul 04 '23 18:07 cachho

Discord messages:

  • https://discord.com/channels/1121119078191480945/1121119078858358846/1125847354281558036
  • https://discord.com/channels/1121119078191480945/1121119078858358846/1125841669640700065

taranjeet avatar Jul 04 '23 18:07 taranjeet

will add my thoughts on this in sometime.

taranjeet avatar Jul 04 '23 18:07 taranjeet

First of all, I agree that we can't leave it as it is. A index error in a line with two lists is as indescriptive as it's going to get.

I've helped plenty of people with this error.

In 90% of the cases it was a that somehow, the database got wiped and it was just empty. For this we should see if Chroma has a count function and raise a descriptive, custom error as soon as possible.

If people still have problems, we should add different descriptive, custom errors for the different scenarios we encounter.

Blindly escaping should be avoided at all costs! No one likes errors, but they don't go away if you ignore them! That's a general wisdom for life 😄

cachho avatar Jul 04 '23 18:07 cachho

Closing this, because I guess thinking about it again, it should be possible to query an empty database, might be better for dry runs.

cachho avatar Aug 04 '23 10:08 cachho