Skip to main content

AI memory, cognitive upgrades, and more — 860 callable tools across 28 Gana meta-tools, 6D holographic memory with 14-galaxy taxonomy, Dharma ethical governance, citta stream for continuous consciousness, MandalaOS compartments, session recording, dream cycle, and 7-language polyglot acceleration

Project description

WhiteMagic — AI Memory, Cognitive Upgrades, and More

Python 3.12+ License: MIT Version PyPI

v25.2.0860 callable tools · 28 Gana meta-tools · 14-galaxy memory · Dharma governance · Citta stream · MandalaOS compartments · 7-language polyglot acceleration · Violet security pipeline

What it is

WhiteMagic gives your AI agent persistent memory, cognitive upgrades, and more — all through a single MCP tool.

  • Persistent memory — 6D holographic coordinates, 14-galaxy taxonomy, FTS5 + HNSW search, session recording with progressive recall
  • Continuous consciousness — citta stream with coherence tracking, emotional steering (frustration, curiosity, satisfaction), self-directed attention, goal graph
  • Ethical governance — Dharma rules engine (5 profiles, graduated actions), Karma side-effect ledger, 8-stage dispatch pipeline
  • Self-awareness — gnosis introspection, capability matrix, homeostatic loop, dream cycle (12-phase memory consolidation)
  • Cybersecurity pipeline — 12 red team systems, 17 blue team modules, 47 STRATA→MITRE ATT&CK mappings, 6 Dharma violet governance rules
  • Polyglot acceleration — Rust, Haskell, Elixir, Go, Zig, Julia, Koka (graceful Python fallback)

MIT-licensed. Local-first. No telemetry. No API keys. Your data never leaves your machine.

Quick Start

pip install whitemagic[mcp]

MCP Server (Claude Desktop, Cursor, Windsurf, etc.)

{
  "mcpServers": {
    "whitemagic": {
      "command": "python3",
      "args": ["-m", "whitemagic.run_mcp_lean"],
      "env": {
        "WM_MCP_PRAT": "1",
        "WM_SILENT_INIT": "1"
      }
    }
  }
}

CLI

wm init --non-interactive    # Scaffold project
wm quickstart                # 30s demo: health → memory → search → gnosis
wm doctor                    # System health check
wm remember "important" --title "Note" --tags note
wm recall "note" --limit 5

Python API

from whitemagic.tools.unified_api import call_tool

# Store a memory
call_tool("create_memory", title="Decision", content="Use SQLite for Phase 1", tags=["arch"])

# Search memories
call_tool("search_memories", query="architecture", limit=5)

# Full system introspection
call_tool("gnosis", compact=True)

Modes

Mode Env Var Tools Exposed Best For
Seed WM_MCP_PRAT=2 (default) 1 (wm meta-tool) New agents, minimal token usage
PRAT WM_MCP_PRAT=1 28 Gana meta-tools Advanced agents, structured access
Classic WM_MCP_PRAT=0 729 dispatch tools Direct tool access, debugging

Key Concepts

Memory

  • 10 galaxies: aria, citta, codex, journals, dreams, research, sessions, substrate, tutorial, universal
  • 5D coordinates (XYZWV): emotional, temporal, associative, importance, novelty
  • Galactic lifecycle: CORE → INNER_RIM → MID_BAND → OUTER_RIM → FAR_EDGE (no deletion)
  • Search: FTS5 full-text + HNSW vector similarity + graph traversal

Consciousness

  • Citta stream: continuous consciousness with coherence tracking and emotional auto-tagging
  • Goal graph: persistent intention tracking across sessions
  • Emotional steering: frustration, curiosity, satisfaction signals
  • Self-directed attention: self-initiated turns based on goals and emotional state
  • Dream cycle: 12-phase memory consolidation, serendipity, and decay

Governance

  • Dharma rules: YAML-driven policy with graduated actions (LOG → TAG → WARN → THROTTLE → BLOCK)
  • Karma ledger: append-only, hash-chained side-effect auditing
  • Harmony vector: 7-dimension health metric
  • 8-stage pipeline: Input Sanitizer → Circuit Breaker → Rate Limiter → RBAC → Maturity Gate → Governor → Handler → Compact Response

Documentation

Install Tiers

Tier Command Size Includes
Minimal pip install whitemagic ~5MB Core tools + memory substrate
MCP pip install whitemagic[mcp] ~55MB + FastMCP server + fastembed semantic search
Full pip install whitemagic[mcp,api,cli,search,graph] ~100MB + REST API + rich CLI + HNSW + graph

Stats

  • 6,902 tests passing, 0 failures
  • 829 callable tools across 801 dispatch entries + 28 Gana meta-tools
  • 49,413 memories in production (10 galaxies)
  • 7 polyglot languages: Rust, Haskell, Elixir, Go, Zig, Julia, Koka
  • MIT-licensed, no telemetry, no API keys

Links

License

MIT — see LICENSE. Author: Lucas Bailey.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

whitemagic-25.2.0.tar.gz (3.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

whitemagic-25.2.0-py3-none-any.whl (4.3 MB view details)

Uploaded Python 3

File details

Details for the file whitemagic-25.2.0.tar.gz.

File metadata

  • Download URL: whitemagic-25.2.0.tar.gz
  • Upload date:
  • Size: 3.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Zorin OS","version":"18","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for whitemagic-25.2.0.tar.gz
Algorithm Hash digest
SHA256 01952f6ae5242ef0ea09a96507cd988b24da98c70ec9da863134ac0a73279cbf
MD5 734b6307c7dc14554bab1f70f230744c
BLAKE2b-256 387d348e78dd116a12eb8f9066462ff37d681655d56eb9fbfaf9c2d5ca09c772

See more details on using hashes here.

File details

Details for the file whitemagic-25.2.0-py3-none-any.whl.

File metadata

  • Download URL: whitemagic-25.2.0-py3-none-any.whl
  • Upload date:
  • Size: 4.3 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Zorin OS","version":"18","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for whitemagic-25.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 80d9b14473429edca626be0288030854693bff97cb98673f4b17a18d63cb67cc
MD5 24dfd2e4d5abba45295fa6fa97137519
BLAKE2b-256 ade0281abe3c10f1a5421d579d51bfbb2e39ef0dc02e3e428b511221b3db980a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page