Logotipo de Building Surmise Relations

Building Surmise Relations

Organización
vanderbilt-data-science
building-surmise-relations

Use when you need to establish prerequisite relationships between knowledge items. Constructs the surmise relation (prerequisite quasi-order) using the QUERY algorithm with the AI agent as domain expert, producing confidence-scored prerequisite pairs with explicit rationale. Supports IITA data-driven and FCA-based approaches. Reads/produces knowledge graphs in graphs/*.json conforming to schemas/knowledge-graph.schema.json. Part of the KST pipeline — Phase 2, follows /mapping-concepts-and-competences, precedes /constructing-knowledge-space.

Descripción general

Editorvanderbilt-data-science
Repositorioknowledge-spaces
Nombre de la habilidadbuilding-surmise-relations
Estrellas
30
Forks
5
Archivos incluidos
1
LicenciaMIT
Enlaces
  • Instrucciones en Markdown

    Un archivo SKILL.md que el modelo carga cuando lo necesita, de modo que solo consume tokens cuando la petición encaja con la habilidad.

  • Funciona con cualquier LLM

    Las habilidades de IA están en Markdown, no en código específico de un proveedor, por lo que funcionan con GPT, Claude, Gemini, Grok o un modelo local.

  • Archivos incluidos: 1

    Scripts, plantillas y referencias que el modelo puede leer mientras trabaja. Los archivos son de solo lectura y nunca se ejecutan.

  • Código abierto

    Publicada por vanderbilt-data-science en GitHub. Revisa el contenido original antes de instalarla.

Instalación

Instala la habilidad de IA Building Surmise Relations en TypingMind para usarla con cualquier LLM, o añádela a otro agente que lea SKILL.md.

1

Instalar en TypingMind

TypingMind instala una habilidad directamente desde su carpeta de GitHub: lee SKILL.md, empaqueta los archivos de recursos y guarda el resultado localmente.

  1. Abre la aplicación y ve a Plugins → Habilidades.
  2. Elige «Instalar desde GitHub».
  3. Pega la URL de la carpeta de la habilidad que se muestra a continuación y confirma.
    https://github.com/vanderbilt-data-science/knowledge-spaces/tree/main/.claude/skills/building-surmise-relations
  4. Activa la habilidad en cada chat en el que quieras tenerla disponible.
Plugins → Habilidades → Añadir habilidad → URL de GitHub; después, pega la URL de la carpeta y pulsa Continuar.
2

Instalar en otro agente

Cualquier agente que lea el formato Agent Skills puede usar esta habilidad: copia la carpeta en el directorio de habilidades de ese agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/vanderbilt-data-science/knowledge-spaces.git /tmp/knowledge-spaces
mkdir -p .claude/skills
cp -r /tmp/knowledge-spaces/.claude/skills/building-surmise-relations .claude/skills/building-surmise-relations
Reinicia Claude Code después de copiarla para que detecte la nueva habilidad.

Úsala en TypingMind

Activa Building Surmise Relations en cualquier chat de TypingMind y el modelo se encargará del resto. Su nombre y descripción se incluyen en el prompt del sistema y, en cuanto una petición encaja con la habilidad, el modelo carga las instrucciones completas por sí solo. No tienes que invocarla manualmente y no consume tokens hasta que se utiliza.

El modelo carga Building Surmise Relations automáticamente en cuanto una petición es relevante para esa habilidad.

Funciona con cualquier modelo de IA

Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que Building Surmise Relations no está vinculada al modelo para el que se creó. Instálala una sola vez en TypingMind y úsala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modelo local que ejecutes tú, todo con tus propias claves API.

  • Se carga solo cuando se necesita

    El prompt del sistema solo incluye el nombre y la descripción. Las instrucciones se cargan con la primera petición que encaja con la habilidad, por lo que una habilidad que no se usa no supone ningún coste.

  • Cambia de modelo durante el chat

    Como la habilidad contiene instrucciones y no código, cambiar de modelo no impide que funcione: el nuevo modelo lee el mismo archivo SKILL.md.

Instrucciones de la habilidad

Este es el contenido de SKILL.md que carga el modelo. Léelo antes de instalar la habilidad: contiene instrucciones que tu modelo seguirá.

Building Surmise Relations

Role

You are a KST expert constructing the surmise relation -- the mathematical foundation of a knowledge space. The surmise relation is a quasi-order on knowledge items encoding which items are prerequisites of which others. You work within the Competence-Based KST (CbKST) framework (Heller & Stefanutti, 2024), building prerequisite structures at both the item and competence levels.

Input

$ARGUMENTS

The user provides a path to a knowledge graph file containing:

  • items[] -- the domain's knowledge items (required)
  • competences[] -- latent competences from the CbKST layer (optional)
  • Preliminary surmise_relations[] and competence_relations[] from /mapping-concepts-and-competences (optional)

Load the graph and verify it conforms to schemas/knowledge-graph.schema.json.

Computational Tools

Use scripts/kst_utils.py for all computational steps. Do not reason through transitive closure, cycle detection, or statistics manually.

bash
# After establishing direct relations:
python3 scripts/kst_utils.py closure <graph-path> --apply   # Compute and apply transitive closure
python3 scripts/kst_utils.py cycles <graph-path>            # Verify acyclicity (hard requirement)
python3 scripts/kst_utils.py stats <graph-path>             # Summary statistics

Methodology

1. QUERY Algorithm -- AI-as-Expert (Primary Method)

Use when no student response data is available. For full algorithm mechanics, see references/query-algorithm-detail.md.

Core question for each item pair (a, b):

"If a student has demonstrated mastery of item b, can we surmise that they have also mastered item a?"

If yes: a is a prerequisite of b (a -> b). If no: mastering b does not imply mastery of a.

Reasoning framework -- for each query, evaluate:

  1. Cognitive Task Analysis: What mental operations does mastery of b require? Do any constitute mastery of a?
  2. Logical Necessity: Is knowledge of a logically necessary to know b, or merely helpful? Only necessary dependencies count as prerequisites.
  3. Empirical Plausibility: Could a student realistically learn b without a? If students routinely do so, the prerequisite does not hold.
  4. Granularity Check: Is this a direct prerequisite, or does it hold only transitively? If a->c and c->b already exist, do not add a->b manually -- transitive closure handles it.

Efficiency strategy to avoid O(n^2) queries:

  1. Seed from existing relations: Accept high-confidence preliminary prerequisites from /mapping-concepts-and-competences. Re-examine medium/low-confidence ones.
  2. Topological reasoning: If items cluster into levels (foundational, intermediate, advanced), only query across adjacent levels.
  3. Transitivity exploitation: Once a->b and b->c hold, a->c is automatic -- skip it.
  4. Independence detection: Items from clearly unrelated subdomains need not be queried.

Confidence scoring:

ScoreMeaning
1.0Logically certain -- a is definitionally required for b
0.8-0.9Very strong -- hard to imagine mastering b without a
0.6-0.7Probable -- most students need a for b, but exceptions exist
0.4-0.5Uncertain -- plausible but debatable; flag for human review
Below 0.4Do not include -- insufficient evidence

2. IITA -- Data-Driven (When Student Data Available)

Inductive Item Tree Analysis extracts surmise relations empirically from student response patterns. See references/query-algorithm-detail.md for algorithm variants and integration protocol.

When to use:

  • Primary method when response data exists but no expert is available
  • Validation method to confirm or challenge expert-derived relations
  • Hybrid method to discover relations the expert may have missed

Tools:

  • R: DAKS package (Sargin & Unlu) -- original, corrected, and minimized corrected IITA
  • Python: learning_spaces package (Segedinac)

Integration with expert relations: Compare agreement (keep), expert-only (flag for review), IITA-only (evaluate for artifacts). Mark the source field: "query-algorithm", "iita", or "expert-and-iita".

3. FCA-Based Construction

Formal Concept Analysis provides a constructive method for deriving knowledge structures from competence-item mappings (Huang et al., 2025; Li et al., 2024). See shared-references/cbkst-overview.md for the CbKST-FCA relationship.

Method:

  1. Transform the skill map into a formal context (objects = items, attributes = competences via required_competences)
  2. Compute the concept lattice (Ganter & Wille, 1999)
  3. Derive prerequisite structure from the lattice order

When to use: When the competence structure is well-defined but item prerequisites are unclear, or as a cross-check against expert-derived relations.

4. CbKST Competence-Level Prerequisites

After establishing item-level surmise relations, derive competence_relations[] between competences.

Deriving competence prerequisites:

  1. For each competence pair (c1, c2): if every item requiring c2 also requires c1 (or has c1 as a transitive prerequisite), then c1 is a prerequisite of c2 at the competence level.
  2. Also reason directly about whether c1 is cognitively prerequisite to c2, independent of item mappings.
  3. Consistency check: competence prerequisites must be consistent with item prerequisites. If c1 -> c2, then items requiring only c2 should have items requiring only c1 as prerequisites.

5. Mathematical Properties to Enforce

The surmise relation must be a quasi-order. See shared-references/kst-foundations.md for formal definitions.

PropertyRequirementAction
ReflexivityEvery item is a prerequisite of itselfImplicit -- do not add self-loops
TransitivityIf a -> b and b -> c, then a -> cRun python3 scripts/kst_utils.py closure <graph-path> --apply
AcyclicityNo cycles among distinct itemsRun python3 scripts/kst_utils.py cycles <graph-path>
AntisymmetryIf a -> b and b -> a, then a and b should be mergedResolve by merging items or removing the weaker relation

Output

1. Query Process Log

Document reasoning for key queries. Format:

QUERY: Does mastery of [item-b] surmise mastery of [item-a]?
REASONING: [cognitive task analysis and logical argument]
DECISION: YES/NO
CONFIDENCE: [0-1]

For large domains, provide detailed logs for non-obvious decisions and summarize obvious ones in batch.

2. Updated Knowledge Graph

Read the existing graph and update surmise_relations[] and competence_relations[].

Item-level surmise relations:

json
{
  "prerequisite": "item-a-id",
  "target": "item-b-id",
  "confidence": 0.85,
  "rationale": "Understanding X is logically necessary for Y because...",
  "relation_type": "prerequisite-of",
  "source": "query-algorithm"
}

Competence-level relations:

json
{
  "prerequisite": "comp-id-1",
  "target": "comp-id-2",
  "confidence": 0.9,
  "rationale": "Competence X is cognitively prerequisite to competence Y because..."
}

Update metadata.provenance.skills_applied and metadata.provenance.change_log. Save to graphs/{domain-slug}-knowledge-graph.json.

3. Structure Summary

Run python3 scripts/kst_utils.py stats <graph-path> and augment with:

  • Total direct prerequisites established (item-level)
  • Total transitive relations added (item-level)
  • Total competence-level relations established
  • Relations flagged for human review (confidence < 0.6)
  • Cycles detected and resolved (if any)
  • Orphan items with no prerequisites and no dependents
  • Method(s) used: QUERY algorithm, IITA, FCA, or combination

Hasse diagram in Mermaid showing the direct prerequisite structure:

(Bottom-to-top: prerequisites point upward to items that depend on them.)

4. Recommendations

  • Items/relations flagged for human expert review
  • Whether IITA validation is recommended (if student data exists or could be collected)
  • Whether FCA-based cross-validation would strengthen the structure
  • Potential issues to address in /validating-knowledge-structure
  • Whether the structure looks ready for /constructing-knowledge-space

References

  • Koppen, M. & Doignon, J.-P. (1990). QUERY algorithm. See references/bibliography.md.
  • Doignon, J.-P. & Falmagne, J.-C. (1999). Knowledge Spaces. Ch. 4-5.
  • Heller, J. & Stefanutti, L. (2024). Knowledge Structures. See references/bibliography.md.
  • Cosyn, E. et al. (2021). ALEKS practical perspective. See references/bibliography.md.
  • Huang, B. et al. (2025). CbKST via FCA. See references/bibliography.md.

See references/bibliography.md for the complete bibliography.

Archivos incluidos

El modelo los lee según los necesita mientras la habilidad está cargada. Son archivos de solo lectura y nunca se ejecutan.

Preguntas frecuentes

¿Qué hace la habilidad de IA Building Surmise Relations?

Use when you need to establish prerequisite relationships between knowledge items. Constructs the surmise relation (prerequisite quasi-order) using the QUERY algorithm with the AI agent as domain expert, producing confidence-scored prerequisite pairs with explicit rationale. Supports IITA data-driven and FCA-based approaches. Reads/produces knowledge graphs in graphs/*.json conforming to schemas/knowledge-graph.schema.json. Part of the KST pipeline — Phase 2, follows /mapping-concepts-and-competences, precedes /constructing-knowledge-space.

¿Por qué usar Building Surmise Relations en TypingMind?

Porque la instalas una vez y la usas con cualquier modelo. Building Surmise Relations está escrita en Markdown, no en código específico de un proveedor, por lo que la misma habilidad funciona con GPT-5, Claude, Gemini, Grok o un modelo local, y puedes cambiar de modelo en mitad del chat sin que deje de funcionar. TypingMind utiliza tus propias claves API, de modo que pagas directamente a los proveedores en lugar de pagar una suscripción por puesto, y tus habilidades y chats permanecen en tu propio almacenamiento.

¿Cómo instalo Building Surmise Relations en TypingMind?

Abre Plugins → Habilidades → Instalar desde GitHub en TypingMind y pega https://github.com/vanderbilt-data-science/knowledge-spaces/tree/main/.claude/skills/building-surmise-relations. TypingMind lee el archivo SKILL.md de esa carpeta, empaqueta los archivos de la carpeta e instala el conjunto como una habilidad que puedes activar en cada chat.

¿Qué modelos de IA pueden usar Building Surmise Relations?

Cualquier modelo que conectes en TypingMind. Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que GPT, Claude, Gemini, Grok y los modelos locales pueden cargar esta habilidad cuando una solicitud se corresponda con ella.

¿Con cuántos modelos de IA puedo usar Building Surmise Relations?

Con tantos como quieras. Siempre que un modelo admita habilidades, puedes usar Building Surmise Relations con él: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama y muchos más, todos en TypingMind con tus propias claves API.

¿Es gratuita la habilidad de IA Building Surmise Relations?

Sí. vanderbilt-data-science la ha publicado en GitHub bajo la licencia MIT. Solo pagas a tu proveedor de IA por los tokens que utilizas.

¿Qué son las habilidades de IA?

Una habilidad de IA es un conjunto de instrucciones reutilizables que enseña a un modelo de IA a realizar una tarea concreta. Sigue el formato abierto Agent Skills: un archivo SKILL.md con un nombre y una descripción, además de los scripts, plantillas o archivos de referencia que pueda necesitar el modelo. El modelo solo lee las instrucciones cuando tu solicitud se corresponde con la habilidad, por lo que una habilidad instalada no supone ningún coste hasta que se utiliza.

¿En qué se diferencian las habilidades de IA de los plugins o los servidores MCP?

Un plugin o un servidor MCP proporciona al modelo nuevas herramientas que puede invocar: código que se ejecuta en algún lugar y devuelve un resultado. En cambio, una habilidad de IA aporta conocimientos y procedimientos al modelo: cómo abordar una tarea, qué pasos seguir y qué se considera un buen resultado. Las habilidades son instrucciones en Markdown, por lo que no necesitan servidor, clave API ni entorno de ejecución, y funcionan con cualquier modelo.

Ver el directorio

Crea ya tu propio espacio de trabajo con IA

Suscríbete a nuestro boletín para recibir avisos sobre nuevas funciones y próximos sorteos 👇