---
title: "Comment by Ahmet Özel on \"Building a Production RAG Pipeline: Document Processing, Chunking, and Metadata Design\" | Hashnode"
description: "The hard-versus-soft metadata distinction is especially important, but I would keep tenant, permission, and superseded-document gates outside any model-derived"
url: "https://hashnode.com/posts/building-a-production-rag-pipeline-document-processing-chunking-and-metadata-design/6a6204b99ddac2476da890aa/comment/6a6538a35dca04895d8d1217"
---

[Discussion](https://hashnode.com/posts/building-a-production-rag-pipeline-document-processing-chunking-and-metadata-design/6a6204b99ddac2476da890aa)

Comment [Building a Production RAG Pipeline: Document Processing, Chunking, and Metadata Design](https://hashnode.com/posts/building-a-production-rag-pipeline-document-processing-chunking-and-metadata-design/6a6204b99ddac2476da890aa)

[Ahmet Özel](https://hashnode.com/@ahmetozel)

[Jul 25](https://hashnode.com/posts/building-a-production-rag-pipeline-document-processing-chunking-and-metadata-design/6a6204b99ddac2476da890aa/comment/6a6538a35dca04895d8d1217)

The hard-versus-soft metadata distinction is especially important, but I would keep tenant, permission, and superseded-document gates outside any model-derived query filter. Soft constraints such as topic or freshness can degrade gracefully when extraction is uncertain; authorization and document status must fail closed under server-owned policy. Logging candidate counts before and after each hard gate also makes an empty retrieval result explainable instead of mysterious.

[Damir Karimov](https://hashnode.com/@damir-karimov)

[Jul 26](https://hashnode.com/posts/building-a-production-rag-pipeline-document-processing-chunking-and-metadata-design/6a6204b99ddac2476da890aa/comment/6a6538a35dca04895d8d1217#reply-6a659803bd71e04b1d137170)

Excellent point. I completely agreeauthorization, tenant isolation, and document lifecycle should never depend on model-derived filters. Those are hard server-side constraints and should always fail closed. I also like the idea of logging candidate counts after each hard filter. It makes debugging empty retrieval results much more transparent instead of leaving everyone guessing.

Thanks for the valuable addition!

[Ahmet Özel](https://hashnode.com/@ahmetozel)

[Aug 6](https://hashnode.com/posts/building-a-production-rag-pipeline-document-processing-chunking-and-metadata-design/6a6204b99ddac2476da890aa/comment/6a6538a35dca04895d8d1217#reply-6a74295fecd1ec9b3bdaa1d0)

Exactly. I would turn those candidate counts into a retrieval audit record: query identity, policy version, collection snapshot, counts after tenant, status, and ACL gates, and the final document IDs. The content scorer can change over time, but the policy decision should remain reproducible. That separation also lets you distinguish “nothing relevant” from “relevant evidence existed, but this principal was not allowed to see it.”
