# Send Cortex to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "hurttlocker-cortex",
    "name": "Cortex",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/hurttlocker/hurttlocker-cortex",
    "canonicalUrl": "https://clawhub.ai/hurttlocker/hurttlocker-cortex",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/hurttlocker-cortex",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=hurttlocker-cortex",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "SKILL.md",
      "scripts/cortex-wrapper.sh",
      "scripts/setup.sh"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "hurttlocker-cortex",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-02T03:27:22.838Z",
      "expiresAt": "2026-05-09T03:27:22.838Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=hurttlocker-cortex",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=hurttlocker-cortex",
        "contentDisposition": "attachment; filename=\"hurttlocker-cortex-4.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "hurttlocker-cortex"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/hurttlocker-cortex"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/hurttlocker-cortex",
    "downloadUrl": "https://openagent3.xyz/downloads/hurttlocker-cortex",
    "agentUrl": "https://openagent3.xyz/skills/hurttlocker-cortex/agent",
    "manifestUrl": "https://openagent3.xyz/skills/hurttlocker-cortex/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/hurttlocker-cortex/agent.md"
  }
}
```
## Documentation

### Cortex — Local-First Agent Memory

The memory layer OpenClaw should have built in.

Cortex is an open-source, import-first memory system for AI agents. Single Go binary, SQLite storage, zero cloud dependencies. It solves the #1 complaint about OpenClaw: agents forget everything after compaction.

GitHub: https://github.com/hurttlocker/cortex
Install: brew install hurttlocker/cortex/cortex or download from Releases

### Why Cortex?

OpenClaw's default memory is Markdown files. When context fills up, compaction summarizes and destroys specifics. Cortex fixes this:

ProblemCortex SolutionCompaction loses detailsPersistent SQLite DB survives any sessionNo search — just dump files into contextHybrid BM25 + semantic search (~16ms keyword, ~52ms semantic)Everything has equal weightEbbinghaus decay — important facts stay, noise fades naturallyCan't import existing filesImport-first: Markdown, text, any file. 8 connectors (GitHub, Gmail, Calendar, Drive, Slack, Notion, Discord, Telegram)Multi-agent memory leaksPer-agent scoping built inExpensive cloud memory services$0/month. Forever. Local SQLite.

### 1. Install Cortex

# macOS/Linux (Homebrew)
brew install hurttlocker/cortex/cortex

# Or download binary directly
# https://github.com/hurttlocker/cortex/releases/latest

### 2. Import Your Memory

# Import OpenClaw's memory files
cortex import ~/clawd/memory/ --extract

# Import specific files
cortex import ~/clawd/MEMORY.md --extract
cortex import ~/clawd/USER.md --extract

### 3. Search

# Fast keyword search
cortex search "wedding venue" --limit 5

# Semantic search (requires ollama with nomic-embed-text)
cortex search "what decisions did I make about the project" --mode semantic

# Hybrid (recommended)
cortex search "trading strategy" --mode hybrid

### 4. Use as MCP Server (recommended for OpenClaw)

# Add to your MCP config — Cortex exposes 17 tools + 4 resources
cortex mcp              # stdio mode
cortex mcp --port 8080  # HTTP+SSE mode

### Ebbinghaus Forgetting Curve

Facts decay at different rates based on type. Identity facts (names, roles) last ~2 years. Temporal facts (events, dates) fade in ~1 week. State facts (status, mood) fade in ~2 weeks. This means search results naturally prioritize what matters — without manual curation.

### Hybrid Search

BM25 — instant keyword matching via SQLite FTS5 (~16ms)
Semantic — meaning-based via local embeddings (~52ms)
Hybrid — combines both with reciprocal rank fusion

### Fact Extraction

Every imported file gets facts extracted automatically:

Rule-based extraction (zero cost, instant)
Optional LLM enrichment (Grok, Gemini, or any provider — finds facts rules miss)
Auto-classification into 9 types: identity, relationship, preference, decision, temporal, location, state, config, kv

### Connectors (Beta)

Pull memory from external sources:

cortex connect sync --provider github --extract
cortex connect sync --provider gmail --extract
cortex connect sync --all --extract

### Knowledge Graph

Explore your memory visually:

cortex graph --serve --port 8090
# Opens interactive 2D graph explorer in browser

### Self-Cleaning

cortex cleanup --purge-noise  # Remove garbage + duplicates
cortex stale 30               # Find facts not accessed in 30 days
cortex conflicts               # Detect contradictions
cortex conflicts --resolve llm # Auto-resolve with LLM

### Recommended Search Chain

memory_search → Cortex → QMD → ripgrep → web search

Use OpenClaw's built-in memory_search for conversation history, then Cortex for deep knowledge retrieval.

### Wrapper Script

The included scripts/cortex.sh provides shortcuts:

scripts/cortex.sh search "query" 5       # Hybrid search
scripts/cortex.sh stats                    # Memory health
scripts/cortex.sh stale 30                # Stale fact detection
scripts/cortex.sh conflicts               # Contradiction detection
scripts/cortex.sh sync                    # Incremental import
scripts/cortex.sh reimport                # Full wipe + re-import
scripts/cortex.sh compaction              # Pre-compaction state brief

### Automated Sync (launchd/systemd)

# Auto-import sessions + sync connectors every 30 min
cortex connect schedule --every 30m --install

### Architecture

Language: Go (62,300+ lines, 1,081 tests)
Storage: SQLite + FTS5 + WAL mode
Binary: 19MB, pure Go, zero CGO, zero runtime dependencies
Platforms: macOS (arm64/amd64), Linux (arm64/amd64), Windows (amd64)
MCP: 17 tools + 4 resources (stdio or HTTP+SSE)
Embeddings: Local via Ollama (nomic-embed-text), or OpenAI/DeepSeek/custom
LLM: Optional enrichment via any provider (Grok, Gemini, DeepSeek, OpenRouter)
Scale: Tested to 100K+ memories. At ~20-50/day, won't hit ceiling for 5+ years.
License: MIT

### vs Other Memory Tools

CortexMem0ZepLangMemDeploySingle binaryCloud or K8sCloudPython libCost$0$19-249/mo$25/mo+Infra costsPrivacy100% localCloud by defaultCloudDependsDecayEbbinghaus (7 rates)TTL onlyTemporalNoneImportFiles + 8 connectorsChat extractionChat/docsChat extractionSearchBM25 + semanticVector + graphTemporal KGJSON docsMCP17 tools nativeNoNoNoDependenciesZeroPython + cloudCloud + creditsPython + LangGraph

### Requirements

Cortex binary — install via Homebrew or download from GitHub Releases
Optional: Ollama with nomic-embed-text for semantic search
Optional: LLM API key for enrichment (Grok, Gemini, etc.)
No Python. No Node. No Docker. No cloud account. Just the binary.

### When to use cortex answer vs cortex search

answer — "What do I know about X?" / "Who is Y?" / synthesis questions → single coherent response with citations
search — "Find the file where X is mentioned" / debugging / exploring what exists → ranked result list

### Source Boost (config.yaml)

Add to ~/.cortex/config.yaml:

search:
  source_boost:
    - prefix: "memory/"
      weight: 1.5
    - prefix: "file:MEMORY"
      weight: 1.6
    - prefix: "github"
      weight: 1.3
    - prefix: "session:"
      weight: 0.9

Higher weight = more trusted. Daily notes and core files rank above auto-imported sessions.

### Search Intent

Use --intent when you know where the answer lives:

--intent memory — personal decisions, preferences, people
--intent connector — code, PRs, emails, external data
--intent import — imported files and documents
No flag = search everything (default, good for discovery)

### Lifecycle Runner Schedule

# Nightly dry-run + apply (launchd or cron)
cortex lifecycle run --dry-run > /tmp/lifecycle-plan.log 2>&1
# If anything found, apply:
cortex lifecycle run

Recommended: 3:30 AM daily. First week: dry-run only, review logs.

### Policy Presets

Fresh agent (< 500 facts):

policies:
  reinforce_promote:
    min_reinforcements: 3
    min_sources: 2
  decay_retire:
    inactive_days: 90
    confidence_below: 0.25
  conflict_supersede:
    min_confidence_delta: 0.20

Mature agent (2000+ facts):

policies:
  reinforce_promote:
    min_reinforcements: 5
    min_sources: 3
  decay_retire:
    inactive_days: 45
    confidence_below: 0.35
  conflict_supersede:
    min_confidence_delta: 0.10

### Post-Import Hygiene

After any bulk import, run:

cortex cleanup --dedup-facts    # Remove near-duplicates
cortex conflicts --auto-resolve  # Resolve contradictions

### Recommended OpenClaw Search Chain (Updated)

memory_search → cortex answer (synthesis) → cortex search (pointers) → QMD → ripgrep → web
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: hurttlocker
- Version: 4.0.0
## Source health
- Status: healthy
- Item download looks usable.
- Yavira can redirect you to the upstream package for this item.
- Health scope: item
- Reason: direct_download_ok
- Checked at: 2026-05-02T03:27:22.838Z
- Expires at: 2026-05-09T03:27:22.838Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/hurttlocker-cortex)
- [Send to Agent page](https://openagent3.xyz/skills/hurttlocker-cortex/agent)
- [JSON manifest](https://openagent3.xyz/skills/hurttlocker-cortex/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/hurttlocker-cortex/agent.md)
- [Download page](https://openagent3.xyz/downloads/hurttlocker-cortex)