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): TreeOfLifeCreates 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 partsconst tree = createTree({ system: 'kaabalah', parts: ['westernAstrology', 'tarot'],});TreeOptions
| Field | Type | Description |
|---|---|---|
system | SystemKey | Which system to load (required) |
parts | PartKey[] (optional) | Additional parts to load on top of the base system |
Available systems (SystemKey)
| Value | Description |
|---|---|
"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 key | Adds |
|---|---|
"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): TreeWorkspaceReturns 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): TreeTopologyReturns 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 -> Malkuthserpent 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 | undefinedtopology.getPaths(): TreeTopologyPath[]topology.getPath(lookup: TreeTopologyPathLookup): TreeTopologyPath | undefinedtopology.getPathBetween(first, second): TreeTopologyPath | undefinedtopology.getAdjacentSpheres(sphere): TreeTopologyAdjacentSphere[]topology.getRoutes(): TreeTopologyRoute[]topology.getRoute('lightning' | 'serpent'): TreeTopologyRoute | undefinedtopology.nextInRoute(route, sphere): TreeTopologySphere | undefinedtopology.previousInRoute(route, sphere): TreeTopologySphere | undefinedPath 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 NodeIdworkspace.getNode<T extends NodeType>(id: NodeId<T>): Node<T> | undefined
// Check existenceworkspace.hasNode(id: NodeId<NodeType>): boolean
// Get all nodes, optionally filtered by typeworkspace.getNodes<T extends NodeType>(type?: T): Node<T>[]
// Search nodes by type, id list, text search, or predicateworkspace.findNodes<T extends NodeType>(options?: TreeFindNodesOptions<T>): Node<T>[]TreeFindNodesOptions fields:
| Field | Type | Description |
|---|---|---|
type | T | readonly T[] (optional) | Filter to one or more node types |
ids | readonly NodeId<T>[] (optional) | Filter to specific node IDs |
search | string (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 nodeworkspace.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:
| Field | Type | Default | Description |
|---|---|---|---|
type | U | readonly U[] (optional) | — | Filter results to these node type(s) |
depth | number (optional) | 1 | BFS depth (hops from source node) |
includeSelf | boolean (optional) | false | Include the source node itself in results |
limit | number (optional) | Infinity | Max 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'>): CorrespondenceMapReturns 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 hasgetTreeNodeDescriptions 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 casegeburah.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 PortugueselistSphereProfiles(); // all eleven, in the Tree's orderThe profile has two groups of fields.
| Group | Fields |
|---|---|
| Plain words | essence, keywords, work (what is worked in the sphere when one walks the Tree), expression (balanced, excess, lack) |
| Correspondences | nameMeaning, 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:
expressionis 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,metalsanddrugs.
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, HodgetTreeSection('supernal', 'pt-BR'); // short form of 'triad:supernal', in PortugueselistTreeSections({ kind: 'world' }); // Atziluth, Briah, Yetzirah, Assiah
const { world, pillar, triad } = getSphereSections('Geburah');// world.id 'world:Briah', pillar.id 'pillar:left', triad.id 'triad:second'| Kind | IDs | correspondences keys |
|---|---|---|
world | world:Atziluth, world:Briah, world:Yetzirah, world:Assiah | letter, element, suit, hierarchy, verb, mind, level |
pillar | pillar:right, pillar:left, pillar:middle | polarity, movement, name |
triad | triad:supernal, triad:second, triad:third | orientation, functions |
Every section has id, kind, name, title, spheres, essence, keywords, description and correspondences.
levelis 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.
getSphereSectionsreturnsnullfor 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 PortugueselistPathProfiles(); // all 22, in ordergetSpherePathProfiles('Geburah'); // the paths that touch a sphere| Group | Fields |
|---|---|
| Read from the Tree | number, from, to, meaning, hebrewLetter, tarotCard, correspondence (its element, planet or sign) |
| Plain words | essence, keywords, letterQuality, keyPhrase, affirmation, misuse, dailyUse |
| Practice | mantras, 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:
| Method | Description |
|---|---|
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 |
activeSystem | The currently loaded SystemKey |
availableParts | All parts that can be loaded |
loadedParts | Parts 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 value | String value | Description |
|---|---|---|
KaabalahTypes.SPHERE | "sphere" | Sephirah (e.g. Kether) |
KaabalahTypes.PATH | "path" | Path between two spheres |
KaabalahTypes.WORLD | "world" | One of the Four Worlds |
WesternAstrologyTypes
| Enum value | String value |
|---|---|
WesternAstrologyTypes.PLANET | "planet" |
WesternAstrologyTypes.WESTERN_ZODIAC_SIGN | "westernZodiacSign" |
WesternAstrologyTypes.WESTERN_ELEMENT | "westernElement" |
WesternAstrologyTypes.HOUSE | "house" |
WesternAstrologyTypes.ASPECT | "aspect" |
WesternAstrologyTypes.MODALITIES | "modalities" |
TarotTypes
| Enum value | String value |
|---|---|
TarotTypes.TAROT_ARK_ANNU | "tarotArkAnnu" |
TarotTypes.TAROT_SUIT | "tarotSuit" |
LetterTypes
| Enum value | String value |
|---|---|
LetterTypes.HEBREW_LETTER | "hebrewLetter" |
LetterTypes.LATIN_LETTER | "latinLetter" |
LetterTypes.SANSKRIT_LETTER | "sanskritLetter" |
LetterTypes.VATTAN_LETTER | "vattanLetter" |
NumerologyTypes
| Enum value | String value |
|---|---|
NumerologyTypes.NUMBER | "number" |
MiscTypes
| Enum value | String 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 namesSPHERES.KETHER // "Kether"SPHERES.TIPHARETH // "Tiphareth"SPHERES.MALKUTH // "Malkuth"// ... Chokhmah, Binah, Daath, Chesed, Geburah, Netzach, Hod, Yesod
// SPHERES_DATA: contains hebrewSpelling and englishName per sphereSPHERES_DATA.KETHER // { hebrewSpelling: "כתר", englishName: "Crown" }Paths
import { MELKITZEDEKI_PATHS } from 'kaabalah/core';
// 22 paths numbered 1–22MELKITZEDEKI_PATHS.KETHER_CHOKHMAH // 1MELKITZEDEKI_PATHS.YESOD_MALKUTH // 22Hebrew 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 deepconst tarotCards = workspace.getCorrespondences(tipharethId, { type: TarotTypes.TAROT_ARK_ANNU, depth: 2,});
// Grouped by typeconst 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') }, }, ], }, ],});