How I created my personal tweet writer AI
Last week, I offloaded tweet generation to an LLM - all for FREE, at no expense to me.
TL;DR;
I used Ollama/mistral & Notion to automate tweet creation based on the long-form posts I write.
Here’s the full story:
I wanted to follow advice in Content OS by Justin Welsh to build a bit of social brand for myself. This meant writing consistently on Twitter and LinkedIn. I enjoy learning in public. It is the best way to be part of community, get valuable feedback and also have some sense of accountability in the early days when you don’t have investors or customers.
I love writing, as you can see index, but I find converting this to engaging content a little draining.
Thinking of beating writer's block with a twist: How about I let AI draft my tweets, then sprinkle in my own flavor? 🤖✍️
It took me under a day to have it fully working for my needs. Blown away by the barrier to entry in new tech like LocalLLMs for software engineers.
So, what are the ingredients I need for AI to do a useful job for me?
- My work in terms of raw material to tweet about aka New Posts and TIL content
- The tone and style of tweets to copy
- Guidance on how to approach tweet writing given the above two
I spent a day building my first version of code.
Here are the implementation details:
My new tweet generation workflow automation#Logic workflow TIL talked about the workflow and my thoughts while building it. I used 3 main ingredients. Ollama, Prompt and Notion db.
1. Ollama and mistral for $0 AI solution
I need an LLM to respond to my requests. I ran a local server using Ollama.
Because the ROI is not clear to me, I didn’t want to invest real cash in AI yet. There are already many tools doing Twitter AI stuff [ TweetAI, TweetHunter AI, Buffer, Hyperfury ]
Getting started with using Ollama is super simple, and not much code. I used Llama Index.
2. Fantastic Prompt: Ghostwriter Prompt (Using Chain of Density Approach)
To make the tweet sound like my style or similar to Twitter templates I like, I wanted to use a prompt that can force AI to emulate a specific writing style.
The best prompt I know of was shared by @mattshumer_ on X. It’s 4 months old, and I, wonder if new approaches have been developed. For V1, this was a pretty good start.
3. Notion Database as a Human in the Loop review app
With my experience in building apps with AI, I have realized the criticality of human analysis of AI content before taking any real action is critical. Ben Tossell's notes on Future of Work by MS also talks about ~20% fake new/inaccurate data generated by use of AI-based on Microsoft’s report.
My solution to this is manually reviewing and editing the tweets and marking them for publishing!
I am using notion database. It allows me to edit the text in line and flag posts that are gibberish to archive them.
It was a really fun exercise that helped me automate a task that drains energy. It also helped me learn/play with new technologies. win-win.
Next Steps:
- Build output assurance mechanism
- Improve prompts to get better quality output. Look into Prompt Databases like these to find some good prompt improvement tricks.
- Experiment with different models to get better quality
- Convert code to
async
to make it run faster - Automate tweet review to publish and schedule
- Add LinkedIn to the mix
- Post the idea in Indie Hackers, Reddit to find others interested in using it or features people would love to use.
@gregisenberg Talked about how to build trust with content. He shows that text content is high vol and low trust. This automation helps me move on to the next step in the ladder of trust.
I almost have a personal ghostwriter for myself at this point :) If you have read so far, I would love to know if you are using something similar or have built tools like these yourself. Feel free to DM me on X.