A decision tree generator that builds a binary yes/no tree for a chosen domain and lets you walk it interactively to a final outcome. It is handy for chatbot logic mockups, routing demos, and explaining how rule-based decision flows work.
How it works
Pick a domain — support routing, loan approval, medical triage, or spam filtering — and a depth. The generator recursively builds a full binary tree: every internal node is a question drawn from the domain’s question bank, and every leaf at the chosen depth is filled with an outcome from the domain’s outcome list. Because each level branches into two, a depth-N tree has 2^N leaves.
You can walk the tree by answering Yes or No, descending one level per answer until you hit a leaf and see the outcome. A Back button steps up one level and Start over returns to the root. The tree is seeded for reproducibility, so the same settings reproduce the same tree, and Regenerate advances the seed.
Tree depth and the number of leaves
Choosing the right depth is a practical decision about readability:
| Depth | Questions asked | Leaf outcomes |
|---|---|---|
| 2 | Up to 2 | 4 |
| 3 | Up to 3 | 8 |
| 4 | Up to 4 | 16 |
| 5 | Up to 5 | 32 |
A depth of 2 or 3 is ideal for demos, specs, and explanatory diagrams. A depth of 4 or 5 produces a full logic tree that is more useful for illustrating the scale problem than for human reading. The printed flowchart is most scannable at depth 2–3.
Reading the printed output
The full tree prints as an indented text flowchart:
Is the customer a paying subscriber?
Yes → Did the issue start in the last 24 hours?
Yes → Escalate to Tier 2
No → Send self-help article
No → Is this a billing question?
Yes → Route to billing
No → Close as resolved
Each level of indentation represents one question. The arrows lead to either another question (internal node) or a final outcome (leaf). This format is easy to paste into a spec document, a Confluence page, or a slide deck without any diagramming tool.
What decision trees are good at (and not good at)
Good for:
- Routing problems with a small, fixed number of crisp binary questions
- Explaining a rule-based system to a non-technical stakeholder
- Prototyping chatbot conversation logic before writing code
- Demonstrating the concept of classification without requiring data
Not good for:
- Problems where the best question depends on numeric thresholds (use a regression model or a scored rule system instead)
- High-dimensional data with many possible questions (trees grow unmanageably)
- Cases where questions are correlated (asking the same information twice in different forms)
This generator produces illustrative samples, not a tree fitted to real data. The questions and outcomes come from curated domain word banks, so they are examples of what a real routing tree might ask — not a clinically or financially validated decision aid.
Using the output in a project
- For a chatbot flow: walk the tree to verify every path reaches a sensible outcome, copy the full tree as a spec, and implement each question as a bot message with yes/no buttons.
- For a slide deck: keep depth at 2, screenshot the interactively walked path, and annotate the screenshot with your real outcome labels.
- For a routing rule spec: generate several trees for the same domain, compare the question orderings, and keep the one that best matches how your support team actually escalates.