1

I am building a Python telephony phone server on Replit.com using APIs such as Twilio, Vocode, and ChatGPT. When you call the phone number, WhisperAI transcribes your speech, paste it into ChatGPT, then GPT will output an answer and have it be read out lout by ElevenLabs voice synthesizer. The point of this phone agent is to act as a kind of virtual therapist.

Because it uses ChatGPT, it can remember everything you talked about in a single conversation, but I want to use a database to have it remember conversations even beyond hanging up. For example, if you call the number, the database should be able to retrieve the logs of all your previous conversations from a stored phone number so that you would be able to ask questions about a phone call that happened a few days ago.

I've tried setting up a database using from replit import db but I'm not sure how to access the data of the database in the way that I want. I want to store conversations in a database based on the caller's phone number db['phone number1'] = 'log1' and then retrieve it and have chatgpt understand that we're doing an extension of this previous conversation.

Any advice? I've only been coding for about a week, so I'd appreciate any help I can get :)

0 Answers0