/semantic-okf:build-semantic-okf-embeddingsfrom semantic-okf
Builds and independently validates an atomic Semantic OKF/RDF v1 snapshot plus a hash-bound, non-authoritative retrieval projection with record or semantic chunks and local embeddings. Use when Codex needs to materialize Markdown, CSV, JSON/JSONL, or RDF sources for semantic discovery, compare native and LlamaIndex splitting, use deterministic hashing or a pinned offline SentenceTransformers model, or reproduce an embedding-enabled corpus build. This skill owns construction only and does not answer questions from the snapshot.
Ships in semantic-okf. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Build one authoritative Semantic OKF core and one derived retrieval projection as a single validated release. Keep model-dependent chunks outside the record ledger and RDF graphs so retrieval changes never redefine reviewed semantic identity.
SKILL.md, references/, scripts/, and package-local requirements.retrieval/ as non-authoritative discovery data; concepts/, semantic/records.jsonl, and the RDF graphs remain the evidence layers.Never accept an implicit provider, hosted model, mutable model revision, network download, remote code, partial source selection, zero vector, or stale retrieval binding.
Run commands from the directory containing this SKILL.md, or prefix paths with the copied skill root:
python scripts/build_semantic_okf_embeddings.py manifest.json retrieval-plan.json semantic-okf-embeddings --concept-layout source-packed-v1 --output-format json
python scripts/validate_semantic_okf_embeddings.py semantic-okf-embeddings --output-format json
The output directory must not already exist. A successful release contains the complete Semantic OKF core and exactly four derived retrieval files:
semantic-okf-embeddings/
index.md
concepts/
semantic/
ontology.ttl
data.ttl
shapes.ttl
provenance.ttl
records.jsonl
semantic-plan.json
source-manifest.json
validation-report.ttl
build-report.json
retrieval/
index.json
chunks.jsonl
embeddings.jsonl
build-report.json
retrieval/index.json binds the projection to the byte digest of semantic/records.jsonl, a canonical digest of every core file, a canonical selected-input inventory, the closed retrieval-plan digest, and the chunk/vector artifact hashes. Chunks bind back to exact record and concept identities. Vectors bind one-to-one to sorted chunk IDs.
Use this plan shape for a dependency-free retrieval baseline after installing the core requirements:
{
"schema_version": "1.0",
"selection": {
"source_ids": ["claims-a", "paper-a"]
},
"chunking": {
"implementation": "native",
"strategy": "semantic",
"buffer_size": 1,
"breakpoint_percentile_threshold": 95
},
"embedding": {
"provider": "hashing",
"model_id": "knowledge-hashing-embedding",
"revision": "1",
"dimension": 384,
"normalize": true
}
}
Use strategy: "record" for one chunk per selected record. The native semantic splitter uses the selected embedder to compare buffered adjacent sentence units. Smaller percentile thresholds generally create more chunks; validate the resulting evidence boundaries on representative inputs.
Install LlamaIndex only for chunking.implementation: "llamaindex":
python -m pip install -r scripts/requirements-llamaindex.txt
Install SentenceTransformers only for embedding.provider: "sentence-transformers":
python -m pip install -r scripts/requirements-sentence-transformers.txt
The SentenceTransformers plan requires a Hugging Face namespace/repository model ID and immutable hexadecimal revision. The runtime forces Hugging Face and Transformers offline modes, resolves that exact revision from the local cache, verifies the snapshot directory revision, and gives SentenceTransformers only the resolved local path with local_files_only=True, trust_remote_code=False, and CPU execution. It never downloads weights or accepts a local path as a model ID. Prepare and govern the cache outside this build, then prove the exact revision is locally available before starting.
LlamaIndex receives the selected local embedder explicitly. It never chooses an OpenAI model or another hosted default. Optional imports are lazy; a missing extra fails with the exact package-local requirements file to install.
Before delivery, confirm all of the following:
eligible_source_ids, and excluded sources are explicit;agents/openai.yaml (opens in a new tab)references/coherence-contract.md (opens in a new tab)references/manifest.md (opens in a new tab)references/python-runtime.md (opens in a new tab)references/retrieval-plan.md (opens in a new tab)references/source-combination.md (opens in a new tab)scripts/_build_semantic_okf_core.py (opens in a new tab)scripts/_embedding_retrieval.py (opens in a new tab)scripts/_semantic_okf.py (opens in a new tab)scripts/build_semantic_okf_embeddings.py (opens in a new tab)scripts/requirements-llamaindex.in (opens in a new tab)scripts/requirements-llamaindex.txt (opens in a new tab)scripts/requirements-sentence-transformers.in (opens in a new tab)scripts/requirements-sentence-transformers.txt (opens in a new tab)scripts/requirements.in (opens in a new tab)scripts/requirements.txt (opens in a new tab)scripts/runtime_smoke.py (opens in a new tab)scripts/validate_okf_bundle.py (opens in a new tab)scripts/validate_semantic_okf_embeddings.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub gvillarroel/plugins --plugin semantic-okf16 skills in this plugin
/build-semantic-okfBuilds and maintains a Semantic OKF source definition and its generated knowledge folder with deterministic Python adapters for Markdown, CSV, JSON or JSONL, and RDF. Use when Codex needs to create or change a manifest, source topology, mapping, ontology, validation rule, generated snapshot, refresh, promotion, rollback, or recovery. This skill owns construction and maintenance only; it does not answer questions from the generated knowledge./build-semantic-okf-adaptiveBuilds and independently validates an atomic Semantic OKF/RDF snapshot plus a deterministic adaptive retrieval projection for arbitrary declared sources. Use when Codex needs a standalone offline builder that combines Bag of Words, BM25, topic communities, a PPMI term graph, query-aspect routing, diversified reranking, and exact evidence bindings without changing authoritative records or requiring embeddings. This skill owns construction only and never answers from a published snapshot./build-semantic-okf-classicalBuilds and independently validates an atomic Semantic OKF/RDF snapshot plus a deterministic, non-authoritative classical text-retrieval projection. Use when Codex needs Bag of Words, Okapi BM25, corpus lexical statistics, co-occurrence topic communities, PPMI query expansion, or diversity-aware retrieval without embeddings or model downloads. This standalone skill owns construction only and never answers from a published snapshot.