How I Built A Three-Tier Content Quality Ladder
Scaling programmatic websites is hard. If you rely only on AI to write your content, your site breaks when the API goes down.
I launched three directory sites: Top AI Tools, Find Games Like, and Open Alternative To. I use a three-tier content ladder to ensure they always show information, even without an active AI connection.
The system uses a single column in the database called model_used. It tracks three levels of quality:
- seeded-from-json: Basic data from a file. It is structured but thin.
- fallback-template: A standard template used if the AI fails or the API key is missing. It is technically correct but lacks personality.
- claude-haiku-4-5: The target state. This provides high-quality editorial summaries and nuanced details.
I use a specific SQL query to manage upgrades. The script looks for two things:
- New entries that have no content yet.
- Existing entries that only have low-quality seeded or fallback content.
The script orders these by popularity. It upgrades the most-visited pages first. This ensures your highest traffic pages get the best content immediately.
The process is fully automated and idempotent. I use an upsert pattern. If an upgrade succeeds, the database overwrites the old fallback content with the new AI content. The model_used column updates itself.
I also use Anthropic prompt caching. This saves a lot of money and tokens. Since my system prompts are the same for every entry, the first call primes the cache. The next 99 calls in a batch read from that cache at a lower cost.
Key architectural choices:
- Error handling: If Claude fails, the system does not crash. It simply writes the fallback template and moves to the next item.
- SEO safety: If a page has no useful content at all, I use a noindex tag. This prevents Google from indexing empty pages.
- Static builds: I export the database to JSON files for Astro. This means my site stays online even if the database or AI API has an outage.
This setup allows me to build fast without risking site stability.
