DEV Community

Garry Yang
Garry Yang

Posted on

Chinese Metaphysics Meets AI: A Primer and a Blueprint for the Future

Most English-speaking developers encounter Chinese metaphysics through a single familiar symbol: the zodiac animal assigned to a birth year.

Behind that symbol is a much larger family of systems. They encode time through repeating cycles, describe change through relationships, and organize interpretation through charts made of pillars, palaces, stars, gates, and lines.

For a software developer, this is an unexpectedly rich design space.

It contains deterministic calculations, graph-like relationships, centuries of textual commentary, competing rule sets, multilingual terminology, and a final interpretive layer that depends heavily on context. In other words, it contains nearly every problem that makes modern AI products difficult.

This article offers two things:

  1. A practical introduction to Chinese metaphysics for readers who have never studied it.
  2. A blueprint for building an AI-native system that represents the tradition faithfully and explains it clearly.

The focus is representation and interface design: how software can model a living cultural tradition, expose its reasoning, and distinguish calculated facts from generated interpretation.

Chinese metaphysics is a family of systems

“Chinese metaphysics” is a modern English umbrella term. In practice, it often refers to several related Chinese traditions concerned with time, change, human circumstances, decision-making, and the relationship between people and their environment.

These traditions did not emerge as one unified product with one canonical specification. They developed across different historical periods, texts, lineages, and practical purposes. Yet many of them share a common conceptual vocabulary.

Academic discussions of early Chinese divination describe a world of correlative systems: yin and yang, the Five Phases, trigrams, calendrical cycles, directions, seasons, and astronomical observations were connected into models of change. Donald Harper’s study of the Han cosmic board describes these elements as the raw material for a wide range of divinatory and cosmological arts.

The important idea is relationship.

A symbol rarely has one self-contained meaning. Its interpretation depends on where it appears, when it appears, what surrounds it, and what question is being asked.

We can express that idea almost like a function:

meaning = symbol × position × time × relationships × question
Enter fullscreen mode Exit fullscreen mode

That is why a dictionary of symbols is useful, but never sufficient.

The shared vocabulary

Before looking at individual systems, it helps to understand a few building blocks.

Concept A developer-friendly description
Yin and yang Complementary states that transform into and define one another. The emphasis is interaction and dynamic balance, rather than two isolated substances.
Wuxing — the Five Phases Wood, Fire, Earth, Metal, and Water as changing processes and relational categories. “Five Phases” is usually more accurate than treating them as five physical elements.
Heavenly Stems and Earthly Branches Ten stems and twelve branches used to encode cyclical time. Their combinations form a repeating sixty-unit cycle.
Gua — trigrams and hexagrams Binary-looking line structures associated with the Yijing, or Book of Changes. Eight trigrams combine into sixty-four hexagrams.
Palaces, positions, and directions Structured locations inside a chart. Position changes the role and context of a symbol.
Seasonal strength and transformation Many interpretations ask whether a symbol is supported, constrained, active, dormant, changing, or timely.

The Internet Encyclopedia of Philosophy’s entry on yinyang emphasizes interaction, waxing and waning, and dynamic harmonization. Its entry on wuxing describes the Five Phases as interdependent processes rather than fixed building blocks of matter.

The calendrical layer is equally important. Ten Heavenly Stems and twelve Earthly Branches combine into the sexagenary cycle, a sixty-step system used to mark time. The Metropolitan Museum of Art’s discussion of a Han-period cosmic mirror provides a striking material example: the Earthly Branches appear as part of a diagram joining calendar, direction, and cosmology.

These are not merely labels. They form a reusable grammar from which different systems build different kinds of charts.

A map of the major systems

The broader field includes feng shui, date selection, physiognomy, and many other practices. For an introduction to AI-native chart interpretation, four systems are especially useful because they illustrate four different data and interaction models.

System Primary input Main representation Typical scale of inquiry
BaZi — Four Pillars Birth date and time Four stem-branch pillars representing year, month, day, and hour Long-term personal structure and timing cycles
Zi Wei Dou Shu Birth date and time Symbolic stars arranged across twelve life palaces Life domains, relationships among palaces, and timing layers
Liu Yao — Six-Line Divination A specific question and a six-line casting A primary hexagram, moving lines, and a resulting hexagram One event, relationship, decision, or near-term development
Qimen Dunjia A chosen or current moment A nine-palace time-space board with multiple symbolic layers Situations, timing, direction, strategy, and action

BaZi: time represented as four pillars

BaZi means “Eight Characters.” A birth moment is converted into four pillars—year, month, day, and hour—and each pillar contains one Heavenly Stem and one Earthly Branch.

The chart is then read relationally. Practitioners examine season, the balance and interaction of the Five Phases, relationships defined around the Day Stem, and larger timing cycles.

From a software perspective, BaZi resembles a deterministic transformation pipeline:

civil time
→ calendrical normalization
→ four stem-branch pairs
→ derived relationships
→ timing cycles
Enter fullscreen mode Exit fullscreen mode

Zi Wei Dou Shu: a symbolic map of life domains

Zi Wei Dou Shu converts birth information into a twelve-palace chart. The palaces represent domains such as life, career, relationships, wealth, health, and movement. Symbolic stars and transformations are placed across those palaces according to a sequence of calendrical rules.

Its data shape is closer to a graph than a flat list. A star has a general meaning, but its role changes with its palace, neighboring stars, opposing palace, supporting palaces, transformations, and timing layer.

The “stars” here function as symbolic markers in the chart. A digital implementation should treat them as typed entities with relationships, not as independent horoscope keywords.

Liu Yao: a question represented as six changing lines

Liu Yao grows from the six-line hexagram tradition associated with the Yijing. A casting produces six lines, some of which may be changing. Those lines form a primary hexagram and, when change is present, a resulting hexagram.

Later interpretive layers associate the lines with calendrical markers, roles, relationships, strength, movement, and the positions of the person asking and the matter being asked about.

Its product model is naturally event-centered:

one question
→ one casting
→ one structured situation
→ one focused interpretation
Enter fullscreen mode Exit fullscreen mode

Qimen Dunjia: a time-space board

Qimen Dunjia builds a nine-palace board for a particular moment. Multiple layers—commonly including stems, gates, stars, and symbolic spirits—occupy the same spatial grid.

The board is read through location and relationship: which symbol is in which palace, what other layers share that palace, how palaces interact, and which location represents the person or matter under consideration.

Among the four systems, Qimen makes the spatial nature of Chinese metaphysical reasoning most visible. A list of detected patterns is difficult to understand; a board that lets users inspect each palace preserves the structure of the original system.

Why this domain is interesting for AI

At first glance, Chinese metaphysics seems like an obvious chatbot use case: send a chart to a language model and ask for a reading.

That is also the fastest way to build an unreliable product.

The real opportunity appears when we separate five different jobs.

1. Calculation

Birth times, calendar boundaries, time zones, solar terms, stem-branch cycles, palace placement, and line transformation follow explicit rules.

These belong in deterministic code.

Given the same normalized input and the same rule-set version, the chart engine should return the same output every time. It should be covered by fixtures, boundary tests, cross-engine comparisons, and regression tests.

2. Knowledge organization

Classical passages, modern commentaries, terminology, school variants, and chart rules need to be indexed and connected.

This is where structured databases, document retrieval, knowledge graphs, source metadata, and human editorial work matter. AI can assist with OCR, entity extraction, translation drafts, and cross-text comparison, but the accepted rule set still needs provenance and review.

3. Context selection

A complete chart may contain hundreds of facts. Most are irrelevant to the user’s immediate question.

The system must identify:

  • what the user asked;
  • which chart object is in focus;
  • which nearby relationships matter;
  • which timing layer applies;
  • which facts are verified;
  • which interpretive rules are allowed.

This context builder is often more important than the final prompt.

4. Explanation

Once the context is correct, a language model becomes valuable.

It can turn dense symbolic relationships into readable language, adjust depth for a beginner or advanced reader, compare concepts, answer follow-up questions, and produce a coherent narrative from a structured fact set.

5. Interaction

The most promising interface is not a blank chat box.

It is an interactive chart in which every meaningful object can explain itself.

A user can click a pillar, palace, star, gate, line, relationship, or timing marker. The application already knows what was clicked and where it sits, so the user does not need to formulate a technically precise question.

AI becomes the interaction layer for a complex visual system.

Why a simple LLM wrapper fails

Large language models are optimized to produce plausible continuations, not to serve as deterministic chart calculators. Hallucination research repeatedly documents their tendency to produce fluent but unsupported content.

In this domain, that can take several forms:

  • placing a symbol in a position where it does not exist;
  • silently recalculating a chart with the wrong calendar convention;
  • mixing rules from different schools;
  • giving a generic definition instead of explaining the current chart;
  • treating one local symbol as a complete life conclusion;
  • burying the answer under jargon and implementation caveats;
  • inventing precision because the prose sounds more convincing that way.

Retrieval-augmented generation helps by giving the model relevant documents. The original RAG paper showed how retrieval can improve knowledge-intensive generation. But retrieval alone does not calculate a chart, resolve contradictory rule sets, or decide which facts are relevant to one user’s question.

The architecture therefore needs both deterministic computation and retrieval:

RAG answers: “Which sources discuss this concept?”

A chart engine answers: “What is actually present in this chart?”

A context builder answers: “Which of those facts matter here?”

An LLM answers: “How can I explain those facts clearly?”
Enter fullscreen mode Exit fullscreen mode

Each component solves a different problem.

The blueprint: an AI-native Chinese metaphysics system

Here is a practical reference architecture.

This blueprint is also informed by our work on Guanyitang (观易堂), an ongoing exploration of how these ideas can work across BaZi, Zi Wei Dou Shu, Qimen Dunjia, and Liu Yao in a real product.

User input
    ↓
Input validation and calendrical normalization
    ↓
Deterministic chart engine
    ↓
Structured chart facts and relationships
    ↓
Source, terminology, and school registry
    ↓
Question-aware context builder
    ↓
LLM explanation
    ↓
Output validation and quality checks
    ↓
Interactive chart, point-and-read, and follow-up dialogue
Enter fullscreen mode Exit fullscreen mode

Layer 1: input and calendrical normalization

The first layer validates and normalizes user input.

Depending on the system, that may include:

  • civil date and time;
  • calendar conversion;
  • time zone and historical offset;
  • location;
  • solar-term boundaries;
  • day-boundary conventions;
  • the exact moment of a question;
  • the user’s natural-language intent.

This layer deserves more attention than it usually receives. A beautiful interpretation of the wrong chart is still the wrong result.

Birth timestamps, locations, and personal questions can also be sensitive data. Collection, retention, encryption, and deletion policies should be designed before the AI layer is added.

Layer 2: deterministic chart engines

Each system should have its own deterministic engine behind a shared interface.

interface ChartEngine<Input, Chart> {
  calculate(input: Input, ruleset: RulesetVersion): Chart;
  validate(chart: Chart): ValidationResult;
}
Enter fullscreen mode Exit fullscreen mode

The ruleset must be explicit and versioned. If two lineages calculate a boundary differently, the application should model that as configuration rather than allow the language model to improvise a compromise.

This layer should be tested like financial or calendrical software:

  • known fixtures;
  • exhaustive lookup-table checks;
  • leap-month and boundary cases;
  • historical time-zone cases;
  • cross-implementation comparisons;
  • migration tests when a rule set changes.

Layer 3: a structured fact graph

The chart engine should emit typed facts and relationships, not a screenshot or one large paragraph.

type ChartFact = {
  id: string;
  subject: string;
  relation: string;
  object: string;
  scope: "natal" | "current" | "question";
  source: "calculated" | "curated";
};
Enter fullscreen mode Exit fullscreen mode

A fact graph might express that:

  • a star occupies a palace;
  • a line is moving;
  • a gate shares a palace with a stem;
  • two branches form a recognized relationship;
  • a timing cycle activates a natal position.

The graph gives the AI an addressable world. It also lets the interface highlight the exact objects behind an explanation.

Layer 4: evidence and variant management

Traditional systems contain textual variants and school differences. Those differences should be modeled as data.

type InterpretiveRule = {
  id: string;
  statement: string;
  appliesWhen: Condition[];
  tradition: string;
  sources: Citation[];
  reviewStatus: "draft" | "verified" | "disputed";
};
Enter fullscreen mode Exit fullscreen mode

The user-facing explanation should follow the selected rule set consistently. A separate evidence view can show provenance, variants, and editorial notes when the reader wants more depth.

Implementation notes belong in that evidence layer—not in the opening paragraph of every explanation.

Layer 5: a question-aware context builder

The context builder selects the smallest useful subgraph.

type ExplanationContext = {
  system: "bazi" | "ziwei" | "liuyao" | "qimen";
  question?: string;
  target: ChartObject;
  verifiedFacts: ChartFact[];
  relevantRules: InterpretiveRule[];
  language: string;
  readerLevel: "beginner" | "advanced";
};
Enter fullscreen mode Exit fullscreen mode

For a clicked chart object, the context builder should answer:

  1. What exactly did the user click?
  2. What does it generally represent?
  3. Which local relationships change its meaning?
  4. How does it connect to the user’s question?
  5. Which claims are supported by the selected rules?

The model should not receive an entire chart merely because the application has one.

Layer 6: generation designed around user needs

For beginners, a useful explanation can follow four progressive layers:

  1. Plain-language summary — one sentence that makes the concept understandable.
  2. General symbolism — its common role in the tradition.
  3. Meaning in this chart — the core value, grounded in the current position, relationships, timing, and question.
  4. Practical direction — what trend, tension, or next consideration the user should pay attention to.

Professional depth can remain available below the main answer:

  • contributing chart facts;
  • traditional rule statements;
  • alternate schools;
  • source excerpts;
  • calculation settings.

This is progressive disclosure applied to a symbolic knowledge system.

Layer 7: validation and evaluation

Generated text should not go directly from the model to the screen.

At minimum, the application should check:

Check What it catches
Target fidelity The answer discusses the object the user actually selected
Chart fidelity Every mentioned placement and relationship exists in the calculated chart
Rule consistency The answer follows the selected school and rule-set version
Question relevance The answer addresses the user’s actual topic
Language quality The output is understandable at the selected reader level
Uncertainty calibration The specificity of the conclusion matches the available evidence
Cross-language consistency Translations preserve chart facts and conceptual distinctions

This produces three clearly separated truth layers:

Calculated fact
    ↓
Curated traditional interpretation
    ↓
Generated synthesis
Enter fullscreen mode Exit fullscreen mode

Each layer can be tested differently.

Passing calculation tests proves that the software implements a selected tradition consistently. It does not, by itself, establish the empirical validity of that tradition’s predictive claims. A trustworthy product should keep internal consistency, historical provenance, and empirical validation conceptually distinct.

The NIST AI Risk Management Framework offers a useful general principle here: trustworthiness has to be managed across the full system lifecycle, not delegated to a model prompt.

What the ideal user experience looks like

Imagine a user who knows nothing about Chinese metaphysics.

They enter a birth time or ask a specific question. The application presents a short overview before showing the detailed chart:

Here is the central pattern, the strongest supporting factor, the main tension, and the timing layer that matters now.

The chart remains visible. When the user clicks any unfamiliar symbol, the interface opens a contextual explanation beside it.

The user does not see:

This system uses version A of a rule because version B is disputed.

They see:

This symbol represents the part of the situation that is trying to move forward. In your current chart it is supported by timing, but constrained by the position opposite it. That combination suggests momentum with a dependency: progress is more likely after the external condition changes.

If the user wants to know why, they can expand the evidence:

Why this interpretation?
├── Selected chart position
├── Relevant relationships
├── Timing condition
├── Traditional rule
└── Alternative reading, if materially different
Enter fullscreen mode Exit fullscreen mode

They can then ask a follow-up:

What external condition should I watch?

The conversation remains anchored to the same chart, target, question, and evidence. The model does not start a new free-form reading on every turn.

That is an AI-native experience: visual exploration, contextual explanation, and conversation working as one system.

AI can also change how the tradition is studied

The consumer reading is only one application.

The same infrastructure could support:

A searchable classical-text workbench

A researcher could search one concept across multiple editions, inspect parallel passages, compare terminology, and trace how an interpretation changed over time.

A rule-comparison environment

Different schools could be represented as versioned rule bundles. Developers and practitioners could run the same input through each bundle and see exactly where the outputs diverge.

Interactive learning

Instead of memorizing isolated terminology, a student could explore a complete chart and ask why each relationship matters. The system could reveal complexity gradually as the learner advances.

Cross-cultural translation

Terms such as wuxing, guan gui, or yong shen rarely map cleanly to one English phrase. AI can provide a short functional translation while preserving the original term and its system-specific meaning.

Corpus quality control

Models can help identify duplicate passages, inconsistent tables, missing citations, and candidate disagreements. Human review can then focus on the places most likely to contain meaningful differences.

In all of these cases, AI is most useful as an amplifier of structured scholarship—not as an authority that silently decides which tradition is correct.

A realistic development roadmap

An effective implementation can grow in five stages.

Stage 1: make the chart correct

  • Normalize time and calendar inputs.
  • Implement deterministic engines.
  • Build comprehensive fixtures and boundary tests.
  • Record rule-set versions.

Stage 2: make the knowledge traceable

  • Define canonical terminology.
  • Build a source registry.
  • Encode interpretive rules and their conditions.
  • Record school variants instead of flattening them.

Stage 3: make the chart understandable

  • Generate beginner-friendly summaries.
  • Add point-and-read explanations.
  • Keep every response grounded in verified facts.
  • Validate outputs before display.

Stage 4: make the experience conversational

  • Preserve chart and target context across follow-ups.
  • Let users change focus without restating the chart.
  • Offer progressive depth rather than one enormous report.

Stage 5: make the tradition explorable

  • Add multilingual explanations.
  • Connect concepts to primary texts.
  • Provide rule comparison and learning modes.
  • Build evaluation sets with practitioners, historians, translators, and ordinary users.

The larger opportunity

Chinese metaphysics is an unusually demanding test case for AI.

It combines formal calculation with interpretive judgment. It relies on relationships more than isolated labels. It contains both stable procedures and lineage-specific variants. Its terminology carries cultural meaning that is easy to flatten in translation. Its users often arrive with emotionally important questions and expect a clear answer.

Solving those challenges well would produce more than a better metaphysics application.

It would demonstrate a reusable pattern for many expert domains:

deterministic facts
+ structured knowledge
+ contextual retrieval
+ constrained generation
+ interactive explanation
Enter fullscreen mode Exit fullscreen mode

The most promising role for AI in Chinese metaphysics is to become an interface between a complex symbolic system and a human question.

The chart provides structure. The sources provide memory. The rules provide boundaries. The model provides language. The interface lets the user move between them.

That combination—not a chatbot pretending to be an oracle—is the blueprint worth building.

Questions for the DEV community

  • Would you model the interpretive layer as a knowledge graph, a rule engine, or both?
  • How would you test contextual usefulness in a domain without a simple answer key?
  • Where should school variants appear in the user experience?
  • What other complex visual systems could benefit from point-and-read AI?

References and further reading


AI disclosure: This article was developed with AI-assisted research and editing. The author remains responsible for its arguments, factual review, and final publication.

Top comments (0)