# Raptor Memory

> Replace OpenClaw's flat-file memory with a self-learning knowledge engine featuring RAPTOR trees, knowledge graphs, conflict resolution, and importance scoring. Your agent actually gets smarter over time.

- Skill: `incidentfox/raptor-memory` (Agent Skill, multi-file: 6 files)
- Install (CLI): `npx skillmds@latest add incidentfox/raptor-memory`
- Raw SKILL.md: https://api.skillmd.com/api/skills/incidentfox/raptor-memory/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: incidentfox (https://skillmd.com/u/incidentfox)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/incidentfox/raptor-memory

---


# RAPTOR Memory — Self-Learning Knowledge Engine

You have access to an intelligent memory system that goes far beyond storing text in files.
Use these MCP tools instead of writing to memory files whenever you need to remember, recall, or reason about past information.

## When to use these tools

### Learning new information
When you encounter important information (from conversations, files, meetings, research), use `learn_knowledge` to store it. The engine will:
- Extract structured knowledge (facts, procedures, relationships, decisions)
- Detect duplicates and conflicts with existing knowledge
- Auto-resolve or flag contradictions
- Build hierarchical summaries (RAPTOR tree) for multi-level abstraction

### Answering questions from memory
When the user asks about something you should know from past interactions, use `query_knowledge`. The engine will:
- Search across semantic similarity, knowledge graph relationships, and hierarchical summaries
- Return grounded answers with source citations and confidence scores
- Synthesize across multiple knowledge sources (not just top-1 match)

### Teaching explicit facts
When the user explicitly tells you to remember something, use `teach_knowledge`. This creates high-confidence knowledge nodes that persist and are prioritized in retrieval.

### Searching for specific topics
Use `search_knowledge` when you need to find specific knowledge nodes (e.g., to verify what you know about a topic before answering).

### Detecting corrections
When someone says "actually that's wrong" or corrects previous information, use `detect_correction` to identify and learn from the correction.

## Why this is better than file-based memory

| Capability | File Memory | RAPTOR Memory |
|-----------|-------------|---------------|
| Storage | Markdown files | Structured knowledge graph + vector embeddings |
| Search | BM25 + basic vector | Multi-strategy (semantic + graph + hierarchical) |
| Conflicts | Last write wins | 5x5 conflict resolution matrix |
| Abstraction | None | RAPTOR tree (leaf → summary → overview) |
| Importance | Manual curation | Observation-driven scoring with temporal decay |
| Learning | Append-only | Continuous learning with dedup + merge |

## Important guidelines

- Always use `learn_knowledge` for information worth remembering long-term
- Use `query_knowledge` before answering questions about past events or decisions
- When you detect a correction in conversation, call `detect_correction`
- Check `knowledge_stats` periodically to understand what you know
- Trust the confidence scores — low confidence means you should caveat your answer

