Everything is not "AI", some are just Algorithms. Here's the difference
Learn the difference between AI models and algorithms, with simple examples and practical insights to avoid common mix-ups.
In this era, everyone likes to slap “AI” on anything they’re building, even when it’s just an algorithm. Maybe I should not have added ‘just’ because algorithms are a big deal too, but you get my point.
AIs and Algorithms are both useful, but to avoid confusing them, let me explain the difference between them in human language.
An algorithm is like a recipe → a defined instruction that doesn’t really change.
Example: A pancake recipe that says “Mix flour, sugar, milk, eggs… fry for 2 minutes each side.”
Every time you follow it, you’ll make the same pancakes (deterministic).
It’s fixed. It doesn’t learn or guess; it just follows the steps exactly.
An AI model is more like a chef who learned to make pancakes by trying different things over time.
Maybe at first they burned them, added too much sugar, or made them too dry.
But after tasting and adjusting hundreds of times, they got really good at making pancakes.
They can even adapt the recipe for blueberry pancakes or gluten-free ones.
In one line: If it learns from data, it’s an AI model. If it only follows fixed steps, it’s an algorithm.
Also true: A model is usually built using algorithms, but once trained, it’s more like a memory of what it learned, not just a rigid list of rules, and it can continually learn more.
A Quick Real-World Example
Problem
Suppose I had like 50,000 different AI tools in a sheet with just their names. And I need their official website URLs.
I’d first use the Google search API to search for the name and get the first few search results. Now, I need to figure out the official website URL from those results.
Solution A → Algorithm
I could write a simple code that will:
Take a tool name with the list of search result URLs from the Google search API.
Clean the tool name to create a brand token.
For each URL:
Add +2 if the hostname contains the brand token.
Add +3 if the root domain starts with the brand token.
Add +1 if TLD is
.ai
,.com
, or.io
.Subtract 3 if it’s a known directory or social site.
Select the URL with the highest score.
Return it as the official site, or “no website” if no match is found.
Example Code:
/**
* Finds the most likely "official" website for a given tool name
* from an array of search results, using a scoring system
* to avoid common false positives (directories, socials).
*
* INPUT:
* tool: string (tool name, e.g., "Redesignr.ai")
* results: array of strings (URLs) or objects with { href }
*
* OUTPUT:
* { officialUrl: string, score: number }
*/
function scoredOfficialUrl(tool, results) {
// Clean tool name
const t = (tool ?? '').toString().trim();
const arr = Array.isArray(results) ? results : [];
if (!t || arr.length === 0) return { officialUrl: 'no website', score: 0 };
// --- Helpers ---
const pickHref = (x) => (typeof x === 'string' ? x : (x && x.href) || '');
const safeUrl = (u) => {
try {
if (!/^https?:\/\//i.test(u)) u = 'https://' + u; // add scheme if missing
return new URL(u);
} catch {
return null;
}
};
// Root domain (last two labels)
const root = (h) => {
const parts = h.split('.');
return parts.slice(-2).join('.');
};
// Normalize tool to brand string
const brand = (t.toLowerCase().match(/[a-z0-9]+/g) || []).join('');
if (!brand) return { officialUrl: 'no website', score: 0 };
// Bad and good host references
const badHosts = new Set([
'producthunt.com',
'g2.com',
'twitter.com',
'x.com',
'linkedin.com',
'facebook.com',
'youtube.com'
]);
const goodTlds = new Set(['ai', 'com', 'io', 'co', 'dev', 'app']);
// Track best candidate
let best = { url: 'no website', score: -1 };
for (const r of arr) {
const raw = pickHref(r);
const u = safeUrl(raw);
if (!u) continue;
const h = u.hostname.toLowerCase();
const rroot = root(h);
const rtld = h.split('.').pop();
const clean = h.replace(/[.\-]/g, ''); // normalize for substring check
let s = 0;
if (clean.includes(brand)) s += 2;
if (rroot.startsWith(brand)) s += 3;
if (goodTlds.has(rtld)) s += 1;
if (badHosts.has(rroot)) s -= 3;
if (s > best.score) best = { url: u.href, score: s };
}
// Threshold: reject weak matches
if (best.score < 2) return { officialUrl: 'no website', score: best.score };
return { officialUrl: best.url, score: best.score };
}
Advantages
Fast & cheap → it can run locally, no API cost.
Deterministic → same input always gives the same result.
Transparent → easy to see and tweak why a URL scored high.
Low infra needs → works with tools like N8n without special hardware or hosting.
Disadvantages
Rigid → only works for patterns you explicitly
knowcode.Brittle on edge cases → generic names or unusual brand sites can break it.
No context awareness → can’t read page content or infer intent from snippets.
Hard to scale rules → adding exceptions/conditions quickly gets messy.
Solution B → AI Model
Or I can pass a prompt to any large language model.
Example Prompt:
You are a strict judge that must pick the official website of a software tool.
Tool name: "{{tool_name}}"
Here are search results (each has title, snippet, url). Choose ONE url that is most likely the official website.
Prefer:
- Root domains that start with the brand (e.g., brand.com, brand.ai),
- Pages with product language (“pricing”, “features”, “download”).
Avoid:
- Directories/marketplaces/social (producthunt.com, g2.com, x.com, linkedin.com, facebook.com, youtube.com).
If none looks official, return "none".
Return ONLY this JSON:
{
"selected_url": "<one url or 'none'>",
"confidence": <0.0 to 1.0>,
"reason": "<short why>"
}
Advantages
Context-aware → can use page titles/snippets to detect official language.
Fewer false positives (in this case) → better at ignoring directories/social media if told in a prompt.
Easier to extend → just change the prompt, no new code logic.
Can explain choices → returns reason + confidence for human review.
Disadvantages
Cost → each run hits an API, which can get expensive at scale.
Slower → extra network and model processing time.
Non-deterministic → may give slightly different answers for the same input.
Requires validation → must enforce JSON schema or parsing to avoid bad output.
Which is Which?
Does it use any form of artificial reasoning? → AI Model.
Is it only following the rules you wrote? → Algorithm.
Final words
Technically, they both work, depending on what you need to achieve.
And one can be better than the other in different cases.
“When to use which” is not the point of this article.
The point of this article is for you to be able to tell which is which.
So… from now on, don’t call an algorithm AI-powered. Be careful.