cd /news/artificial-intelligence/okf-vs-rag-youre-embedding-documents… · home topics artificial-intelligence article
[ARTICLE · art-76672] src=blog.devgenius.io ↗ pub= topic=artificial-intelligence verified=true sentiment=↓ negative

OKF vs RAG: You’re Embedding Documents You Should Be Filtering

A developer argues that vector databases cannot distinguish between current and deprecated document versions, citing a gross margin example where two nearly identical definitions yield cosine similarity around 0.91. The author claims retrieval pipelines lack semantic awareness of correctness, proposing that YAML-based filtering should replace embedding-based retrieval for version-sensitive data in agent stacks.

read1 min views1 publishedJul 28, 2026
OKF vs RAG: You’re Embedding Documents You Should Be Filtering
Image: Blog (auto-discovered)

Member-only story

Your vector database cannot tell a deprecated metric from a current one. A YAML field can. Here’s where retrieval actually belongs in an agent stack, and where it never did. #

Run this experiment before you disagree with me.

Take two metric definitions from your data warehouse docs. The current one: “Gross margin: revenue minus cost of goods sold, where COGS includes shipping and fulfillment as of FY2026.” And the old one your team retired in February: “Gross margin: revenue minus cost of goods sold, excluding shipping and fulfillment.” Embed both with whatever model you’re using — text-embedding-3-small, a local Ollama model, doesn’t matter. Now query: “how do we calculate gross margin?”

Both come back with a cosine similarity somewhere around 0.91. Sometimes the deprecated one ranks first, because it happens to phrase the formula more directly. Your retrieval pipeline has no idea one of these definitions is wrong. It cannot have any idea. Semantic similarity is the only signal it has, and the two definitions are semantically almost identical — that’s precisely why one replaced the other.

── more in #artificial-intelligence 4 stories · sorted by recency
── more on @ollama 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/okf-vs-rag-youre-emb…] indexed:0 read:1min 2026-07-28 ·