Skip to main content
PluginDefault onclawql-memory

Plugins · Registry · Plugin model

Memory (vault)

Plugin ID: clawql-memory
Package: packages/clawql-memoryMemoryPlugin

Persists durable session knowledge to an Obsidian-compatible vault and recalls it across chats. The same plugin tier also registers PageIndex and optional code graph specialists. Agents should start with memory_recall (optionally with sources) and open specialist tools only when they need path/tree/enterprise depth.

Memory 2.0 components

Each piece has one job. The vault is the only canonical store; everything else is a derived index, a code index, an external peer, or the recall facade.

ComponentUsed forUnique role
Obsidian / VaultStore knowledge as Markdown + YAML frontmatter under Memory/Canonical core every derived index and query path references or cites back into
Wikilinks + memory.dbParse [[links]] into SQLite (wikilink_edge, vault_chunk) on ingest; traverse on recallExplicit structured graph over the vault — link navigation without vectors
EmbeddingsVector representations of vault chunks for similarity in memory_recallFuzzy semantic retrieval when no wikilinks or structural paths exist
PageIndexpageindex_build_tree → heading tree in pageindex.db.json; traverse / synthesizeDeterministic, vectorless section navigation and token-budget synthesis on vault structure
clawql-codegraphParse source (TS compiler API for TS/JS; tree-sitter WASM for Python/Go) → nodes/edges with confidence tagsDeterministic structural index over code, independent of the vault
Onyxknowledge_search_onyx / sources: ["onyx"]; optional enterpriseCitations on ingestExternal search peer — supplies org knowledge without ClawQL owning the corpus

Write once, refresh indexes: memory_ingest always writes vault Markdown. Optional rebuild refreshes derived layers (PageIndex, memory.db/embeddings). Codegraph indexes code; Onyx stays a search peer (citations into the vault, not “ingest into Onyx”).

Agent habit: start with memory_recall (sources when needed) → follow followUps into specialists only when you need path / tree walk / filtered enterprise search.

MCP tools

ToolPurpose
memory_ingestWrite structured insights, wikilinks, and optional verbatim tool output to the vault
memory_recallMulti-source recall (sources) → hits[] + followUps; vault results kept
pageindex_build_treeBuild a vectorless hierarchical index from Markdown (clawql-pageindex)
pageindex_traverseWalk the PageIndex tree under a token budget
pageindex_synthesizeMerge selected nodes into agent context
pageindex_get_contentRead indexed node content
codegraph_indexBuild structural code graph from repo root (clawql-codegraph, opt-in)
codegraph_import_graphifyImport Graphify graph.json (NetworkX node-link export)
codegraph_queryFind symbols by name or concept in the code graph
codegraph_neighborsList inbound/outbound edges (imports, calls, contains)
codegraph_pathShortest path between two symbols (Graphify-style trace)
codegraph_explainSummarize a symbol and its neighborhood
codegraph_subgraphBFS subgraph around a seed query

memory_recall sources

{
  "query": "AuthService rate limit",
  "sources": ["vault", "vector", "codegraph", "pageindex", "onyx"],
  "limit": 10,
  "maxDepth": 2
}
SourceWhat it contributes
vaultKeyword + wikilink BFS over Obsidian Markdown
vectorEmbedding KNN seeds (when vector backend + API key configured)
codegraphStructural symbol hits (codeGraphHits + normalized hits)
pageindexTerm-overlap heading nodes from stored PageIndex trees
onyxEnterprise citations via injected Onyx search

Defaults when sources is omitted: vault + vector, plus hybrids from env (CLAWQL_MEMORY_RECALL_HYBRID_CODEGRAPH, _PAGEINDEX, _ONYX) or includeCodeGraph: true.

Response:

  • results — vault-side hits (backward compatible)
  • hits — normalized multi-source hits (source, id, score, snippet, …)
  • followUps — specialist tool hints (pageindex_synthesize, codegraph_path, knowledge_search_onyx, …)
  • sourcesUsed / sourceNotes — what ran and skip reasons

memory_ingest rebuild

{
  "title": "AuthService rate limits",
  "insights": "## Finding\n…",
  "wikilinks": ["API hardening"],
  "enterpriseCitations": [],
  "rebuild": { "pageindex": true, "embeddings": true }
}
FlagEffect
rebuild.pageindexRebuild PageIndex for the written note (or set CLAWQL_MEMORY_INGEST_REBUILD_PAGEINDEX=1)
rebuild.embeddingsRun memory.db / embedding sync (default on when memory.db enabled; false skips)

Enable / disable

EnvDefaultEffect
CLAWQL_ENABLE_MEMORY=0onOmit MemoryPlugin and hide memory + PageIndex + code graph tools
CLAWQL_ENABLE_PAGEINDEX=0onHide pageindex_* only (memory ingest/recall remain)
CLAWQL_ENABLE_CODEGRAPH=1offRegister codegraph_* tools (structural code graph)
CLAWQL_MEMORY_RECALL_HYBRID_CODEGRAPH=1offDefault sources includes codegraph
CLAWQL_MEMORY_RECALL_HYBRID_PAGEINDEX=1offDefault sources includes pageindex
CLAWQL_MEMORY_RECALL_HYBRID_ONYX=1offDefault sources includes onyx (needs Onyx wired + enabled)
CLAWQL_MEMORY_INGEST_REBUILD_PAGEINDEX=1offRebuild PageIndex after every successful ingest

Prerequisites

  • Writable CLAWQL_OBSIDIAN_VAULT_PATH (Docker images often use /vault)
  • Tools register even without a vault path, but vault I/O fails until the path is configured
  • Code graph: CLAWQL_CODEGRAPH_ROOT + CLAWQL_CODEGRAPH_PATH
  • Onyx in sources: CLAWQL_ENABLE_ONYX=1 + documents/onyx in merge; MCP wires search into memory

Optional hybrid vector index: see memory-db-hybrid-implementation.md in the repo.

Typical workflow

  1. memory_recall with a focused query (add sources when you need code/enterprise/PageIndex in one shot)
  2. Follow followUps only when you need path, tree synthesize, or filtered Onyx
  3. Do work with search / execute
  4. memory_ingest with decisions + wikilinks; set rebuild.pageindex: true for long notes

PageIndex workflow

Standalone MIT library for vectorless hierarchical document indexing (Markdown headings → tree → traverse → synthesize), registered as MCP tools by MemoryPlugin:

  1. Ingest long docs with memory_ingest or ingest_external_knowledge
  2. pageindex_build_tree on vault Markdown (pass a docId)
  3. pageindex_traverse / pageindex_synthesize instead of pasting full files into the thread

Package API: packages/clawql-pageindex/README.md

Learn more