home / skills / zpankz / mcp-skillset / pex-cli

pex-cli skill

/pex-cli

This skill helps you prepare for CICM/ANZCA exams with semantic search, learning paths, and prerequisite chains in a knowledge graph.

npx playbooks add skill zpankz/mcp-skillset --skill pex-cli

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
3.3 KB
---
name: pex-cli
description: Primary Exam (PEX) Knowledge Graph CLI for CICM/ANZCA exam preparation. Semantic search over Learning Outcomes, SAQs, concepts, and topics. Use for exam study, prerequisite chains, learning paths, and higher-order concept connections.
version: 1.0.0
category: medical-education
triggers:
  - pex
  - primary exam
  - cicm
  - anzca
  - learning outcome
  - saq
  - exam preparation
  - medical education
tags:
  - cli
  - graph
  - embeddings
  - medical
  - exam
  - falkordb
---

# PEX CLI Skill

## Purpose

Knowledge graph-based exam preparation for CICM/ANZCA Primary Exams. Provides semantic search, prerequisite chains, learning paths, and LLM-inferred higher-order connections.

## Quick Start

```bash
# Semantic search for Learning Outcomes
pex search "shock physiology" --limit 10

# Show prerequisites for a topic
pex prereq "LO-cardio-001"

# Generate learning path for a concept
pex path "cardiovascular physiology"

# Find concepts that refine/specialize another
pex refine "hemodynamics"

# Graph statistics
pex stats
```

## Commands

### Search (Semantic)

```bash
# Search Learning Outcomes (default)
pex search "septic shock management" --limit 5

# Search specific node types
pex search "dobutamine" --label Concept
pex search "cardiovascular" --label Topic
pex search "shock" --label SAQ
```

### Prerequisite Chains

```bash
# Show prerequisites for a Learning Outcome
pex prereq "LO-001"

# Get specific node by ID
pex get "LO-001"
```

### Learning Paths

```bash
# Generate learning path for a topic
pex path "renal physiology"

# Find LOs that refine/specialize another
pex refine "fluid balance"

# Find concepts implied by this concept
pex imply "cellular respiration"
```

### Data Ingestion

```bash
# Ingest from markdown files (LOs, SAQs)
pex ingest-md /path/to/markdown/

# Phase 6 LLM inference for higher-order connections
pex phase6-infer --model claude-3-5-sonnet

# Clear graph
pex clear
```

## Graph Schema

```cypher
(:LearningOutcome {id, name, description, domain, embedding})
(:SAQ {id, question, answer, topic, embedding})
(:Concept {id, name, category, embedding})
(:Topic {id, name, description, embedding})

(:LearningOutcome)-[:PREREQUISITE_OF]->(:LearningOutcome)
(:LearningOutcome)-[:COVERS]->(:Concept)
(:SAQ)-[:TESTS]->(:LearningOutcome)
(:Concept)-[:IMPLIES]->(:Concept)
(:LearningOutcome)-[:REFINES]->(:LearningOutcome)
```

## Integration with Grounding Router

The PEX CLI integrates with the grounding-router as the Σₚₑₓ primitive:

```yaml
Σₚₑₓ — Primary Exam Source

Sub-Primitives:
| Σₚ₁ | LO Search    | 0.95 | pex search "topic" --label LearningOutcome |
| Σₚ₂ | SAQ Search   | 0.90 | pex search "topic" --label SAQ |
| Σₚ₃ | Prerequisites| 0.85 | pex prereq "LO-id" |
| Σₚ₄ | Learning Path| 0.80 | pex path "concept" |
```

## Dependencies

| Service | Port | Required |
|---------|------|----------|
| FalkorDB | 6379 | Yes |
| Ollama | 11434 | For embeddings |

## Configuration

Location: `~/.pex/config.toml`

```toml
[graph]
host = "localhost"
port = 6379
graph_name = "pex"

[embeddings]
model = "qwen3:4b"
dimension = 4096
```

## Related Skills

- `limitless-cli` - Personal context (correlate study sessions)
- `grounding-router` - Medical education grounding primitives
- `saq` - SAQ practice workflows

Overview

This skill is a CLI for Primary Exam (PEX) knowledge graph access, designed to support CICM/ANZCA Primary exam preparation. It exposes semantic search over Learning Outcomes, SAQs, Concepts, and Topics and surfaces prerequisite chains, learning paths, and inferred higher-order connections. Use it to explore curriculum structure, plan study sequences, and link clinical questions to core learning outcomes.

How this skill works

The CLI queries a knowledge graph where nodes represent Learning Outcomes, SAQs, Concepts, and Topics and edges capture prerequisite, cover, imply, and refine relationships. Semantic search uses vector embeddings so queries match meaning, not just keywords. Commands return ranked results, prerequisite chains, generated learning paths, and LLM-inferred relations produced during a phase-6 inference step.

When to use it

  • When you need targeted Learning Outcomes related to a clinical topic or SAQ
  • To reveal prerequisite chains before studying an advanced concept
  • To generate a sequential learning path for focused revision
  • When mapping SAQs to specific outcomes for exam-style practice
  • To discover higher-order concept links inferred by an LLM

Best practices

  • Search with short, focused queries (e.g., "septic shock physiology") to get precise Learning Outcome matches
  • Use prereq on an LO ID to expose required foundations before diving into advanced material
  • Run phase6-infer periodically after ingesting new content to refresh inferred connections
  • Limit results for interactive study sessions (use --limit) to avoid overload
  • Combine pex results with personal study context (e.g., annotate or export matched LOs)

Example use cases

  • pex search "shock physiology" --limit 10 to find relevant Learning Outcomes and Concepts
  • pex prereq "LO-cardio-001" to list prerequisite LOs needed for an advanced cardiology outcome
  • pex path "cardiovascular physiology" to produce an ordered study path from fundamentals to applied topics
  • pex refine "hemodynamics" to find LOs that specialize or extend that concept
  • pex ingest-md /path/to/markdown/ followed by pex phase6-infer --model claude-3-5-sonnet to load content and infer higher-order links

FAQ

What data sources can I ingest?

You can ingest markdown files containing Learning Outcomes and SAQs. The CLI expects structured markdown formats for best results.

How are embeddings produced?

Embeddings are created by the configured local service (e.g., Ollama) or remote model per your config; ensure the embeddings service is running and correctly referenced in ~/.pex/config.toml.

Can I clear and rebuild the graph?

Yes. Use pex clear to remove the current graph, then re-ingest content and run phase6-infer to rebuild edges and inferred relations.