For a while, the code behind my blog's Similar Posts component lived inside my site. It started as a way to recommend related articles, then grew to include a relevance threshold and a SQLite cache. Those earlier posts documented how I built it:
Adding AI-powered similar posts to an Astro blog
Refining the recommendations with similarity scores
Caching OpenAI embeddings with SQLite
After using that implementation on my own site, I wanted to make the same capability easier to add to another Astro project. That meant turning site-specific utilities into an integration that other sites could configure and call.
One thing which helped me decide to do this was feedback on Bluesky :
Also, I have been open-sourcing other parts of my site's source code, and this seemed like a useful next project. Hopefully, others can find it useful for quickly adding similar post recommendations to their Astro sites.
From a Site Feature to an Astro Integration
The first version of Similar Posts was deliberately small.…