# Repository Briefing: christopherkarani/Wax
> Source: https://repoforai.com/repo/christopherkarani/Wax (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/christopherkarani/Wax
- **Category**: RAG, Data & Memory (知识库 / 爬虫 / 记忆层)
- **Primary Language**: Swift
- **License**: Apache-2.0
- **Engineering Health**: A+ (88/100 · Maintenance 35/35 · Adoption 13/25 · Releases 20/20 · License 20/20)
- **Latest Release**: waxmcp-v0.1.51 (2026-11-19) — https://github.com/christopherkarani/Wax/releases
- **Review Snapshot**: 2026-12-03
- **Deployment / Stack Signals**: Self-Hosted, Local AI, MCP
- **Momentum**: 816 ★ total (+0 24h / +0 7d) · 56 forks
- **Topics**: `ai-agents`, `cli`, `coreml`, `coreml-framework`, `data-science`, `machine-learning`, `mcp`, `mcp-server`, `memory`, `memory-cache`, `memory-hacking`, `metal`
- **When to Use**: Best for: Apple Silicon teams sharing durable memory across local agent hosts, or iOS and macOS apps embedding hybrid retrieval without a hosted database. Skip if: You need a managed multi-machine backend, concurrent writes across machines, or a temporal knowledge graph.

## Overview
```text
### Architecture & Core Mechanics
Wax is an embedded Swift retrieval engine. One `.wax` binary contains dual header pages with generation numbers, pointers, and checksums; a write-ahead log (WAL) ring for recovering uncommitted mutations after a crash; LZ4-compressed data frames; search indexes; and a table of contents. SQLite FTS5 handles text search, and CoreML generates local embeddings. Vector search is exact via Accelerate/CPU below 10,000 indexed vectors and uses Metal-accelerated HNSW at or above that threshold.

Swift apps open the store directly through `Memory(at:)`. Agent hosts use MCP, with stdio for a single client or a shared loopback HTTP writer for multiple clients. Identically configured MCP servers share a broker; a second process with a conflicting configuration fails fast. Hermes uses a native memory provider that owns session lifecycle rather than relying on the MCP session loop.

### Key Capabilities & Differentiators
`remember` writes memory without a cloud LLM extraction step; `recall` retrieves it through hybrid text and vector search, and `stats` exposes store status. New stores use e5-small-v2 by default; existing stores can reopen with the built-in embedder that wrote them, including MiniLM. Until the embedder attaches, hybrid queries return text results and `vectorOnly` throws. Foundation Models integration can inject recalled context into prompts, register memory tools, and write conversation turns back.

The March 6, 2026 Apple Silicon sweep measured hybrid recall at 6.1 ms p95 and 6.5 ms p99, with cold store open at 9.2 ms p95. Cold open measures only opening the store, not first embedding or an end-to-end agent turn. The experimental `PhotoMemory` and `VideoMemory` interfaces support OCR, keyframes, and host-supplied transcripts; `VideoMemory` does not store the video bytes.

### Trade-offs & Limitations
Wax gives you searchable cross-session memory without hand-curating a Markdown scratchpad. Compared with Pinecone, it removes the hosted vector database from the retrieval path, but leaves you responsible for file backup, access, and the local writer process if you use MCP. The single file is easy to move; portable files and a shared local broker are not substitutes for concurrent multi-machine writes or a managed service.

Flat search avoids approximate nearest-neighbor errors for smaller stores, but its query work grows with the vector count. HNSW changes that cost profile while making vector retrieval approximate. Test ranking quality as well as latency around the 10,000-vector boundary. Wax is not a temporal knowledge graph, and local storage does not mean end-to-end offline operation if the host sends retrieved context to a cloud model.

### Hardware & Deployment Guide
On Apple Silicon, `npx -y waxmcp@latest install` stages the MCP server, local embedders, and operator skill. For multiple clients, point them at `http://127.0.0.1:3000/mcp` and keep one server running with the provided start script or the `ai.wax.mcp-http` LaunchAgent. Configure when the host should write and recall memory in its always-loaded rules, then verify the setup with `doctor` and `vector-health`.

An iOS or macOS app can embed Wax as a Swift package without a separate process. Automatic on-device embeddings require iOS 18 or macOS 15 and later; Foundation Models integration requires iOS 26 or macOS 26 plus Apple Intelligence and an available system model. Release `waxmcp-v0.1.48` fixed socket cleanup when HTTP clients dropped SSE streams; `waxmcp-v0.1.51` hardened WAL ring integrity and gated releases on tests with a pinned toolchain and dependencies.
```

## Key Capabilities
```text
- Storage: One `.wax` binary holds documents, metadata, an FTS5 index, a vector index, a table of contents, and a crash-recovery WAL ring.
- Vector indexing: Exact Accelerate/CPU search below 10,000 vectors; Metal-accelerated HNSW at 10,000 or more.
- Embeddings: CoreML-backed e5-small-v2 for new stores; the SDK selects the matching built-in embedder for existing stores that used one.
- Agent integration: MCP exposes `remember`, `recall`, and `stats`; Hermes uses a native provider for handoffs and turn sync.
- Apple integration: The Swift SDK works without MCP; Foundation Models on iOS 26 and macOS 26 can retrieve prompt context and call memory tools.
- Measured latency: The March 2026 Apple Silicon sweep measured 6.1 ms hybrid recall p95, 6.5 ms p99, and 9.2 ms store-open p95.
```

## Quick Start / Clone
```bash
npx -y waxmcp@latest install
```
