Fact Checking AI Ideas

Building in Public: How I Added a Fact-Check Layer to My AI Content Pipeline

Keeping It Factual

Now that I had the ideas ready to go, I needed to put some verification around these ideas. I want to post things that are factual. That is not to say I would allow any opinion in my posts, just that I didn’t want anything stated as a fact, or an opinion based upon a similar statement, to be factually inaccurate.

As we have learned, AI hallucinations are real; they occur when AI models confidently generate information that sounds plausible but is inaccurate or fabricated. So I needed a way to prevent this. In this case, I started with my own online sleuthing- well, sleuthing using stone-age tools, you know, like Google search.

Initially, my thought was to use a limited number of sources, as I did with the initial idea creation. But the initial idea sources were by design diverse, and they could create straight teaching articles or articles designed to make you think; I could not find a set of resources that could consistently cover this whole gamut of possibilities.

What Are AI Search APIs?

Fortunately, I found a whole slew of tools, called AI search APIs or RAG (Retrieval-Augmented Generation) search APIs. These are search engines specifically designed for LLMs. It’s the technique of pulling in real, external information (retrieval) and feeding it into an LLM before it generates a response, so the model grounds its answer in actual sources rather than just its training data. This helps reduce hallucinations so that facts are facts or at least based on current knowledge.

Why I Chose Tavily

Now that I knew of these tools, I searched for my options. The top of the list was Exa.ai, Brave Search API, Firecrawl, Perplexity Sonar API, and Tavily. Now, I am a Lewis Hamilton fan, so I wanted to use Perplexity, but after reviewing factors like costs, reviews, and its integration with n8n, I decided to use Tavily. While not the cheapest, at this point I can still qualify for the free plan, it connects easily with n8n, and it is well reviewed. Tavily Review: Faster Search For RAG And AI Agents

How Workflow 2 Works

Now on to the building. The nice thing about the multiple flows I am building, they get easier and easier to build as I go. Plus, with workflow 1, I had to learn several new tools that I now know at least somewhat well.

At the end of workflow 1, I had all of my approved ideas set to “approved” in the “status” field. Witty, I know. So this workflow goes and grabs all the topics that are approved, searches those topics on Tavily, then connects with the AI model, and, using the data from Tavily, generates an email that highlights where the ideas have factual backing, highlights what opinions are, and where things are factually incorrect so I can then, again, approve or disapprove of the topic moving forward.

One Email at a Time, On My Own Schedule

I have the idea generation workflow running every week. This workflow I could have set to run based off workflow 1, or run once a week as well. But instead, I have this workflow, and the same for workflow 3 and 4, to run every 3 hours. The reasoning was that I might not have time to approve every email at once. Workflow 1 generates multiple ideas, then sends me an email, and waits for a response. Only once it gets a response does it send the next one. I did this on purpose. The draft model of this workflow sent me one email containing all the ideas. But human nature is human nature, and I found myself skimming the topics. Then I built the model so it sent me individual emails, but all at once. This made me feel rushed and cluttered up my inbox.

So sending one email and then waiting meant I took my time, didn’t feel rushed, and my inbox wasn’t cluttered. I also created a filter for my emails that now moves all the associated emails to their own folder. So now I can read the topic ideas as I have time, review, research, ponder, etc. at will, then click approve or deny, and move on. Then another email gets sent to me, and when I have time I can do the same.

These are just some of the things I am thinking about, besides the tools themselves, that I would not have had I not decided to build an agent myself.

What’s Next

The next workflow will capture the fact-checked ideas and turn them into posts, which was also a learning experience, as I learned I need to build both a system message and a user message, each designed to do different things, which is different from what most of us do as we are using the standard chat interface. But that is for the next post.

Leave a Reply