snapshot-and-version-a-knowledge-base
Use when a wrong answer may trace to a specific corpus state that has since changed. Snapshots the chunk set, embeddings and index config as one versioned unit so any answer is reproducible.
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 81
- Forks
- 17
01 前言 Front Matter
- name
- snapshot-and-version-a-knowledge-base
- description
- Use when a wrong answer may trace to a specific corpus state that has since changed. Snapshots the chunk set, embeddings and index config as one versioned unit so any answer is reproducible.
02 资源文件 3
- 许可证LICENSE1.0 KB
- 参考文档SOURCE.md363 B
- 参考文档TRUST.auto.yaml2.2 KB
03 SKILL.md 正文
Snapshot and Version a Knowledge Base
When an answer was wrong last week, you need the exact chunks, vectors and splitter that produced it — not the current corpus. A knowledge base version is the whole pipeline state, addressable and reproducible.
Procedure
-
Define a version as the tuple: chunker id, embedding model id, chunk set hash, and index build id — all four.
-
On every build, write
kb/versions/<version>.jsonwith those fields plus a UTC timestamp and the source manifest hash. -
Store the chunk set durably (
chunks-<version>.jsonl), not just its hash, so a past retrieval can be rebuilt exactly. -
Tag the serving index with its version, and log the version on every query and answer.
-
Never mutate a built version in place; a change creates a new version and a new tag.
-
Keep the previous version servable for a rollback window; switching is a pointer change, not a rebuild.
-
Tie every evaluation run to a version id so a metric is always attached to a corpus state.
-
On answering a "why did it say X" question, pull the chunk set for the logged version and reconstruct.
-
Retain versions by policy: keep the last N and any that served during an incident.
-
Document the diff between two versions (documents added/removed/changed) so drift is explainable.
-
Record the serving version in every eval result so a metric and a corpus state are never separated.
Pitfalls
-
Versioning the code but not the corpus, so the same commit produces different answers a week apart.
-
Rebuilding over the same version tag, destroying the state a past answer depended on.
-
Storing only the chunk hash, so the text can never be recovered for a reconstruction.
-
Logging the version on the index but not on the query, so answers cannot be tied to a state.
-
Keeping so many snapshots that storage cost forces deleting the one an incident needs.
-
Tagging the model id but not the chunker version, so a splitter change is invisible.
-
A snapshot that stores the index but not the chunker config, so it cannot be rebuilt.
-
Versioning the corpus but not the query rewriter, so two runs of one version differ.
Verification
jq -r '.version,.chunker,.model,.chunks_sha,.built_at' kb/versions/*.json | tail -5
python3 rebuild.py --version kb-2026-10-08.3 --out /tmp/rebuilt.jsonl # must match stored chunk set hash
# passes when any logged answer's version rebuilds byte-identically
Report to the user: current version id, its four fields, the retention policy, and confirmation that a past version reconstructs.
04 同仓库更多 Skills
recipe-performance
Diagnose a specific MetaMask user flow's real-app performance and Sentry critical-user-flow telemetry with deterministic mm-harness recipes. Use for CUF boundaries, cold/warm/background-resume behavior, latency regressions, lifecycle tags, duplicate or blocking network requests, long tasks, layout/paint cost, screen redraws, React rerenders, or browser trace analysis where tests alone cannot prove the real app.
mexc-spot-websocket
MEXC Spot WebSocket workflows for public streams, protobuf handling, depth maintenance, listen keys, and private streams without exposing API keys.
mexc-spot-rest
MEXC Spot REST workflows for public data, signed account requests, orders, wallet/admin actions, and secure signing without exposing API keys.
mexc-futures-websocket
MEXC Futures WebSocket workflows for public streams, private account/order/position streams, ping/pong, subscriptions, and depth maintenance.
0xklen-version-and-refresh-sanctions-lists
暂无简介
verify-tests-cover-changed-lines
Use when a PR adds code that the existing suite may not exercise. Measures patch coverage — the share of newly changed lines hit by tests — before approving.