Skip to content

Core

Import

import {
createTree,
getCanonicalTree,
getTreeTopology,
getTreeDescription,
getTreeNodeDescriptions,
getSphereProfile,
getPathProfile,
getTreeSection,
getSphereSections,
createTreeWorkspace,
id,
parseId,
SPHERES,
SPHERES_DATA,
HEBREW_LETTERS,
HEBREW_LETTERS_DATA,
TAROT_ARKANNUS,
PLANETS,
WESTERN_ZODIAC_SIGNS,
WESTERN_HOUSES,
WESTERN_ASPECTS,
WESTERN_ELEMENTS,
MELKITZEDEKI_PATHS,
TREE_TOPOLOGY_LIGHTNING_SPHERE_NAMES,
FOUR_WORLDS,
KaabalahTypes,
WesternAstrologyTypes,
TarotTypes,
LetterTypes,
NumerologyTypes,
MiscTypes,
} from 'kaabalah/core';

Overview

The Core module provides a graph structure — TreeOfLife — for mapping correspondences across esoteric systems. Each node in the graph represents an entity (a sphere, a tarot card, a Hebrew letter, a zodiac sign, a planet, a number, etc.) and edges represent correspondences between them.

You never instantiate TreeOfLife directly. Use the createTree factory to get a configured instance, or use getCanonicalTree for a cached, read-only TreeWorkspace.

Factory: createTree

function createTree(opts?: TreeOptions): TreeOfLife

Creates a new TreeOfLife and loads the requested system and optional parts into it.

import { createTree } from 'kaabalah/core';
// Kaabalah system with tarot and western astrology parts
const tree = createTree({
system: 'kaabalah',
parts: ['westernAstrology', 'tarot'],
});

TreeOptions

FieldTypeDescription
systemSystemKeyWhich system to load (required)
partsPartKey[] (optional)Additional parts to load on top of the base system

Available systems (SystemKey)

ValueDescription
"kaabalah"Kaabalah as taught by the Melkitzedeki Order. It is the only system; the Hermetic and Lurianic trees were removed in 8.0.0

Available parts (PartKey)

Parts extend the base system with additional nodes and correspondences.

Part keyAdds
"westernAstrology"Planets, zodiac signs, houses, elements, modalities, aspects
"tarot"78-card tarot deck (major, minor, court) with meanings
"colors"12 spectral colors with hex codes
"music"12 musical notes with frequencies

When multiple parts are loaded, bridges automatically link compatible parts (e.g. colors + music, colors + westernAstrology).

Canonical tree: getCanonicalTree

function getCanonicalTree(opts?: TreeOptions): TreeWorkspace

Returns a cached, read-only TreeWorkspace built from the given options. Repeated calls with the same options return the same instance. This is the preferred API for read-only access — it is more efficient than createTree for scenarios where you do not need to mutate the graph.

import { getCanonicalTree } from 'kaabalah/core';
const workspace = getCanonicalTree({
system: 'kaabalah',
parts: ['westernAstrology', 'tarot'],
});
const node = workspace.getNode(id('sphere', 'Tiphareth'));

Tree topology: getTreeTopology

function getTreeTopology(opts?: TreeTopologyOptions): TreeTopology

Returns the structural Tree of Life topology separately from correspondence traversal. Use this when you need the fixed sphere/path skeleton, adjacent spheres, a path between two spheres, or named routes such as lightning and serpent.

import { getTreeTopology } from 'kaabalah/core';
const topology = getTreeTopology({ system: 'kaabalah' });
const path = topology.getPathBetween('Kether', 'Chokhmah');
const lightning = topology.getRoute('lightning');
console.log(lightning?.spheres.map((sphere) => sphere.name));

The canonical lightning route descends:

Kether -> Chokhmah -> Binah -> Chesed -> Geburah -> Tiphareth -> Netzach -> Hod -> Yesod -> Malkuth

serpent is the reverse route. Route segments include isConnected and optional path; this lets callers distinguish canonical route order from whether the selected system has a direct structural path for every hop.

TreeTopology API

topology.getSpheres(options?: { includeDaath?: boolean }): TreeTopologySphere[]
topology.getPrimarySpheres(): TreeTopologySphere[]
topology.getSphere(lookup: TreeTopologySphereLookup): TreeTopologySphere | undefined
topology.getPaths(): TreeTopologyPath[]
topology.getPath(lookup: TreeTopologyPathLookup): TreeTopologyPath | undefined
topology.getPathBetween(first, second): TreeTopologyPath | undefined
topology.getAdjacentSpheres(sphere): TreeTopologyAdjacentSphere[]
topology.getRoutes(): TreeTopologyRoute[]
topology.getRoute('lightning' | 'serpent'): TreeTopologyRoute | undefined
topology.nextInRoute(route, sphere): TreeTopologySphere | undefined
topology.previousInRoute(route, sphere): TreeTopologySphere | undefined

Path ids remain stable correspondence targets (path:1, path:2, etc.), but topology traversal is now a separate structural API instead of a generic graph walk.

TreeWorkspace API

TreeWorkspace is an immutable, query-oriented view of the graph. It is what getCanonicalTree and createTreeWorkspace return.

Node queries

// Get a single node by its NodeId
workspace.getNode<T extends NodeType>(id: NodeId<T>): Node<T> | undefined
// Check existence
workspace.hasNode(id: NodeId<NodeType>): boolean
// Get all nodes, optionally filtered by type
workspace.getNodes<T extends NodeType>(type?: T): Node<T>[]
// Search nodes by type, id list, text search, or predicate
workspace.findNodes<T extends NodeType>(options?: TreeFindNodesOptions<T>): Node<T>[]

TreeFindNodesOptions fields:

FieldTypeDescription
typeT | readonly T[] (optional)Filter to one or more node types
idsreadonly NodeId<T>[] (optional)Filter to specific node IDs
searchstring (optional)Substring search on id and name
predicate(node: Node<T>) => boolean (optional)Custom filter function

Edge queries

// Get a single edge between two nodes (order-independent)
workspace.getEdge(left: NodeId<NodeType>, right: NodeId<NodeType>): CorrespondenceEdge | undefined
// Get all edges, or all edges touching a specific node
workspace.getEdges(nodeId?: NodeId<NodeType>): CorrespondenceEdge[]

Correspondence queries

The primary way to explore relationships. Performs BFS from a node and returns typed matches with distance and traversal path.

workspace.getCorrespondences<T extends NodeType, U extends NodeType>(
nodeId: NodeId<T>,
options?: TreeCorrespondenceQueryOptions<U>
): CorrespondenceMatch<U>[]

TreeCorrespondenceQueryOptions fields:

FieldTypeDefaultDescription
typeU | readonly U[] (optional)—Filter results to these node type(s)
depthnumber (optional)1BFS depth (hops from source node)
includeSelfboolean (optional)falseInclude the source node itself in results
limitnumber (optional)InfinityMax number of matches to return

CorrespondenceMatch shape:

interface CorrespondenceMatch<T extends NodeType> {
node: Node<T>; // the matched node
distance: number; // BFS hops from source
path: readonly CorrespondenceStep[]; // edges traversed
}

For a grouped view by node type:

workspace.getCorrespondenceMap<T extends NodeType>(
nodeId: NodeId<T>,
options?: Omit<TreeCorrespondenceQueryOptions, 'type'>
): CorrespondenceMap

Returns an object keyed by NodeType (e.g. { sphere: [...], tarotArkAnnu: [...], hebrewLetter: [...] }).

Notes queries

workspace.getNotes(target?: TreeNoteTarget): TreeNote[]

Returns notes attached to a node ({ kind: "node", nodeId }) or a correspondence ({ kind: "correspondence", left, right }). Overlays can attach notes to the graph.

Portuguese descriptions

Node data is English. getTreeDescription and getTreeNodeDescriptions return the Portuguese text for it without touching the node, covering the sphere, world, letter, color and music metadata. Node names such as Chokhmah and Tiphareth, branded IDs and the original node data never change.

import { getCanonicalTree, getTreeDescription, getTreeNodeDescriptions, id, KaabalahTypes } from 'kaabalah/core';
getTreeDescription('Crown', 'pt-BR'); // 'Coroa'
getTreeDescription('Unknown text', 'pt-BR'); // undefined
const tree = getCanonicalTree({ system: 'kaabalah', parts: [] });
const node = tree.getNode(id(KaabalahTypes.SPHERE, 'Kether'))!;
getTreeNodeDescriptions(node, 'pt-BR');
// { meaning, colorDescription, noteDescription, nameMeaning, ... } — only the fields the node has

getTreeNodeDescriptions returns the available meaning, colorDescription, noteDescription, nameMeaning (the translated meaning of a sphere or world name), letterMeaning, symbol and hieroglyph fields. Custom text without a catalog entry is returned unchanged. pt and pt-BR select Portuguese; any other language, or none, selects English. In the CLI, kaabalah tree:node path:1 --language pt-BR returns the Portuguese descriptions.

Sphere profiles: getSphereProfile

A sphere node carries only its Hebrew spelling and the meaning of its name. getSphereProfile returns what the sphere means, for display beside a chart or a reading. Use it to explain a sphere to someone who does not practice: for example, the spheres that weigh most in a buildKaabalisticMapData result.

import { getSphereProfile, listSphereProfiles } from 'kaabalah/core';
const geburah = getSphereProfile('Geburah'); // or 'sphere:Geburah', any case
geburah.essence; // 'Strength and discipline: the courage that sets limits and cuts away what does not serve.'
geburah.keywords; // ['strength', 'discipline', 'courage', 'justice', 'severity', 'initiative']
geburah.expression; // { balanced, excess, lack }
geburah.work; // 'Justice of every kind, the increase of power, the cutting of ties, ...'
getSphereProfile('Geburah', 'pt-BR'); // the same profile in Portuguese
listSphereProfiles(); // all eleven, in the Tree's order

The profile has two groups of fields.

GroupFields
Plain wordsessence, keywords, work (what is worked in the sphere when one walks the Tree), expression (balanced, excess, lack)
CorrespondencesnameMeaning, titles, magicalImage, instrument (on the magician’s table), symbols, geometricForm, world, divineName, archangel, choir, yetziraticText, spiritualExperience, attributes, virtues, vices, body, places, lifeAreas, animals, plants, stones, metals, drugs, tarot, colors (one per world), candles, incense

expression gives the three ways the theme of a sphere shows up in a person. A heavy sphere in a chart means the theme is prominent, not that the person lives it in excess: show the three and let the person recognise which one applies.

Some fields are absent on purpose:

  • expression is given for every sphere. For Kether, Chokhmah, Daath and Malkuth it reads the theme through the sphere’s planet in the graph (Neptune, Uranus, Pluto, the Earth).
  • Daath has only essence, keywords, nameMeaning, titles, magicalImage, instrument, work, body, places, animals, plants, stones, metals and drugs.

An unknown sphere returns undefined. pt and pt-BR select Portuguese; any other language, or none, selects English. SPHERE_PROFILES is the frozen bilingual source, with { en, pt } in every text field.

Tree sections: worlds, pillars and triads

getTreeSection describes the parts of the Tree that group spheres: the four worlds, the three columns and the three triangles.

import { getTreeSection, listTreeSections, getSphereSections } from 'kaabalah/core';
getTreeSection('pillar:left'); // Pillar of Severity: Binah, Geburah, Hod
getTreeSection('supernal', 'pt-BR'); // short form of 'triad:supernal', in Portuguese
listTreeSections({ kind: 'world' }); // Atziluth, Briah, Yetzirah, Assiah
const { world, pillar, triad } = getSphereSections('Geburah');
// world.id 'world:Briah', pillar.id 'pillar:left', triad.id 'triad:second'
KindIDscorrespondences keys
worldworld:Atziluth, world:Briah, world:Yetzirah, world:Assiahletter, element, suit, hierarchy, verb, mind, level
pillarpillar:right, pillar:left, pillar:middlepolarity, movement, name
triadtriad:supernal, triad:second, triad:thirdorientation, functions

Every section has id, kind, name, title, spheres, essence, keywords, description and correspondences.

  • level is the level of reading of each world: literal for Assiah, symbolic for Yetzirah, the shivaya (the hermetic garden) for Briah and the unified field for Atziluth.
  • A world lists the spheres whose choir belongs to it. Each sphere also acts in all four worlds at once, which is why a sphere profile has a colour for each world.
  • Daath belongs to the middle pillar and to no world and no triad. Malkuth is the sphere outside the three triangles. getSphereSections returns null for a section the sphere does not have.

In the CLI, kaabalah tree:sphere Geburah and kaabalah tree:section pillar:left return the same data.

Path profiles: getPathProfile

A path is one Hebrew letter and one major ark annu between two spheres. getPathProfile returns what the path means and what is taught about its ark annu.

import { getPathProfile, listPathProfiles, getSpherePathProfiles } from 'kaabalah/core';
const path = getPathProfile(13); // or '13', 'path:13', 'Death', 'A Morte', 'Mem'
path.from; // 'Geburah'
path.to; // 'Hod'
path.tarotCard; // 'Death'
path.essence; // 'Renewal: the duality above meets the duality below, and what could kill the soul is allowed to die.'
path.keyPhrase; // 'I kill what could kill my soul.'
path.misuse; // ['destruction', 'fatality', 'loss', ...]
getPathProfile(13, 'pt-BR'); // the same profile in Portuguese
listPathProfiles(); // all 22, in order
getSpherePathProfiles('Geburah'); // the paths that touch a sphere
GroupFields
Read from the Treenumber, from, to, meaning, hebrewLetter, tarotCard, correspondence (its element, planet or sign)
Plain wordsessence, keywords, letterQuality, keyPhrase, affirmation, misuse, dailyUse
Practicemantras, mantraNote, incense, candles, instruments, aminoAcid

mantras are written as they are sounded and are the same in both languages. letterQuality is what the letter stands for (silence for Aleph, beauty for Tav) and aminoAcid is its amino acid in the book of life, where the first and last letters are pauses. misuse, mantraNote, candles, instruments and dailyUse are absent where the teaching on that ark annu does not give them. The gestures of the ark annu are not part of the profile.

An unknown path returns undefined. PATH_PROFILES is the frozen bilingual source, keyed by path number. In the CLI, kaabalah tree:path 13 returns the same data.

TreeOfLife instance methods

createTree returns a TreeOfLife, which is mutable. In addition to all of TreeWorkspace’s read methods, it exposes mutation methods used internally by system loaders. The main read methods on TreeOfLife are:

MethodDescription
getNode(id)Look up a node by id
getNodes()All nodes as an array
getEdge(left, right)Edge between two nodes
getEdges(nodeId?)All edges or edges for a node
related(id, type?)Direct neighbors, optionally filtered by type
relatedFirst(id, type)Convenience: related(id, type)[0]
relatedTypes(id)All distinct types directly connected to a node
walk(id, depth?, type?)BFS to depth hops, optional type filter
activeSystemThe currently loaded SystemKey
availablePartsAll parts that can be loaded
loadedPartsParts currently loaded

Branded NodeId system

Every node has an id of type NodeId<T> — a branded string in the format "type:value" (e.g. "sphere:Kether", "tarotArkAnnu:The Magician"). Branding provides compile-time type safety.

id(type, value) — create a NodeId

import { id, KaabalahTypes, TarotTypes, WesternAstrologyTypes } from 'kaabalah/core';
const sphereId = id(KaabalahTypes.SPHERE, 'Tiphareth');
// => NodeId<"sphere"> = "sphere:Tiphareth"
const cardId = id(TarotTypes.TAROT_ARK_ANNU, 'The Magician');
// => NodeId<"tarotArkAnnu"> = "tarotArkAnnu:The Magician"
const planetId = id(WesternAstrologyTypes.PLANET, 'Mars');
// => NodeId<"planet"> = "planet:Mars"

parseId(nodeId) — extract the value

import { parseId } from 'kaabalah/core';
parseId(id(KaabalahTypes.SPHERE, 'Tiphareth'));
// => "Tiphareth"

Node types

KaabalahTypes

Enum valueString valueDescription
KaabalahTypes.SPHERE"sphere"Sephirah (e.g. Kether)
KaabalahTypes.PATH"path"Path between two spheres
KaabalahTypes.WORLD"world"One of the Four Worlds

WesternAstrologyTypes

Enum valueString value
WesternAstrologyTypes.PLANET"planet"
WesternAstrologyTypes.WESTERN_ZODIAC_SIGN"westernZodiacSign"
WesternAstrologyTypes.WESTERN_ELEMENT"westernElement"
WesternAstrologyTypes.HOUSE"house"
WesternAstrologyTypes.ASPECT"aspect"
WesternAstrologyTypes.MODALITIES"modalities"

TarotTypes

Enum valueString value
TarotTypes.TAROT_ARK_ANNU"tarotArkAnnu"
TarotTypes.TAROT_SUIT"tarotSuit"

LetterTypes

Enum valueString value
LetterTypes.HEBREW_LETTER"hebrewLetter"
LetterTypes.LATIN_LETTER"latinLetter"
LetterTypes.SANSKRIT_LETTER"sanskritLetter"
LetterTypes.VATTAN_LETTER"vattanLetter"

NumerologyTypes

Enum valueString value
NumerologyTypes.NUMBER"number"

MiscTypes

Enum valueString value
MiscTypes.COLOR"color"
MiscTypes.MUSICAL_NOTE"musicalNote"
MiscTypes.UNCATEGORIZED"uncategorized"

Constants

All constants are exported from kaabalah/core.

Spheres

import { SPHERES, SPHERES_DATA } from 'kaabalah/core';
// SPHERES: keys are identifiers, values are sphere names
SPHERES.KETHER // "Kether"
SPHERES.TIPHARETH // "Tiphareth"
SPHERES.MALKUTH // "Malkuth"
// ... Chokhmah, Binah, Daath, Chesed, Geburah, Netzach, Hod, Yesod
// SPHERES_DATA: contains hebrewSpelling and englishName per sphere
SPHERES_DATA.KETHER // { hebrewSpelling: "כתר", englishName: "Crown" }

Paths

import { MELKITZEDEKI_PATHS } from 'kaabalah/core';
// 22 paths numbered 1–22
MELKITZEDEKI_PATHS.KETHER_CHOKHMAH // 1
MELKITZEDEKI_PATHS.YESOD_MALKUTH // 22

Hebrew letters

import { HEBREW_LETTERS, HEBREW_LETTERS_DATA } from 'kaabalah/core';
HEBREW_LETTERS.ALEPH // "Aleph"
HEBREW_LETTERS.TAV // "Tav"
// HEBREW_LETTERS_DATA contains: type ("mother"|"double"|"simple"),
// gematriaValue, gematriaValueWhenEnding?, symbol, hieroglyph,
// yvritMeaning, character, characterWhenEnding?
HEBREW_LETTERS_DATA.ALEPH
// { type: "mother", gematriaValue: 1, symbol: "Man", character: "א", ... }

Tarot

import { TAROT_ARKANNUS, TAROT_ARKANNUS_DATA, TAROT_SUITS, TAROT_DECKS } from 'kaabalah/core';
TAROT_ARKANNUS.THE_MAGICIAN // "The Magician"
TAROT_ARKANNUS.ACE_OF_WANDS // "Ace of Wands"
// TAROT_ARKANNUS_DATA: type ("major"|"minor"|"court"), suit?,
// aliases?, keywords?, descriptiveData? (per-deck names/meanings)
TAROT_ARKANNUS_DATA.THE_MAGICIAN.type // "major"
TAROT_ARKANNUS_DATA.THE_MAGICIAN.keywords // ["co-creation", "will", ...]
TAROT_ARKANNUS_DATA.THE_MAGICIAN.keywordsPt // ["cocriação", "vontade", ...] (major Ark Annus, same order)
TAROT_SUITS.WANDS // "Wands"
TAROT_DECKS.PAPUS_KAABALISTIC // "Papus Kaabalistic"

Astrology

import {
PLANETS,
WESTERN_ZODIAC_SIGNS,
WESTERN_HOUSES,
WESTERN_ASPECTS,
WESTERN_ELEMENTS,
MODALITIES,
} from 'kaabalah/core';
PLANETS.SUN // "Sun"
WESTERN_ZODIAC_SIGNS.ARIES // "Aries"
WESTERN_HOUSES.ASCENDANT // "ascendant"
WESTERN_ASPECTS.TRINE // "trine"
WESTERN_ELEMENTS.FIRE // "Fire"
MODALITIES.CARDINAL // "Cardinal"

Four Worlds

import { FOUR_WORLDS, FOUR_WORLDS_DATA } from 'kaabalah/core';
FOUR_WORLDS.ATZILUTH // "Atziluth"
FOUR_WORLDS_DATA.ATZILUTH // { englishName: "World of Emanation" }

Colors and musical notes

import { COLORS, COLORS_DATA, MUSICAL_NOTES, MUSICAL_NOTES_DATA } from 'kaabalah/core';
COLORS.RED // "RED"
COLORS_DATA.RED // { colorDescription: "Red", colorNames: ["Red"], colorHexCodes: ["#FF0000"] }
MUSICAL_NOTES.DO // "DO"
MUSICAL_NOTES_DATA.DO // { note: "C", noteDescription: "C (Do)", frequencies: [...] }

Usage examples

Look up a sphere and its correspondences

import {
getCanonicalTree,
id,
KaabalahTypes,
TarotTypes,
WesternAstrologyTypes,
SPHERES,
} from 'kaabalah/core';
const workspace = getCanonicalTree({
system: 'kaabalah',
parts: ['westernAstrology', 'tarot'],
});
const tipharethId = id(KaabalahTypes.SPHERE, SPHERES.TIPHARETH);
// Direct correspondences (depth = 1 by default)
const correspondences = workspace.getCorrespondences(tipharethId);
// Filter to tarot cards only, going 2 hops deep
const tarotCards = workspace.getCorrespondences(tipharethId, {
type: TarotTypes.TAROT_ARK_ANNU,
depth: 2,
});
// Grouped by type
const byType = workspace.getCorrespondenceMap(tipharethId, { depth: 2 });
// byType.planet, byType.westernZodiacSign, byType.tarotArkAnnu, ...

Traverse from a tarot card to its Hebrew letter and planet

import {
getCanonicalTree,
id,
TarotTypes,
LetterTypes,
WesternAstrologyTypes,
} from 'kaabalah/core';
const workspace = getCanonicalTree({
system: 'kaabalah',
parts: ['westernAstrology', 'tarot'],
});
const magicianId = id(TarotTypes.TAROT_ARK_ANNU, 'The Magician');
const hebrewLetter = workspace.getCorrespondences(magicianId, {
type: LetterTypes.HEBREW_LETTER,
depth: 2,
})[0];
const planet = workspace.getCorrespondences(magicianId, {
type: WesternAstrologyTypes.PLANET,
depth: 3,
})[0];

Find all nodes of a type

import { getCanonicalTree, KaabalahTypes } from 'kaabalah/core';
const workspace = getCanonicalTree({ system: 'kaabalah' });
const allSpheres = workspace.getNodes(KaabalahTypes.SPHERE);
// Node<"sphere">[] — all 11 spheres (including Daath)

Text search across nodes

import { getCanonicalTree, TarotTypes } from 'kaabalah/core';
const workspace = getCanonicalTree({
system: 'kaabalah',
parts: ['tarot'],
});
const swordCards = workspace.findNodes({
type: TarotTypes.TAROT_ARK_ANNU,
search: 'swords',
});

Custom workspace with overlays

Use createTreeWorkspace when you need to add, remove, or annotate correspondences on top of a canonical base without mutating it.

import { createTreeWorkspace, getCanonicalTree, id, KaabalahTypes } from 'kaabalah/core';
const base = getCanonicalTree({ system: 'kaabalah' });
const workspace = createTreeWorkspace({
base,
overlays: [
{
id: 'my-overlay',
name: 'My custom correspondences',
correspondences: [
{
op: 'annotate',
left: id(KaabalahTypes.SPHERE, 'Kether'),
right: id(KaabalahTypes.SPHERE, 'Malkuth'),
metadata: { tags: ['lightning-path'] },
},
],
notes: [
{
id: 'note-1',
text: 'The crown and kingdom are mirrors of each other.',
target: { kind: 'node', nodeId: id(KaabalahTypes.SPHERE, 'Kether') },
},
],
},
],
});