Cortex — Graph Memory Skill

by atmsamma

You have access to Cortex, a self-organizing knowledge graph for persistent memory. Use it to remember facts, decisions, goals, patterns, and observations across sessions. Knowledge is stored as nodes in a graph that auto-links, decays stale information, detects contradictions, and computes trust

3.7k数据与存储未扫描2026年3月30日

安装

claude skill add --url https://github.com/openclaw/skills

文档

You have access to Cortex, a self-organizing knowledge graph for persistent memory. Use it to remember facts, decisions, goals, patterns, and observations across sessions. Knowledge is stored as nodes in a graph that auto-links, decays stale information, detects contradictions, and computes trust from topology.

When to Use Cortex

  • Start of session: Call cortex_briefing to load context from previous sessions.
  • Learning something important: Call cortex_store to persist facts, decisions, goals, events, patterns, or observations.
  • Answering questions about past work: Call cortex_search or cortex_recall to find relevant knowledge.
  • Understanding relationships: Call cortex_traverse to explore how concepts connect.
  • Connecting ideas: Call cortex_relate to explicitly link related nodes.

Tools Reference

cortex_store — Remember something

Store a knowledge node. Cortex auto-generates embeddings and the auto-linker discovers connections in the background.

code
cortex_store(
  title: string,         # Required. Short summary (used for search and dedup).
  kind: string,          # "fact" | "decision" | "goal" | "event" | "pattern" | "observation" | "preference". Default: "fact"
  body: string,          # Full content. Can be long. Include details here.
  tags: string[],        # Optional tags for filtering.
  importance: number     # 0.0–1.0. Higher = retained longer, weighted more. Default: 0.5
)

Returns: { id, message }.

Guidelines:

  • Use importance >= 0.7 for architectural decisions, credentials, project goals, user preferences.
  • Use importance 0.4–0.6 for routine facts, observations, intermediate findings.
  • Use importance <= 0.3 for ephemeral notes, temporary context.
  • Write titles as self-contained statements: "API uses JWT authentication" not "Auth info".
  • Put details, reasoning, and evidence in body.
  • Use accurate kind values — they affect briefing structure and filtering.
  • Tag with project name, domain, or agent role for scoped retrieval.

cortex_search — Find by meaning

Semantic similarity search across all stored knowledge.

code
cortex_search(
  query: string,   # Required. Natural language query.
  limit: integer,  # Max results. Default: 10
  kind: string     # Optional filter: "fact", "decision", "goal", etc.
)

Returns: array of { id, kind, title, body, score, created_at }.

When to use: Quick lookup of specific facts or concepts. Best when you know roughly what you're looking for.

cortex_recall — Contextual retrieval

Hybrid search combining vector similarity AND graph structure. Returns more contextually relevant results than pure search.

code
cortex_recall(
  query: string,   # Required. What to recall.
  limit: integer,  # Default: 10
  alpha: number    # 0.0 = pure graph, 1.0 = pure vector. Default: 0.7
)

When to use instead of search:

  • When you need related context, not just matching text.
  • When exploring a topic area broadly.
  • Lower alpha (e.g., 0.3) when graph relationships matter more than text similarity.

cortex_briefing — Session context

Generate a structured summary of relevant knowledge. Includes active goals, recent decisions, patterns, key facts, and contradiction alerts.

code
cortex_briefing(
  agent_id: string,  # Agent identifier. Default: "default"
  compact: boolean   # If true, returns a shorter ~4x denser briefing. Default: false
)

Returns: { briefing: "<markdown>" }.

Guidelines:

  • Call at the start of every new session or conversation.
  • Use compact: true when context window is tight or you just need a quick refresh.
  • Use a consistent agent_id per role/project to get scoped briefings.

cortex_traverse — Explore connections

Walk the knowledge graph from a starting node to discover how concepts relate.

code
cortex_traverse(
  node_id: string,    # Required. Starting node UUID (from search/store results).
  depth: integer,     # How many hops. Default: 2
  direction: string   # "outgoing" | "incoming" | "both". Default: "both"
)

Returns: { nodes: [...], edges: [...] } — the subgraph.

When to use: After finding a key node via search, traverse to understand its full context, dependencies, and contradictions.

cortex_relate — Connect knowledge

Create a typed relationship between two existing nodes.

code
cortex_relate(
  from_id: string,    # Required. Source node UUID.
  to_id: string,      # Required. Target node UUID.
  relation: string    # "relates-to" | "supports" | "contradicts" | "caused-by" | "depends-on" | "similar-to" | "supersedes". Default: "relates-to"
)

When to use:

  • When you discover a logical dependency between two pieces of knowledge.
  • When new information contradicts or supersedes an old node — use contradicts or supersedes.
  • The auto-linker handles many connections automatically; use cortex_relate for explicit, meaningful relationships the auto-linker might miss.

Workflows

Starting a session

  1. cortex_briefing(agent_id="<project-or-role>") — load context.
  2. Read the briefing. Note any active goals, recent decisions, or flagged contradictions.
  3. Proceed with the task informed by prior knowledge.

During work

  • When you make or observe a significant decision → cortex_store(kind="decision", ...).
  • When you discover a fact worth remembering → cortex_store(kind="fact", ...).
  • When you notice a recurring pattern → cortex_store(kind="pattern", ...).
  • When something happened that matters → cortex_store(kind="event", ...).
  • When you need to look something up → cortex_search(...) or cortex_recall(...).

Ending a session

  • Store any unrecorded decisions, outcomes, or observations.
  • If a goal was completed, store an event: cortex_store(kind="event", title="Completed: <goal>", importance=0.6).

Resolving contradictions

  1. cortex_search or cortex_recall to find conflicting nodes.
  2. cortex_relate(from_id=new, to_id=old, relation="supersedes") to mark the old information as superseded.
  3. Store the resolution as a new decision node.

Node Kinds Cheat Sheet

KindUse forExample
factVerified information"API rate limit is 1000 req/min"
decisionChoices made and rationale"Chose PostgreSQL over MongoDB for ACID compliance"
goalActive objectives"Ship v2.0 API by March 30"
eventThings that happened"Production outage on March 15, root cause: DNS"
patternRecurring observations"User requests spike every Monday 9am"
observationUnverified or preliminary notes"The test suite seems flaky on CI"
preferenceUser/team preferences"User prefers concise responses with code examples"

相关 Skills

迁移架构师

by alirezarezvani

Universal
热门

为数据库、API 与基础设施迁移制定分阶段零停机方案,提前校验兼容性与风险,生成回滚策略、验证关卡和时间线,适合复杂系统平滑切换。

做数据库与存储迁移时,用它统一梳理表结构和数据搬迁流程,架构视角更完整,复杂迁移也更稳。

数据与存储
未扫描9.0k

数据库建模

by alirezarezvani

Universal
热门

把需求梳理成关系型数据库表结构,自动生成迁移脚本、TypeScript/Python 类型、种子数据、RLS 策略和索引方案,适合多租户、审计追踪、软删除等后端建模与 Schema 评审场景。

把数据库结构设计、ER图梳理和SQL建模放到一处,复杂业务也能快速统一数据模式,少走不少返工弯路。

数据与存储
未扫描9.0k

资深数据工程师

by alirezarezvani

Universal
热门

聚焦生产级数据工程,覆盖 ETL/ELT、批处理与流式管道、数据建模、Airflow/dbt/Spark 优化和数据质量治理,适合设计数据架构、搭建现代数据栈与排查性能问题。

复杂数据管道、ETL/ELT 和治理难题交给它,凭 Spark、Airflow、dbt 等现代数据栈经验,能更稳地搭起可扩展的数据基础设施。

数据与存储
未扫描9.0k

相关 MCP 服务

by Anthropic

热门

PostgreSQL 是让 Claude 直接查询和管理你的数据库的 MCP 服务器。

这个服务器解决了开发者需要手动编写 SQL 查询的痛点,特别适合数据分析师或后端开发者快速探索数据库结构。不过,由于是参考实现,生产环境使用前务必评估安全风险,别指望它能处理复杂事务。

数据与存储
82.9k

SQLite 数据库

编辑精选

by Anthropic

热门

SQLite 是让 AI 直接查询本地数据库进行数据分析的 MCP 服务器。

这个服务器解决了 AI 无法直接访问 SQLite 数据库的问题,适合需要快速分析本地数据集的开发者。不过,作为参考实现,它可能缺乏生产级的安全特性,建议在受控环境中使用。

数据与存储
82.9k

by Firecrawl

热门

Firecrawl 是让 AI 直接抓取网页并提取结构化数据的 MCP 服务器。

它解决了手动写爬虫的麻烦,让 Claude 能直接访问动态网页内容。最适合需要实时数据的研究者或开发者,比如监控竞品价格或抓取新闻。但要注意,它依赖第三方 API,可能涉及隐私和成本问题。

数据与存储
5.9k

评论