padosoft-rag-knowledge-baselisted
Install: claude install-skill padosoft/skills
# RAG knowledge base
A corpus is not a folder of files with embeddings next to it. It is a store with an identity contract, a
lifecycle and a trust ordering — and the three defects that follow from not having them are always the
same: the same document indexed twice, a document that cannot be deleted, and an answer grounded on
something nobody approved.
**The rule: a model may propose knowledge; only a human promotes it. And everything the corpus holds carries
its identity, its status and its origin explicitly.**
---
## 1. One idempotency anchor, and everything hangs off it
```text
(tenant or project) + (source path) + (content hash)
```
Re-ingesting the same content is a no-op; changed content is a new version of the same document, not a
second document. Get this wrong and the corpus grows duplicates that all retrieve, so the model sees the
same passage three times and treats the repetition as agreement.
**Normalise the path through one function, and use it everywhere** — ingest, read, delete, the command line
and the HTTP surface alike. This is the rule people break by reimplementing the normalisation inline:
- separators unified, repeated separators collapsed, leading and trailing ones trimmed;
- relative segments **rejected**, not stripped — that is the traversal guard, and the inline version is
always the one that forgets it;
- an empty result raises, and the caller surfaces it as a validation error rather than swallowing it.
**When ingest and delete normalise