| name | semiosis-skill |
| description | Drive the semiosis KnowledgeBase: hyperbolic entailment cones over Matryoshka octaves. Use it whenever a task requires semantic search, hierarchy navigation, context packing, or KB health management. The KB is the single source of truth for meaning; state carried only in prose is lost on restart. |
| allowed-tools | Skill, Read, Write, Bash(pytest *), Bash(python *) |
semiosis
The KB is the state; prose is not. Retrieval, ingest, memory, and health ops
route through the KnowledgeBase API (core/agent_api.py), never narrated.
Boot
from core.agent_api import KnowledgeBase, QueryPriority, FailureMode
kb = KnowledgeBase()
kb.ingest(texts)
Reload from disk: KnowledgeBase.load(path).
Orient before acting
kb.diagnose() -> DiagnoseReport. Read failure_mode first:
NONE: healthy, proceed.
OUTSIDE_CONE: ingest focused texts on target domain, re-diagnose.
BOUNDARY_AMBIGUOUS: call kb.consolidate() before search.
OVER_COMPRESSED: use kb.deep_search(), ingest more diverse texts.
OCTAVE_MISMATCH: use kb.deep_search() for cross-octave queries.
recovery_suggestions carries the action string verbatim.
Retrieval
hits = kb.search(query, k=5, priority=QueryPriority.MEDIUM)
Read hits in confidence order:
evidence_path_count >= 3 + uncertainty_score < 0.2: high-confidence claim.
evidence_path_count == 1 + uncertainty_score > 0.6: weak, verify or re-query.
aperture < 0.3: specific concept; aperture > 1.0: broad prior.
local_entropy > 1.0: ambiguous concept, decompose query.
Multi-hop / causal chain: kb.deep_search(query, k=5) (RLM octave descent).
Token-budgeted context: kb.build_context_pack(query, max_tokens=2000).
Adaptive pattern:
search(k=3, priority=LOW) -- route/identify domain.
- If
uncertainty_score > 0.5 on top hit, retry with priority=HIGH.
- If still
> 0.5, ingest more texts (KB gap).
Memory
kb.remember("key fact")
kb.forget("key fact")
kb.recall("topic")
Facts survive save/load; session metadata does not.
Health and self-improvement
report = kb.consolidate()
Call consolidate when diagnose().redundant_pairs > nodes // 4.
Learning loop:
kb.record_outcome(query, useful_texts, useless_texts)
Call after every agent interaction that produced a judgment on hit quality.
Navigation
kb.navigate(node_id, direction="flow_out")
kb.scan_tension(top_n=10)
Use scan_tension to find semantic conflicts before synthesizing an answer.
Persistence
kb.save(path)
kb = KnowledgeBase.load(path)
m = kb.metrics()
Reproducibility key: Settings snapshot x lakeFS CommitId (see CLAUDE.md).
Semantic Navigation
Distance, direction, and trajectory in embedding space at any dimensionality.
d = kb.semantic_distance(text_a, text_b, octave=128)
dists = kb.semantic_distance(text_a, text_b)
p = kb.best_octave(text_a, text_b)
sd = kb.compute_direction(node_id_a, node_id_b, octave=128)
results = kb.direction_search(anchor_text, sd.direction_vec, k=5)
dirs = kb.fold_directions(node_id)
result = kb.search_with_reflection(query, reflect_fn=lambda q: llm_rephrase(q))
Adaptive pattern:
- semantic_distance(a, b) across all octaves -> call best_octave to find sharpest signal.
- compute_direction(node_a, node_b) -> direction_search to find what lies in that direction.
- uncertainty_score > 0.5 on search -> call search_with_reflection with a reflect_fn.
Advanced Primitives
compress_hierarchy(query, max_nodes=10)
sense_complexity(query)
fold_budget(query, max_tokens, texts)
sparse_search(query, k, sparsity=0.9)
contrastive_direction(text_a, text_b)
find_analogy(text_a, text_b, text_c)
concept_boundary(node_a, node_b)
entropy_dispel(entropy_ceiling=2.0)
build_digest_chain(summarizer=None)
attention_score(node_id, query)
optimal_octave(query, entropy_budget=1.5)
information_content(node_id)
agentic_reflect(query, llm_fn=None, max_rounds=3)
categorical_parent_score(query, k=5)
activation_embed(text)
energy_gradient_search(query, max_steps=10)
Decision additions:
- high local_entropy hits -> entropy_dispel then re-search
- vague query -> sense_complexity -> use mc.suggested_octave
- compound query -> decompose_query -> parallel sub-searches
- analogy/transfer queries -> find_analogy
- context overflow -> fold_budget to prune candidates
- node pair ambiguity -> concept_boundary; low margin -> expect BOUNDARY_AMBIGUOUS
- query is vague, needs iterative focus -> agentic_reflect
- need best parent category for a concept -> categorical_parent_score
- need activation-prediction or standard embedding -> activation_embed
- need efficient concept localization via energy -> energy_gradient_search
Autonomous research
For open-ended research (not a single retrieval), drive the auto-research loop via
research-loop-skill (Skill(skill="research-loop-skill")): it emits Directives you
execute against this KB and accumulates a trained instruction set across sessions.
Invariants
- Manifold: Lorentz/hyperboloid;
_EPS=1e-7 arccos clamp, _MIN_APERTURE=0.1 rad floor.
- Octave ids are prefix-namespaced (
root@64); all Matryoshka octaves coexist in store.
- Env override:
SC_ENCODER__MODEL=... (prefix SC_, delimiter __).
- Tests:
pytest core/ (requires torch + geoopt; auto-skip if absent).