• Athwart
  • Posts
  • Your own personal greek philospher project

Your own personal greek philospher project

It's an AI you can text

I am the type of person who always needs a project to work on. If I'm not doing something productive I feel guilty.

I've been having a great time exploring AI, both ChatGPT for text and MidJourney for images. I think they're really powerful tools that we're just beginning to understand. So I decided to take my desire for productivity and my curiosity for AI and build an AI philosopher you can text.

If you sign up, you'll have your own personal Greek philosopher AI you can text. His name is Socrates and he will happily help you discover the meaning of life.

To see the final project, you can take a look at it below.

Yes, I put it behind a paywall. AI and text messages cost money. But if you're super nice, subscribe to my newsletter and DM me on Twitter. I might give you the secret code to get it for free.

Everything from now on will get more technical.

Tech

I coded it in Python and am using Replit to house and run my code. I use the OpenAI API to generate teh responses that are texted. And then I used Twilio as my text messaging service.

Flow

The flow is pretty simple. You send a text message to a specific number that's in Twilio. Twilio receives the text message and then sends it to the Replit using webhooks. Once Twilio sends the message to replit this triggers my python code which runs the API call to OpenAI.

And then it goes in reverse.

Code:

You can see the python script i wrote here:

Takeaways:

I originally coded this in JavaScript using a Github repository I found. This was a mistake. I suck at Javascript. Python was always the way to go

I learned that even though I haven't dabbled in Python in a few years, I still got it. Don't get me wrong, this was a relatively easy project. But something like this would have taken me days in the past. This time it just took me an evening after work.

I'm going to keep tinkering with it. The next step would be to add an actual database to it instead of using a janky log file to keep track of everything. That way I could actually lower the price on it and make it somewhat affordable.

With the coming ChatGPT API, this will only make something like this cooler. So I'd love to get that integrated when it comes out.

I need to learn how to train the AI. The original intention was to train the AI on Aristotle's Nicomachean Ethics and then have Aristotle as an advisor you could text. However, I could not upload all of Nicomachean Ethics. So instead of a wise Aristotle, the user gets an infuriating Socrates who always asks you questions because that was easier to code.

It was a fun project, and I'm looking forward to iterating on it. This is just version 1