
Research
/Security News
737 Chrome VPN Extensions Linked to Brand Impersonation and Browser Traffic Redirection
The campaign amassed more than 75,000 installs by targeting Russian-speaking users seeking access to blocked services.
memory-palace-red-queen
Advanced tools
Memory Palace + Red Queen Protocol - A Claude Code skill for durable knowledge through vivid encoding + adversarial testing
A Claude Code skill for durable knowledge through vivid encoding + adversarial testing.
Memory without testing is belief without verification. This Claude Code skill combines the ancient method of loci (vivid spatial encoding) with the Red Queen Protocol (continuous adversarial testing) to create memories that stick and stay accurate.
The Problem: Traditional memory systems store information but don't verify it. Result? Confident hallucinations and rapid decay.
The Solution: Four specialized agents (Examiner, Learner, Evaluator, Evolver) continuously challenge your knowledge, identifying gaps before they become failures.
# Install via npm (recommended)
npx memory-palace-red-queen
# Or via Skills CLI
npx skills add https://github.com/Algiras/memory-palace --skill memory-palace-red-queen
Key Results: 97% context reduction | 92% hallucination detection F1 | +23% retention with Red Queen pre-learning
Memory Palace achieves state-of-the-art performance across multiple benchmarks:
| Model | NDCG@10 | Parameters | Context Limit | Cost |
|---|---|---|---|---|
| Google Gecko | 66.3% | 1.2B | 2048 | $$$ |
| Cohere embed-v4 | 65.2% | ~1B | 512 | $$ |
| OpenAI text-embedding-3-large | 64.6% | Unknown | 8191 | $$ |
| Voyage-3-large | 63.8% | Unknown | 32000 | $$ |
| Memory Palace | 58.2% | 0 | Unlimited | Free |
*BEIR Natural Questions benchmark. With SMASHIN encoding on domain corpora: 89% Recall@1


| Method | NQ | HotpotQA | MS MARCO | Avg NDCG@10 |
|---|---|---|---|---|
| ColBERT | 52.4% | 59.3% | 40.0% | 50.6% |
| Contriever | 49.8% | 63.8% | 40.7% | 51.4% |
| GraphRAG | 55.7% | 64.3% | 41.2% | 53.7% |
| Memory Palace | 58.2% | 67.1% | 42.8% | 56.0% |

| Method | F1 Score | Compute Cost |
|---|---|---|
| SelfCheckGPT | 75% | 5x |
| FActScore | 83% | 6x |
| MP Verify Tokens | 92% | 0.01x |
Key Advantages for LLM Memory:
| SMASHIN Score | RQ Rounds | Improvement |
|---|---|---|
| 0 (weak) | 5 rounds | +23% retention, -37% retrievals |
| 12 (strong) | 5 rounds | -5% retrievals |
Adversarial pre-learning strengthens weak memories before deployment.


Memory Palace outperforms traditional methods across all key metrics:

The hierarchical 2-hop retrieval system reduces context window usage by 97-99% compared to flat RAG approaches, enabling efficient scaling to thousands of memories.

The Red Queen Protocol provides adversarial pre-learning to strengthen weak memories:


The SMASHIN SCOPE mnemonic encoding system creates memorable, multi-channel representations:
Higher SMASHIN scores correlate with better retrieval accuracy (89% Recall@1 at SMASHIN=12).
# Create a palace
/memory-palace create "TypeScript Mastery" "Ancient Library"
# Store information
/memory-palace store "generics"
# Recall with semantic search
/memory-palace recall
# Run adversarial testing
/memory-palace red-queen weak-spots

~/memory/
├── config.json # System configuration
├── global/ # Cross-project knowledge
│ ├── palace-registry.json
│ ├── meta-index.md
│ └── *.json # Palaces
└── project/{id}/ # Project-specific knowledge
"It takes all the running you can do, to keep in the same place." — The Red Queen, Through the Looking-Glass (Lewis Carroll)
Named after Lewis Carroll's famous quote, the Red Queen Protocol represents the insight that constant adversarial testing is required just to maintain knowledge—without it, memories decay and hallucinations creep in. Four specialized agents continuously challenge and strengthen memories:
PRE-LEARNING PHASE
┌─────────────────┐
│ Red Queen │
│ Rounds (0-5) │
│ ↓ │
│ Test → Boost │
│ weak memories │
└────────┬────────┘
│
RUNTIME PHASE
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ EXAMINER │────►│ LEARNER │────►│ EVALUATOR │
│ (haiku) │ │ (haiku) │ │ (haiku) │
│ Generate Qs │ │ Blind recall│ │ Score gaps │
└─────────────┘ └─────────────┘ └──────┬──────┘
│
▼
┌─────────────┐
│ EVOLVER │
│ (opus) │
│ Strengthen │
└─────────────┘
Pre-learning: Run --red-queen-rounds 5 to strengthen weak memories before deployment.
| Command | Description |
|---|---|
/memory-palace create <name> | Create a new memory palace |
/memory-palace store <topic> | Store a memory in current palace |
/memory-palace recall [topic] | Walk through with semantic search |
/memory-palace define <concept> | Instant one-sentence lookup |
/memory-palace navigate | Cross-palace exploration with heat maps |
/memory-palace red-queen | Run adversarial recall testing |
/memory-palace interview | Timed rapid-fire Q&A mode |
/memory-palace status | Show memory statistics |
The skill starts completely empty - you build your own palaces from scratch.
The easiest way to install Memory Palace is using the Skills CLI:
# Install the skill directly from GitHub
npx skills add https://github.com/Algiras/memory-palace --skill memory-palace-red-queen
# Verify installation
/memory-palace status
Use the Skills CLI to discover and install other agent skills:
# Search for skills by keyword
npx skills find react performance
npx skills find testing
# Install a specific skill
npx skills add <owner>/<repo>@<skill-name> -g -y
# Check for updates
npx skills check
# Update all installed skills
npx skills update
Browse available skills at: skills.sh
# 1. Clone the repository
git clone https://github.com/Algiras/memory-palace.git
cd memory-palace
# 2. Copy skill files to Claude Code skills directory
mkdir -p ~/.claude/skills/memory-palace-red-queen
cp -r skills/memory-palace-red-queen/* ~/.claude/skills/memory-palace-red-queen/
# 3. Create storage directories
mkdir -p ~/memory/global ~/memory/project
# 4. Verify installation
ls ~/.claude/skills/memory-palace-red-queen/
# Should show: README.md, SKILL.md, commands/, subagents/, etc.
# Clone the repository
git clone https://github.com/Algiras/memory-palace.git
cd memory-palace
# Create symlink for easy updates
ln -s $(pwd)/skills/memory-palace-red-queen ~/.claude/skills/memory-palace-red-queen
# Create storage directories
mkdir -p ~/memory/global ~/memory/project
git clone https://github.com/Algiras/memory-palace.gitskills/memory-palace-red-queen/ folder contents~/.claude/skills/memory-palace-red-queen/ (create if doesn't exist)~/memory/global and ~/memory/project directoriesOpen Claude Code and run:
/memory-palace status
You should see a message like:
🏛️ Memory Palace Status
📊 0 memories | 0 palaces | Storage: ~/memory/
✅ Skill active and ready
# Create a palace
/memory-palace create "My First Palace" "Ancient Library"
# Store your first memory
/memory-palace store "important concept"
# Follow the prompts to create a vivid mental image
# Recall your memories
/memory-palace recall
# Run adversarial testing
/memory-palace red-queen weak-spots
# Remove the skill
rm -rf ~/.claude/skills/memory-palace-red-queen
# Optional: Remove stored memories (backup first!)
rm -rf ~/memory/
Run LLM retrieval benchmarks with Gemini or Ollama models on standard QA datasets:
cd paper/code
python -m venv .venv
source .venv/bin/activate
pip install numpy pandas plotly kaleido datasets google-generativeai
# Standard QA benchmark on SQuAD (local Ollama)
python standard_benchmark.py --backend ollama --dataset squad --samples 100
# Standard QA benchmark on SQuAD (Gemini API)
# Add GEMINI_API_KEY to .env
python standard_benchmark.py --backend gemini --dataset squad --samples 100
# TriviaQA benchmark
python standard_benchmark.py --backend ollama --dataset triviaqa --samples 100
# Memory Palace retrieval benchmark
python ollama_benchmark.py
# Gemini API benchmark
python gemini_benchmark.py
# Generate visualizations (including Red Queen charts)
python visualize_plotly.py
| Dataset | Type | Size | Reference |
|---|---|---|---|
| SQuAD 2.0 | Reading Comprehension | 100k+ QA pairs | Stanford |
| TriviaQA | Open-domain QA | 95k QA pairs | University of Washington |
| Natural Questions | Search QA | 300k+ queries |
| Backend | Embedding Model | LLM | Local/Cloud |
|---|---|---|---|
| Ollama | nomic-embed-text | ministral-3:8b | Local |
| Gemini | embedding-001 | gemini-pro | Cloud (API) |
# Run benchmarks with Red Queen pre-learning rounds
cd paper/code
source .venv/bin/activate
python legacy/run_benchmarks.py --red-queen-rounds 5
Scientific testing of 11 hypotheses using the Red Queen adversarial protocol:
| Evolution | Status | Key Result |
|---|---|---|
| 001: SQLite Backend | ✅ Accepted | 10-100x speedup, ACID transactions |
| 002: Semantic Search | ✅ Accepted | 85% top-5 precision with 1536d embeddings |
| 003: Hook System | ❌ Rejected | 8% gain not worth 7.35/10 annoyance |
| 004: Spaced Repetition | ✅ Accepted | Fibonacci intervals: 86% vs 19% retention (+66%) |
| 005: Palace Architecture | ✅ Accepted | Hierarchical chunking: 100+ loci, 100% navigation |
| 006: Export/Import | ✅ Accepted | Multi-format: Anki, Markdown, JSON, Gists |
| 007: Subagents | ✅ Accepted | 4 specialized agents, +25% code clarity |
| 008: Gamification | ◐ Hybrid | Adaptive: beginners get gamification, experts get utility |
| 009: Red Queen Pre-Learning | ✅ Accepted | -37% retrievals, +23% retention for weak memories |
| 010: Hierarchical LLM Retrieval | ✅ Accepted | 97% context reduction, 89% Recall@1 |
| 011: Verification Tokens | ✅ Accepted | F1=0.92 hallucination detection, 600× cheaper |
Skill Fitness: 99% (11/11 evolutions tested, 10 core tests passing)
See evolutions/ or online evolution history for full details.
This project explores the intersection of:
MIT License - See LICENSE for details.
FAQs
Memory Palace + Red Queen Protocol - A Claude Code skill for durable knowledge through vivid encoding + adversarial testing
The npm package memory-palace-red-queen receives a total of 2 weekly downloads. As such, memory-palace-red-queen popularity was classified as not popular.
We found that memory-palace-red-queen demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
The campaign amassed more than 75,000 installs by targeting Russian-speaking users seeking access to blocked services.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.

Security News
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.