/semantic-okf:consult-semantic-okf-embeddingsfrom semantic-okf
Consults an existing embedding-enabled Semantic OKF snapshot through deterministic lexical, exact-vector, or hybrid retrieval while preserving exact concept paths and read-only authority boundaries. Use when Codex needs semantic discovery, paraphrase search, source- or concept-scoped retrieval, index inspection, explicit fallback without an embedding runtime, or grounded follow-up reading from a published snapshot. This skill never builds, repairs, refreshes, downloads models for, or modifies knowledge.
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.
Discover relevant chunks in an immutable Semantic OKF snapshot, then verify claims against its authoritative ledger, concepts, or selected RDF graph.
SKILL.md, references/, scripts/, and declared requirements.semantic/build-report.json and validate the complete retrieval binding before returning any hit.semantic/records.jsonl, the exact returned concept_path, or the explicitly selected RDF graph.Read retrieval-format.md when inspecting integrity or diagnosing a bundle. Read querying.md before choosing a search mode or interpreting fallback and scores.
Run commands from the directory containing this SKILL.md, or prefix script paths with the skill root.
The hashing, lexical, inspection, and validation baseline uses only the Python standard library:
python scripts/runtime_smoke.py
python scripts/query_semantic_okf_embeddings.py BUNDLE inspect
Set PYTHONDONTWRITEBYTECODE=1 or use python -B when the copied skill directory itself must remain byte-for-byte read-only. The consultant never writes inside the supplied bundle.
Install the optional local SentenceTransformers runtime only when the index declares that provider:
python -m pip install -r scripts/requirements-embeddings.txt
python scripts/runtime_smoke.py --embedding
Model weights are not bundled. The helper resolves the exact namespace/repository and immutable revision through huggingface_hub.snapshot_download(..., local_files_only=True) under offline flags, verifies that the resolved snapshot directory ends in that commit, and passes only the local path to SentenceTransformers on CPU with remote code disabled. It never chooses a default model or downloads missing weights.
semantic/records.jsonl for exact identifiers, types, mapped attributes, counts, and literal paths.concepts/**/*.md path returned by a hit for human-readable evidence.semantic/data.ttl for accepted facts that require joins, traversal, typed filtering, or aggregation.ontology.ttl only for schema, provenance.ttl only for lineage, and use shapes or validation graphs only for their declared contracts.Do not union RDF graphs by default. Do not use embeddings for exact counts, business identity, conflict resolution, or semantic entailment.
python scripts/query_semantic_okf_embeddings.py BUNDLE inspect
inspect requires exactly four regular non-symlink files under retrieval/, validates the retrieval build report against the live index and artifacts, then validates raw artifact hashes, the pre-retrieval core-tree digest, record and source bindings, exact concept paths and locators, chunk coverage, vector dimensions and finiteness, normalization tolerance, and sorted one-to-one chunk/vector identities. It reports capabilities and authoritative paths without loading a model.
Automatic hybrid retrieval with an explicit source filter:
The identifiers below are illustrative. Replace them with source or concept IDs reported by inspect for the supplied snapshot.
python scripts/query_semantic_okf_embeddings.py BUNDLE search \
--query "retention requirements for accepted records" \
--mode auto --source-id policies --top-k 5
Exact lexical fallback without an embedding runtime:
python scripts/query_semantic_okf_embeddings.py BUNDLE search \
--query "INC-2048" --mode lexical --top-k 10
Explicit vector search fails when the exact provider is unavailable. Permit a declared lexical fallback only when that behavior is acceptable:
python scripts/query_semantic_okf_embeddings.py BUNDLE search \
--query "how access begins for a new employee" \
--mode vector --allow-fallback --top-k 5
Repeat --source-id, --concept-id, or --concept-type to select a union of allowed values within that filter. Different filter kinds combine with logical AND.
requested_mode, effective_mode, and fallback before using hits.discovery_only: true; it prevents accidental promotion of ranking output to authoritative evidence.concept_path and locator exactly. Do not reconstruct hashed filenames or approximate character ranges.scores and ranks only to explain retrieval order. Hybrid ranking uses reciprocal-rank fusion rather than incomparable raw-score addition.returned is zero, report that the selected retrieval mode and filters found no candidate; do not invent an answer.Before answering, confirm:
agents/openai.yaml (opens in a new tab)references/querying.md (opens in a new tab)references/retrieval-format.md (opens in a new tab)scripts/_embedding_snapshot.py (opens in a new tab)scripts/query_semantic_okf_embeddings.py (opens in a new tab)scripts/requirements-embeddings.in (opens in a new tab)scripts/requirements-embeddings.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)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
16 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.npx claudepluginhub gvillarroel/plugins --plugin semantic-okf