Engineering

Production infrastructure we build and contribute back to the open-source community.

PR #1999 2026-07-12 MIT

Hardening MemPalace for Enterprise-Grade Execution

MemPalace is an open-source AI memory system with 57K+ GitHub stars, 96.6% R@5 on LongMemEval, and a local-first architecture inspired by the ancient method of loci. Co-created by Milla Jovovich and Ben Sigman.

We run it as the memory layer for our agent infrastructure — 425,000 drawers, 7,800+ knowledge graph triples, hammered continuously by AI agents doing real execution work. The retrieval engine is excellent. The operational layer for production deployments didn't exist. So we built it and contributed it upstream.

1,513

Lines contributed

425K

Drawers in production

4s

Recovery from kill

36

MCP tools proxied

What we shipped

proxy Streamable-HTTP bridge with connection pooling, circuit breaker, retry logic
watchdog Auto-restart for hangs (process alive but not responding to JSON-RPC)
monitor Proactive health checks with desktop notifications and auto-remediation
deploy launchd plist + systemd units for macOS and Linux
tests 8 tests covering circuit breaker, session management, config, no-hardcoded-paths

Architecture

MCP Client (Claude/Devin/etc.)
    │
    │  streamable-HTTP (POST/GET/DELETE /mcp)
    │  Mcp-Session-Id, text/event-stream
    ▼
┌──────────────────────┐
│   MCP Proxy (:8766)  │
│  ┌────────────────┐  │
│  │ Circuit Breaker│  │
│  │ Retry w/ backoff│ │
│  │ Session Mgmt   │  │
│  │ /health        │  │
│  │ /metrics       │  │
│  └───────┬────────┘  │
│          │           │
│  pooled httpx client │
└──────────┼───────────┘
           │
           │  plain JSON HTTP (POST /mcp)
           │  Connection: close
           ▼
┌──────────────────────┐
│  MemPalace (:8765)   │
│  BaseHTTPRequestHandler│
│  ChromaDB / Qdrant   │
└──────────────────────┘

How We Build Infrastructure

No telemetry

Local-first by architecture. No phone-home, no analytics, no external service dependencies. Prometheus-style metrics are local-only — you scrape if you want it.

Fail fast, recover automatically

Circuit breakers prevent cascading failures. Watchdogs detect hangs, not just crashes. 4-second recovery from process kill to fully responsive.

Contribute back

We stand on the shoulders of people who built the foundation. When we harden open-source infrastructure for production, we contribute it upstream.

Same architecture, different domain

The same hardening patterns — circuit breakers, connection pooling, auto-restart watchdogs — drive the high-throughput routing engine at Orkid Labs. Audit-ready intelligence for operators, funds, and government contractors.

LLM Resource Index llms.txt