Skip to main content

AI memory, cognitive upgrades, and more — 28 Gana meta-tools routing to ~90 core tools (877 total), 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

v26.0.0871 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

  • 10,578 tests passing, 0 failures
  • 871 callable tools across 843 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-26.0.3.tar.gz (3.7 MB view details)

Uploaded Source

Built Distribution

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

whitemagic-26.0.3-py3-none-any.whl (4.5 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: whitemagic-26.0.3.tar.gz
  • Upload date:
  • Size: 3.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.3

File hashes

Hashes for whitemagic-26.0.3.tar.gz
Algorithm Hash digest
SHA256 88e8218ecbab0b3f31d254f3b390298a82d569f60eb43688f3bd700a8cf7ec49
MD5 16e39fb58b95cc49a2d11d2ed15d96c8
BLAKE2b-256 e0985b6280930f4a4b9b74e82d39ee843b07c2bd3433b0cd64fcc6b606b85124

See more details on using hashes here.

File details

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

File metadata

  • Download URL: whitemagic-26.0.3-py3-none-any.whl
  • Upload date:
  • Size: 4.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.3

File hashes

Hashes for whitemagic-26.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0fe837738590811da496c152e4270e333ebac0d2d526d7af518ab4fd68de2bf0
MD5 addbbcc774a6d069fc4afcb830a87d1d
BLAKE2b-256 810aa54942eaa2c2141c011c17b6bf9933f857a0be9719712453d37ad2e281c7

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