Skip to the content.

Goose KG Memory — Knowledge Index

Manage the Knowledge Graph Memory (KGM) MCP extension for Goose. KGM provides a deterministic substring-search index over OKF knowledge bundles — it is an optional accelerator, not a replacement for OKF progressive discovery.

Design Constraints

Configuration

Setting Value
Extension name knowledgegraphmemory
Type stdio (MCP server)
Command npx
Args ["-y", "@modelcontextprotocol/server-memory"]
Env var MEMORY_FILE_PATH
JSONL path ~/.agents/knowledge/.kgm-index.jsonl
Config file ~/.config/goose/config.yaml

Operations

Setup

Signal: “setup goose kgm”

bash ~/.agents/skills/goose-kgm/scripts/setup-kgm.sh

Adds the knowledgegraphmemory extension entry to Goose config with enabled: false. Creates the JSONL directory if needed. Idempotent — skips if entry already exists.

Teardown

Signal: “teardown goose kgm”

bash ~/.agents/skills/goose-kgm/scripts/teardown-kgm.sh

Removes the knowledgegraphmemory extension entry from Goose config and deletes the JSONL file. Idempotent.

Enable (Session-scoped)

Signal: “enable kgm”

Do not edit config.yaml. Use the extension manager tool:

extensionmanager__manage_extensions(action: "enable", extension_name: "knowledgegraphmemory")

This activates KGM tools (search_nodes, read_graph, etc.) for the current session only. The global config retains enabled: false. Requires setup to have been run first (extension entry must exist).

Disable (Session-scoped)

Signal: “disable kgm”

Do not edit config.yaml. Use the extension manager tool:

extensionmanager__manage_extensions(action: "disable", extension_name: "knowledgegraphmemory")

Deactivates KGM tools for the current session. The JSONL index file is preserved on disk for future sessions.

Status

Signal: “kgm status”

Two-part check:

1. Infrastructure status (JSONL file, config entry):

bash ~/.agents/skills/goose-kgm/scripts/status-kgm.sh

2. Session status (agent self-check):

The agent verifies whether knowledgegraphmemory tools are available in the current session by inspecting its active tool set. Report:

Reindex

Signal: “reindex kgm”, “sync kgm”

bash ~/.agents/skills/goose-kgm/scripts/reindex-kgm.sh

Rebuilds the JSONL index from scratch by parsing OKF knowledge bundle indexes. Use after adding, removing, or modifying knowledge bundles to keep KGM in sync.

Also runs automatically as part of sync agentfs (via agentfs-setup) when KGM is configured — pass --check-enabled flag to conditionally skip when disabled in config.

Manual reindex does not require KGM to be enabled — the JSONL file can be rebuilt at any time regardless of session state.

Agent Usage (when KGM is enabled)

KGM indexes both skills and knowledge. search_nodes returns:

entityType Observations Agent action
AgentSkill Signals: (match phrases), Action: (exact load_skill call) Follow the Action observation
KnowledgeConcept Source: (file path), Summary: Read the Source file
KnowledgeBundle Source: (index path), Summary: Browse the bundle index

Do not use shell, extensionmanager, or file browsing to discover skills. load_skill is the only correct tool for loading skills.

Staleness guard: If search_nodes returns nothing but the index files (~/.agents/skills/index.md or ~/.agents/knowledge/index.md) contain a match → ① warn “⚠️ KGM index stale” ② use the index result ③ run bash ~/.agents/skills/goose-kgm/scripts/reindex-kgm.sh after responding ④ confirm reindex count delta.

Sync Model

KGM does not auto-sync with OKF. The JSONL is a point-in-time snapshot rebuilt on demand. Staleness signals:

Sync triggers:

  1. Manual: “reindex kgm” or “sync kgm”
  2. Automatic: as part of sync agentfs (conditional on config)
  3. No file watchers, no hooks, no reactive sync