Problem
Teams that build an AI tutor on top of a course run into the limits of the two usual options. A free chat with an LLM gives uncontrolled answers and hallucinations. RAG over the course documents returns facts but no links between them: it does not know which concept must be learned before another. General-purpose graph builders (GraphRAG, KGGen, iText2KG) do not extract prerequisite chains, do not compute educational metrics and lose links between distant chapters. A methodologist used to map these dependencies by hand over months.
Example from the article: a textbook of 2–3 million tokens (algorithms, economics) or a lecture course (management, communications) has to become a graph that an agent can use to check a student's case solution.
Solution in brief
Turn the course text into a graph with a five-step LLM pipeline (K2-18). It has 3 node types and 9 edge types, and a second pass adds long-range links. Then compute educational metrics on the graph. The agent works only inside the graph: no node, no answer.
Questions this case answers
- How to turn a long text processed in pieces into a graph of typed dependencies between concepts with an LLM, including links between distant parts
- How to restrict an AI tutor to answer only from a graph built from the material and hand out-of-scope questions to a human
- How to build a prerequisite-aware knowledge graph from a textbook or lecture course with an LLM
- How to find long-range links between distant chapters when an LLM processes a long text in pieces
Tools and methods
- K2-18 pipeline — Slicer, iText2KG Concepts, iText2KG Graph, Dedup, Refiner; open source.
- LLM with JSON schema — extracts concepts, types and weights edges; repair-reprompts on schema mismatch.
- Embeddings and FAISS — semantic deduplication and candidates for long-range links.
- PageRank, betweenness, Louvain — educational metrics and clusters on the graph.
Google or a one-time email code. No password.