Skip to main content

Wendao: AI learning companion

Try the live demo Example course: MLE4217/5219 Python 3.11+ Flask backend LLM: Anthropic, OpenAI, or Gemini

Wendao (问道, wèn dào, "asking the way") is an AI learning companion. It turns your course materials into two things for students:

  • an interactive knowledge graph of the course's chapters and concepts, and
  • an AI learning agent that answers questions using only the course materials, with a link to the page each answer came from.

It was built for the NUS course MLE4217/5219 Materials Informatics, and this repository uses that course as its example. Nothing in the code is tied to that course, so you can run it on any course written as Markdown pages and Jupyter notebooks.

Try the live demo: the knowledge graph of the example course, in your browser (no install; the AI chat needs a Wendao server, so it is off in the demo).

Guides: teacher guide · server setup · developer notes · plans and ideas

Demo

Knowledge graph

Chapters, pages, and concepts, linked where the course connects them. Drag, zoom, and search; click a concept to read a short introduction from the notes and jump to the course page.

The Wendao knowledge graph of the example course: a concept selected, with its short introduction from the notes, its links to chapters and pages, and buttons to explain it, ask about it, or read more in the course

Try it: live demo

Guided path

New to the course? The guided path walks through it chapter by chapter: each chapter's overview and learning objectives from the course pages, then the key concepts it introduces, with where to read about them. Students can stop and continue later. Try it.

The guided path at the Structures chapter: progress, the chapter's overview and learning objectives from its index page, and Back and Next, with the graph zoomed to the chapter and its pages and concepts

Try it: the guided path in the live demo

AI learning agent

Select a node and press Explain, or ask your own question. Answers come only from the course and link to the pages they used. If the course doesn't cover a question, the agent says so.

The AI learning agent next to the graph: an answer to a follow-up question about convex hulls, with the course pages it used listed as links

Chat widget on your course website

The Wendao widget on a course page: an answer about convex hulls with links to the course pages it used The widget's Graph tab in dark mode: the course knowledge graph, chapters and the concepts that connect them

Install

You need Python 3.11 or newer.

pip install wendao

Students don't install anything: they use your website, the chat widget on your course pages, or one HTML file.

Quick start

wendao init my-course        # a new workspace with a notes/ folder
# copy your notes (Markdown, notebooks, PDF, slides, Word, LaTeX) into my-course/notes/
cd my-course
# choose a model under [model] in wendao.toml, and put its API key in .env
wendao build                 # graph, concepts, and search index
wendao doctor                # checks everything and says how to fix problems
wendao serve                 # opens the course website at http://127.0.0.1:5057/

No model yet? Everything except the AI answers still works, and wendao ask --search-only "..." shows what search finds. To try the example course: git clone https://github.com/deng-group/wendao.git, then cd wendao/examples/mle4217_5219 and run wendao serve --no-check (it is already built; for AI answers, set your own model under [model] in its wendao.toml).

The teacher guide explains each step and setting.

Share it with students

Way How AI answers
One HTML file wendao export, then share build/<course>.html; it opens by double-click needs a server
Website put Wendao on a server (server setup) and share the link yes
Chat widget wendao widget install _build/html --api https://... on your built course website yes

You decide how the AI answers: write your own instructions in AGENTS.md, and with assignment_help = "hints" it helps with graded work without solving it. You decide who pays for AI answers: your key (with a daily limit per student and optional sign-in), each student's own key, or either. See How students use AI.

A graph on any website

Not only for courses: the graph embed shows any knowledge graph inside an ordinary web page, with no server. For example, a publication graph made from a BibTeX file with wendao bibtex. See docs/EMBED.md.

Commands

Command What it does
wendao init my-course Create a new workspace with starter files
wendao build Read your notes; build the knowledge graph, concepts, and search index (only what changed)
wendao doctor Check settings, notes, build, test questions, and model, and say how to fix problems
wendao ask "question" Ask a question (--search-only: see what search finds, without a model)
wendao serve Run the course website (--widget: the API for the chat widget)
wendao export Put the knowledge graph in one HTML file
wendao widget install _build/html Add the chat widget to every page of a built course website
wendao embed install assets/wendao Put a graph on any website, with no server (how)
wendao bibtex papers.bib Make a publication graph (themes, papers, collaborators) from a BibTeX file, for the embed
wendao insights See what students ask about, and which questions your notes couldn't answer
wendao feedback See which answers students marked as not helpful, and why
wendao students See your class list and how many questions each student asked

Run any command with --help to see its options.

How it works

Wendao workflow: course materials are extracted and chunked, feed a retrieval-augmented generation pipeline and an LLM, and surface as an interactive knowledge graph and an AI learning agent

Wendao splits your notes into small pieces, links chapters and concepts that appear together, and, for each question, finds the most relevant pieces with keyword and meaning-based search. If they don't really answer the question, it says so instead of guessing. Otherwise a language model (Claude, GPT, Gemini, DeepSeek, or a local model) writes the answer from them. No training or GPU is needed.

Citation

Wendao is developed by the Deng group in the Department of Materials Science and Engineering at the National University of Singapore, for MLE4217/5219 Materials Informatics. If you use Wendao or adapt it for your own course, please cite this repository:

@software{wendao2026,
  author = {Deng, Yanhao and Deng, Zeyu},
  title  = {Wendao: an AI learning companion with an interactive course knowledge graph},
  year   = {2026},
  url    = {https://github.com/deng-group/wendao}
}

License

Wendao is free software under the GNU General Public License v3.0 or later. You can use, study, change, and share it. If you share a changed version, you must share its source code under the same license.

Metadata

Release files for wendao 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wendao 0.4.0
File Size Uploaded Provenance Actions
wendao-0.4.0.tar.gz 208.7 kB With provenance Details for wendao-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for wendao 0.4.0
File Interpreter ABI Platform Actions
wendao-0.4.0-py3-none-any.whl Python 3 none any Details for wendao-0.4.0-py3-none-any.whl

Total release size: 400.5 kB

Release files / wendao-0.4.0.tar.gz

Download URL wendao-0.4.0.tar.gz
Size 208.7 kB
Tags Source
SHA-256 checksum
How to use checksums
fdcb93b85f023847a7dfecd7a77fd4e4ec5ac1ddebf46268b30052cae03b23f9
BLAKE2b-256 checksum
How to use checksums
0b2170c235b9301a9d7970d2be92932b131e10f410dc2b22ff45b19a26fa2a6a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.

Transparency log

Release files / wendao-0.4.0-py3-none-any.whl

Download URL wendao-0.4.0-py3-none-any.whl
Size 191.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7afd32101aa1f6bc44e7c96c6c7992555bab5087fd8df3cb88e485b65ea421f8
BLAKE2b-256 checksum
How to use checksums
dde5ba1460e10ce84c5069b598bbcfd45ea87fddafaf130aa3132452609a9a1f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.

Transparency log

Security for wendao 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for wendao-0.4.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page