# Mempalace Ts

> Local AI memory system for Claude Code, ChatGPT, and any MCP-compatible tool. TypeScript port of https://github.com/milla-jovovich/mempalace

- **Type:** MCP server
- **Install:** `agentstack add mcp-vlaushkin-mempalace-ts`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [vlaushkin](https://agentstack.voostack.com/s/vlaushkin)
- **Installs:** 0
- **Category:** [Databases](https://agentstack.voostack.com/c/databases)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [vlaushkin](https://github.com/vlaushkin)
- **Source:** https://github.com/vlaushkin/mempalace.ts

## Install

```sh
agentstack add mcp-vlaushkin-mempalace-ts
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# MemPalace.ts

Local AI memory system for Claude Code, ChatGPT, and any MCP-compatible tool.

TypeScript rewrite of [MemPalace](https://github.com/milla-jovovich/mempalace) ([`87102fb`](https://github.com/milla-jovovich/mempalace/commit/87102fb188abfd775ef21b8e370a731ffac00cbf)). Native ONNX Runtime for embeddings — **~2× faster mining on Apple Silicon** than the Python reference on the same corpus.

[![][version-shield]][release-link]
[![][node-shield]][node-link]
[![][license-shield]][license-link]

---

## Why TypeScript

| | Python | TypeScript |
|---|---|---|
| Vector DB | ChromaDB (~500ms startup) | **sqlite-vec (~15ms startup)** |
| Embeddings runtime | PyTorch CPU | **ONNX Runtime (Apple Silicon native)** |
| Mining speed | baseline | **~2× faster** (measured on identical corpus) |
| Search | Semantic + closet boost + hybrid keyword | Same (parity) |
| Cross-lingual | 100+ languages via e5-small | Same (parity) |
| LLM rerank | Haiku only | **Any OpenAI-compatible API** |
| Localization | 13 locales | 9 locales (EN, RU, DE, FR, ES, IT, PT-BR, HI, ID) |
| Dependencies | Python + chromadb + sentence-transformers | **Node.js only** |
| Tests | 92 | **663** |

## Quick Start

```bash
npm install @vlaushkin/mempalace-ts

mempalace init ~/projects/myapp
mempalace mine ~/projects/myapp
mempalace search "why did we switch to GraphQL"
```

## MCP Server

```bash
claude mcp add mempalace -- node dist/mcp/server.js
```

26 tools: `mempalace_search`, `mempalace_add_drawer`, `mempalace_kg_query`, `mempalace_diary_write`, `mempalace_create_tunnel`, `mempalace_get_drawer`, `mempalace_ping`, and [19 more](src/mcp/tools.ts).

## Multilingual Search

```json
{ "multilingual": true }
```

Dual-index architecture: English queries use `all-MiniLM-L6-v2`, non-English queries auto-route to `multilingual-e5-small` (100+ languages). Both indexes updated in one transaction.

```
EN "machine learning"    RU "машинное обучение"    -> 0.95
EN "git hooks setup"     DE "git hooks einrichten" -> 0.91
```

## All Commands

```bash
mempalace init                     # detect rooms, create config
mempalace mine                     # mine project files (closets + halls auto-tagged)
mempalace mine  --mode convos      # mine conversation exports
mempalace search "query"                # hybrid semantic + closet-boosted search
mempalace search "query" --rerank       # + LLM rerank (any OpenAI-compatible API)
mempalace sweep               # message-granular safety net for Claude Code JSONL
mempalace diary-ingest             # ingest YYYY-MM-DD.md daily summaries
mempalace export --format jsonl         # dump palace (json/jsonl/markdown)
mempalace wake-up                       # load L0 + L1 context
mempalace compress --wing myapp         # AAAK compression
mempalace status                        # palace overview
mempalace migrate export/import/verify  # ChromaDB -> sqlite-vec
```

## Development

```bash
npm install
npm run build          # tsup -> dist/
npm run test           # vitest (663 tests)
npm run lint           # biome check
npm run typecheck      # tsc --noEmit
```

## Benchmarks

On the 500-question LongMemEval retrieval benchmark, the default search pipeline achieves **R@5 = 98.0%, NDCG@5 = 0.932**. On cross-lingual retrieval (Russian queries, English documents), multilingual-e5-small reaches **R@5 = 89.0%**. Reproduction instructions in [benchmarks/](benchmarks/).

## License

MIT -- see [LICENSE](LICENSE).

[version-shield]: https://img.shields.io/badge/version-1.2.0-4dc9f6?style=flat-square&labelColor=0a0e14
[release-link]: https://github.com/vlaushkin/mempalace.ts/releases
[node-shield]: https://img.shields.io/badge/node-22+-7dd8f8?style=flat-square&labelColor=0a0e14&logo=node.js&logoColor=7dd8f8
[node-link]: https://nodejs.org/
[license-shield]: https://img.shields.io/badge/license-MIT-b0e8ff?style=flat-square&labelColor=0a0e14
[license-link]: https://github.com/vlaushkin/mempalace.ts/blob/main/LICENSE

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [vlaushkin](https://github.com/vlaushkin)
- **Source:** [vlaushkin/mempalace.ts](https://github.com/vlaushkin/mempalace.ts)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-vlaushkin-mempalace-ts
- Seller: https://agentstack.voostack.com/s/vlaushkin
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
