Skip to content
Agent Memory
Command

/cortexdb-global-search

Answer a whole-corpus question over the CortexDB brain using GraphRAG global search

From plugin
cortexdb
52913 skills13 commands1 MCP
> /plugin marketplace add liliang-cn/cortexdb
> /plugin install cortexdb@cortexdb

Command definition

cortexdb-global-search.md
description: Answer a whole-corpus question over the CortexDB brain using GraphRAG global search

Answer a **whole-corpus / thematic** question — the kind local retrieval can't ("what are the main themes?", "summarize everything I know about X", "what areas does this brain cover?") — using GraphRAG-style **global search**: detect entity communities in the graph, write an LLM report for each (once, then reused), and map-reduce those reports into an answer.

If the cortexdb MCP server is connected, call its `global_search` tool with the question (add `level` for a finer granularity: 0 is the finest; omitted, the coarsest level is used). Otherwise run in a shell, putting the question in `Q` (add `--level N` before it for a specific level):

bin=$(ls -t ~/.claude/plugins/data/cortexdb-cortexdb/bin/cortexdb-mcp-* 2>/dev/null | head -1)
[ -n "$bin" ] || bin="${CORTEXDB_MCP_BIN:-cortexdb-mcp}"
Q="${ARGUMENTS:-What are the main themes in this knowledge base?}"
"$bin" --global-search "$Q"

With an LLM configured (`CORTEXDB_LLM_BASE_URL`, e.g. a local Ollama `http://localhost:11434`, and `CORTEXDB_LLM_MODEL`) the community reports and the answer are the model's. Without one it still runs: reports are assembled deterministically and the most relevant are printed without a synthesised answer — say so to the user rather than presenting them as an answer.

The first run builds the community hierarchy (one LLM call per community when a model is set — slow on a large brain); later runs reuse it. `build_community_hierarchy` rebuilds it after the graph has changed substantially. Then relay the answer to the user. If it reports zero communities, the brain has too few linked entities yet — suggest importing/organizing more (`/cortexdb-import-memory`, `/cortexdb-graph`, `knowledge_save` with entities/relations).

$ARGUMENTS

Read more
@liliang-cn
Ships withcortexdb

Memory your coding agents share. Tell Claude Code something once, and Codex, your other machines and next week's session already know it.

5293 skills1 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
529
Star history of liliang-cn/cortexdb on GitHub, a chart by star-history.com

Other commands on cortexdb.

More commands from other plugins.

mempalace-audit

mempalace-audit

Command

Score how well organized your memory palace is, then run a guided repair session — one decision at a time.

@mempalace@mempalaceInstall Command
plan-to-beads

plan-to-beads

Command

Convert a Claude Code plan file into beads epic + tasks for cross-session tracking.

beads8d29k
@gastownhall@gastownhallInstall Command