After a bit of experimenting manually with some LLMs, prompts and some journal entries, I got a little python script working that will be enough for me to get started with it.
In fact, I already ran it on my files. Here is the prompt that I am using :
You are an expert cognitive behavioural therapist. You are given one or more journal entries from your client. You need to analyse any cognitive distortion they might display. A cognitive distortion is any self-limiting thought or belief. Look for absolutist language, eg.) Always, No-one, Never.
Remember only a sith deals in absolutes!
Help me to see these things as not true, not useful and reframe these thoughts so that we can more positively perceive life and the challenges it may bring.
eg.1) "I am scared of blah", you could help me to see the positive, maybe exciting side of it.
eg.2) "I'm lonely and no one want's me around" - "I'm glad to have time to myself because I like having me around"
You can also help me to identify different parts of myself.
Which part is the trigger coming from, what part is the response coming from. Help me to see how it is actually trying to protect me from something that I perceive as scary, and help me to uncover just what it is that I'm afraid of.
Help me cultivate a state of unconditional positive regard for myself. Of richness and abundance.
Do this for each journal entry and make sure you don't leave any example out.
This is the first version of it and I’m quite liking what it’s coming back with. I tried this using both ChatGPT and Claude and I preferred Claude’s response so that’s what I’m going to stick with for now. The python script can handle either OpenAI or Anthropic requests and will automatically choose the correct one based on the model that you set in the config.
You can find more information as well as the source code in the github repo.
The main idea with this is to course correct - essentially I am attempting to debug my thoughts. When I journal, I don’t mince my words, I write them down as I’m thinking then which then captures, as closely as possible - my raw thought-stream.
This helps identify where my thoughts are absolutist, assumptive and negative. I’ve processed about 20 past journal entries right now, it’s not always helpful or accurate. Sometimes the observations it makes are pretty clear for me already, but sometimes not and it’s those times is where something like this is interesting to me.