Metadata-Version: 2.4
Name: whitemagic
Version: 25.0.0
Summary: AI memory, cognitive upgrades, and more — 801 callable tools across 28 Gana meta-tools, 5D holographic memory with 10-galaxy taxonomy, Dharma ethical governance, citta stream for continuous consciousness, MandalaOS compartments, session recording, dream cycle, and 7-language polyglot acceleration
Author: WhiteMagic Contributors
License: MIT
Project-URL: Homepage, https://whitemagic.dev
Project-URL: Documentation, https://github.com/lbailey94/whitemagic/blob/main/docs/QUICKSTART.md
Project-URL: Repository, https://github.com/lbailey94/whitemagic
Project-URL: Changelog, https://github.com/lbailey94/whitemagic/blob/main/CHANGELOG.md
Project-URL: Issues, https://github.com/lbailey94/whitemagic/issues
Keywords: memory,ai,mcp,context,llm,agents,tools,governance,polyglot
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Typing :: Typed
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: click>=8.1.7
Requires-Dist: numpy>=1.24.0
Requires-Dist: pydantic<3.0.0,>=2.0.0
Requires-Dist: pyyaml>=6.0.0
Provides-Extra: embeddings
Requires-Dist: sentence-transformers>=2.2.0; extra == "embeddings"
Requires-Dist: torch<3.0.0,>=2.0.0; extra == "embeddings"
Requires-Dist: scipy>=1.10.0; extra == "embeddings"
Requires-Dist: faiss-cpu>=1.7.4; extra == "embeddings"
Provides-Extra: terminal
Provides-Extra: cli
Requires-Dist: rich>=13.0.0; extra == "cli"
Provides-Extra: tui
Requires-Dist: textual>=0.50.0; extra == "tui"
Provides-Extra: mcp
Requires-Dist: fastmcp>=0.4.1; extra == "mcp"
Requires-Dist: fastembed>=0.2.0; extra == "mcp"
Provides-Extra: api
Requires-Dist: fastapi>=0.104.0; extra == "api"
Requires-Dist: uvicorn[standard]>=0.24.0; extra == "api"
Requires-Dist: python-multipart>=0.0.6; extra == "api"
Requires-Dist: email-validator>=2.0.0; extra == "api"
Requires-Dist: httpx>=0.25.0; extra == "api"
Provides-Extra: db
Requires-Dist: sqlalchemy>=2.0.0; extra == "db"
Requires-Dist: aiosqlite>=0.19.0; extra == "db"
Requires-Dist: asyncpg>=0.29.0; extra == "db"
Requires-Dist: alembic>=1.13.0; extra == "db"
Provides-Extra: encrypt
Requires-Dist: sqlcipher3>=0.5.0; extra == "encrypt"
Provides-Extra: cache
Requires-Dist: redis>=5.0.1; extra == "cache"
Provides-Extra: net
Requires-Dist: aiohttp>=3.9.0; extra == "net"
Requires-Dist: websockets>=12.0; extra == "net"
Requires-Dist: aiofiles>=23.2.1; extra == "net"
Requires-Dist: requests>=2.31.0; extra == "net"
Requires-Dist: urllib3<3.0.0,>=2.0.0; extra == "net"
Requires-Dist: chardet>=5.0.0; extra == "net"
Provides-Extra: openai
Requires-Dist: openai>=1.3.0; extra == "openai"
Requires-Dist: tiktoken>=0.5.0; extra == "openai"
Provides-Extra: auth
Requires-Dist: passlib[bcrypt]>=1.7.4; extra == "auth"
Provides-Extra: trust
Requires-Dist: xrpl-py>=3.0.0; extra == "trust"
Requires-Dist: PyNaCl>=1.5.0; extra == "trust"
Provides-Extra: numeric
Requires-Dist: numpy>=1.24.0; extra == "numeric"
Requires-Dist: scipy>=1.10.0; extra == "numeric"
Provides-Extra: graph
Requires-Dist: networkx>=3.0; extra == "graph"
Provides-Extra: search
Requires-Dist: whitemagic[numeric]; extra == "search"
Requires-Dist: hnswlib>=0.8.0; extra == "search"
Provides-Extra: viz
Requires-Dist: whitemagic[numeric]; extra == "viz"
Requires-Dist: umap-learn>=0.5.0; extra == "viz"
Requires-Dist: scikit-learn>=1.3.0; extra == "viz"
Provides-Extra: opt
Requires-Dist: cvxpy>=1.4.0; extra == "opt"
Provides-Extra: offline
Requires-Dist: whitemagic[embeddings]; extra == "offline"
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
Requires-Dist: whitemagic[mcp]; extra == "dev"
Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
Requires-Dist: pytest-timeout>=2.2.0; extra == "dev"
Requires-Dist: pytest-xdist>=3.5.0; extra == "dev"
Requires-Dist: flaky>=3.7.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: isort>=5.13.0; extra == "dev"
Requires-Dist: mypy>=1.0.0; extra == "dev"
Requires-Dist: ruff>=0.1.6; extra == "dev"
Requires-Dist: maturin>=1.3.0; extra == "dev"
Requires-Dist: nbconvert>=7.16.6; extra == "dev"
Requires-Dist: fastmcp>=0.4.1; extra == "dev"
Provides-Extra: watcher
Requires-Dist: watchdog>=3.0.0; extra == "watcher"
Provides-Extra: vision
Requires-Dist: opencv-python>=4.8.0; extra == "vision"
Requires-Dist: pytesseract>=0.3.10; extra == "vision"
Requires-Dist: Pillow>=10.0.0; extra == "vision"
Provides-Extra: dashboard
Requires-Dist: flask>=3.0.0; extra == "dashboard"
Requires-Dist: flask-cors>=4.0.0; extra == "dashboard"
Provides-Extra: heavy
Requires-Dist: sentence-transformers>=2.2.0; extra == "heavy"
Requires-Dist: torch<3.0.0,>=2.0.0; extra == "heavy"
Requires-Dist: scipy>=1.10.0; extra == "heavy"
Requires-Dist: faiss-cpu>=1.7.4; extra == "heavy"
Requires-Dist: numpy>=1.24.0; extra == "heavy"
Requires-Dist: networkx>=3.0; extra == "heavy"
Requires-Dist: hnswlib>=0.8.0; extra == "heavy"
Requires-Dist: umap-learn>=0.5.0; extra == "heavy"
Requires-Dist: scikit-learn>=1.3.0; extra == "heavy"
Provides-Extra: langchain
Requires-Dist: langchain>=0.1.0; extra == "langchain"
Provides-Extra: crewai
Requires-Dist: crewai>=0.1.0; extra == "crewai"
Provides-Extra: autogen
Requires-Dist: autogen-agentchat>=0.2.0; extra == "autogen"
Provides-Extra: pydantic-ai
Requires-Dist: pydantic-ai>=0.0.1; extra == "pydantic-ai"
Provides-Extra: adapters
Requires-Dist: langchain>=0.1.0; extra == "adapters"
Requires-Dist: crewai>=0.1.0; extra == "adapters"
Provides-Extra: lite
Requires-Dist: click>=8.1.7; extra == "lite"
Requires-Dist: pydantic<3.0.0,>=2.0.0; extra == "lite"
Requires-Dist: pyyaml>=6.0.0; extra == "lite"
Requires-Dist: fastmcp>=0.4.1; extra == "lite"
Requires-Dist: rich>=13.0.0; extra == "lite"
Provides-Extra: core
Requires-Dist: click>=8.1.7; extra == "core"
Requires-Dist: pydantic<3.0.0,>=2.0.0; extra == "core"
Requires-Dist: pyyaml>=6.0.0; extra == "core"
Requires-Dist: fastmcp>=0.4.1; extra == "core"
Requires-Dist: rich>=13.0.0; extra == "core"
Requires-Dist: sqlalchemy>=2.0.0; extra == "core"
Requires-Dist: aiosqlite>=0.19.0; extra == "core"
Requires-Dist: asyncpg>=0.29.0; extra == "core"
Requires-Dist: alembic>=1.13.0; extra == "core"
Requires-Dist: aiohttp>=3.9.0; extra == "core"
Requires-Dist: websockets>=12.0; extra == "core"
Requires-Dist: aiofiles>=23.2.1; extra == "core"
Requires-Dist: requests>=2.31.0; extra == "core"
Requires-Dist: urllib3<3.0.0,>=2.0.0; extra == "core"
Requires-Dist: chardet>=5.0.0; extra == "core"
Requires-Dist: passlib[bcrypt]>=1.7.4; extra == "core"
Requires-Dist: xrpl-py>=3.0.0; extra == "core"
Requires-Dist: PyNaCl>=1.5.0; extra == "core"
Provides-Extra: heavy-tier
Requires-Dist: click>=8.1.7; extra == "heavy-tier"
Requires-Dist: pydantic<3.0.0,>=2.0.0; extra == "heavy-tier"
Requires-Dist: pyyaml>=6.0.0; extra == "heavy-tier"
Requires-Dist: fastmcp>=0.4.1; extra == "heavy-tier"
Requires-Dist: rich>=13.0.0; extra == "heavy-tier"
Requires-Dist: sqlalchemy>=2.0.0; extra == "heavy-tier"
Requires-Dist: aiosqlite>=0.19.0; extra == "heavy-tier"
Requires-Dist: asyncpg>=0.29.0; extra == "heavy-tier"
Requires-Dist: alembic>=1.13.0; extra == "heavy-tier"
Requires-Dist: aiohttp>=3.9.0; extra == "heavy-tier"
Requires-Dist: websockets>=12.0; extra == "heavy-tier"
Requires-Dist: aiofiles>=23.2.1; extra == "heavy-tier"
Requires-Dist: requests>=2.31.0; extra == "heavy-tier"
Requires-Dist: urllib3<3.0.0,>=2.0.0; extra == "heavy-tier"
Requires-Dist: chardet>=5.0.0; extra == "heavy-tier"
Requires-Dist: passlib[bcrypt]>=1.7.4; extra == "heavy-tier"
Requires-Dist: xrpl-py>=3.0.0; extra == "heavy-tier"
Requires-Dist: PyNaCl>=1.5.0; extra == "heavy-tier"
Requires-Dist: sentence-transformers>=2.2.0; extra == "heavy-tier"
Requires-Dist: torch<3.0.0,>=2.0.0; extra == "heavy-tier"
Requires-Dist: scipy>=1.10.0; extra == "heavy-tier"
Requires-Dist: faiss-cpu>=1.7.4; extra == "heavy-tier"
Requires-Dist: numpy>=1.24.0; extra == "heavy-tier"
Requires-Dist: networkx>=3.0; extra == "heavy-tier"
Requires-Dist: hnswlib>=0.8.0; extra == "heavy-tier"
Requires-Dist: umap-learn>=0.5.0; extra == "heavy-tier"
Requires-Dist: scikit-learn>=1.3.0; extra == "heavy-tier"
Provides-Extra: full
Requires-Dist: aiosqlite>=0.19.0; extra == "full"
Requires-Dist: aiofiles>=23.2.1; extra == "full"
Requires-Dist: aiohttp>=3.9.0; extra == "full"
Requires-Dist: alembic>=1.13.0; extra == "full"
Requires-Dist: asyncpg>=0.29.0; extra == "full"
Requires-Dist: black>=23.0.0; extra == "full"
Requires-Dist: chardet>=5.0.0; extra == "full"
Requires-Dist: cvxpy>=1.4.0; extra == "full"
Requires-Dist: email-validator>=2.0.0; extra == "full"
Requires-Dist: faiss-cpu>=1.7.4; extra == "full"
Requires-Dist: fastapi>=0.104.0; extra == "full"
Requires-Dist: fastmcp>=0.4.1; extra == "full"
Requires-Dist: flask>=3.0.0; extra == "full"
Requires-Dist: flask-cors>=4.0.0; extra == "full"
Requires-Dist: httpx>=0.25.0; extra == "full"
Requires-Dist: isort>=5.13.0; extra == "full"
Requires-Dist: maturin>=1.3.0; extra == "full"
Requires-Dist: mypy>=1.0.0; extra == "full"
Requires-Dist: nbconvert>=7.16.6; extra == "full"
Requires-Dist: numpy>=1.24.0; extra == "full"
Requires-Dist: opencv-python>=4.8.0; extra == "full"
Requires-Dist: openai>=1.3.0; extra == "full"
Requires-Dist: passlib[bcrypt]>=1.7.4; extra == "full"
Requires-Dist: Pillow>=10.0.0; extra == "full"
Requires-Dist: pytest>=7.0.0; extra == "full"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "full"
Requires-Dist: pytest-cov>=4.1.0; extra == "full"
Requires-Dist: pytest-timeout>=2.2.0; extra == "full"
Requires-Dist: pytesseract>=0.3.10; extra == "full"
Requires-Dist: redis>=5.0.1; extra == "full"
Requires-Dist: requests>=2.31.0; extra == "full"
Requires-Dist: rich>=13.0.0; extra == "full"
Requires-Dist: ruff>=0.1.6; extra == "full"
Requires-Dist: scipy>=1.10.0; extra == "full"
Requires-Dist: sentence-transformers>=2.2.0; extra == "full"
Requires-Dist: sqlalchemy>=2.0.0; extra == "full"
Requires-Dist: textual>=0.50.0; extra == "full"
Requires-Dist: tiktoken>=0.5.0; extra == "full"
Requires-Dist: torch<3.0.0,>=2.0.0; extra == "full"
Requires-Dist: urllib3<3.0.0,>=2.0.0; extra == "full"
Requires-Dist: uvicorn[standard]>=0.24.0; extra == "full"
Requires-Dist: watchdog>=3.0.0; extra == "full"
Requires-Dist: websockets>=12.0; extra == "full"
Requires-Dist: python-multipart>=0.0.6; extra == "full"
Requires-Dist: networkx>=3.0; extra == "full"
Requires-Dist: hnswlib>=0.8.0; extra == "full"
Requires-Dist: umap-learn>=0.5.0; extra == "full"
Requires-Dist: scikit-learn>=1.3.0; extra == "full"

# WhiteMagic — AI Memory, Cognitive Upgrades, and More

[![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
[![Version](https://img.shields.io/badge/version-25.0.0-purple.svg)](core/VERSION)
[![PyPI](https://img.shields.io/pypi/v/whitemagic)](https://pypi.org/project/whitemagic/)

**v25.0.0** — **829 callable tools** · **28 Gana meta-tools** · **10-galaxy memory** · **Dharma governance** · **Citta stream** · **MandalaOS compartments** · **7-language polyglot acceleration**

## What it is

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

- **Persistent memory** — 5D holographic coordinates, 10-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 (3 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)
- **Polyglot acceleration** — Rust, Haskell, Elixir, Go, Zig, Julia (graceful Python fallback)

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

## Quick Start

```bash
pip install whitemagic[mcp]
```

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

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

### CLI

```bash
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

```python
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

- [AI Primary Spec](AI_PRIMARY.md) — authoritative contract for AI agents
- [Quickstart Guide](QUICKSTART.md) — 5-minute setup
- [System Map](SYSTEM_MAP.md) — architecture overview
- [MCP Config Examples](docs/guides/MCP_CONFIG_EXAMPLES.md) — all MCP clients
- [llms.txt](llms.txt) — machine-readable context for LLMs

## 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

- [GitHub](https://github.com/lbailey94/whitemagic) — source
- [PyPI](https://pypi.org/project/whitemagic/) — install
- [Website](https://whitemagic.dev) — discovery surface
- [llms.txt](https://whitemagic.dev/llms.txt) — LLM context
- [Agent Card](https://whitemagic.dev/.well-known/agent.json) — A2A v1.2

## License

MIT — see [LICENSE](LICENSE). Author: Lucas Bailey.
