knowledgespaces¶
Knowledge Space Theory in Python — from item analysis to adaptive assessment.
Build knowledge structures and spaces from prerequisite relations.
Derive structures by querying human experts or LLMs.
Derive structures from skill maps and competence models.
Adaptive assessment with BLIM and Expected Information Gain.
Estimate BLIM parameters from response data via EM.
ks inspect, ks query, ks assess for non-programmers.
Use KST via LLM — tools, docs, and guided workflows.
Full API documentation generated from source code.
Quick example¶
import knowledgespaces as ks
# Build a knowledge structure
structure = ks.space_from_prerequisites(
["add", "sub", "mul"],
[("add", "sub"), ("sub", "mul")],
)
# Assess a student
result = ks.assess(structure, {"add": True, "sub": True, "mul": False})
print(result["state"]) # {'add', 'sub'}
print(result["outer_fringe"]) # {'mul'} — what to learn next
Install¶
Requires Python 3.10–3.14. These pages describe the unreleased 0.2.0 development version. Install from the repository root to use its new APIs:
pip install .
pip install knowledgespaces installs the latest published PyPI release,
which can differ from this checkout.
Then head to Getting Started for a five-minute tour.