Knowledge Graph operations — overview
The Knowledge Graph (KG) is the durable layer behind every Pulse board. While chat sessions reset, the KG persists decisions, constraints, alternatives, learnings, and the relationships between them — and exposes that history through 26 dedicated MCP tools. This page indexes those tools and the guarantees they sit on. The four sibling pages drill into each tier with full input/output samples:Queries
14 read tools — primary query API plus the Cypher / natural-language / introspection escape hatches.
Consolidation
7 transactional write primitives that materialize artifacts as nodes and edges.
Health & migration
5 admin tools for queue depth, dead-letter recovery, decay tick, and schema migration.
Archive & retention
Cascading entity archive and the KG’s retention model — supersedence, decay, dead-letter TTL.
Storage model
Each board has its own embedded graph database file:.lbug extension) — an embedded property-graph database with HNSW vector indexes built in. Pulse migrated from Kuzu to ladybug on 2026-05-03; some inline source comments still say “Kùzu” because legacy env-var names were preserved. Both files are pure local SQLite-style artifacts — no separate database server runs.
Schema (v0.3.3)
Source:okto-pulse-feature-inventory.md:1124–1132 and okto-pulse-core/src/okto_pulse/core/kg/schema.py.
11 node types
10 relationship types + belongs_to multi-pair
5 HNSW vector indexes
EachDecision, Constraint, Requirement, Entity, and Learning node carries a 384-dimensional embedding (default model sentence-transformers/all-MiniLM-L6-v2). One HNSW index per type powers semantic search in kg_query_natural, kg_find_similar_decisions, and kg_get_decision_history.
Inspect the live schema with the introspection tool:
The 26 tools at a glance
Source:okto-pulse-feature-inventory.md:493–546. Total = 5 admin (in server.py) + 7 consolidation (kg_tools.py) + 9 query primary (kg_query_tools.py) + 5 power (kg_power_tools.py).
Consolidation — 7 transactional primitives
okto-pulse-core/src/okto_pulse/core/mcp/kg_tools.py:register_kg_tools
Full reference and a worked example: consolidation.
Queries — 9 primary tools
okto-pulse-core/src/okto_pulse/core/mcp/kg_query_tools.py:register_kg_query_tools
Power tools — 5 escape hatches
okto-pulse-core/src/okto_pulse/core/mcp/kg_power_tools.py:register_kg_power_tools
The 14 read tools (9 primary + 5 power) are documented in full on queries.
Admin — 5 operational tools
okto-pulse-core/src/okto_pulse/core/mcp/server.py:12484–12857
Walkthrough with output samples: health & migration.
Permissions and authentication
Every KG tool runs under the standard Pulse API key / Bearer /PULSE_API_TOKEN auth model. Permissions live in the granular registry at okto-pulse-core/src/okto_pulse/core/infra/permissions.py:PERMISSION_REGISTRY as dotted-string flags under the kg.* namespace:
kg.query.*— every primary read tool (decision_history,related_context,supersedence_chain,contradictions,similar_decisions,constraint_explain,alternatives,learning_from_bugs,global). Granted as a wildcard or per-tool.kg.power.natural,kg.power.schema_info,kg.power.cypher— the read-side power tools split across three flags.kg.power.cypheris the most restricted;kg.power.naturalandkg.power.schema_infoship in most presets.kg.session.begin,kg.session.add_node,kg.session.add_edge,kg.session.get_similar,kg.session.propose,kg.session.commit,kg.session.abort— one flag per consolidation primitive.kg.session.commitis the meaningful gate; some presets grant everything exceptcommitfor dry-run-only roles.kg.admin.settings_read,kg.admin.settings_write,kg.admin.historical_consolidation,kg.admin.wipe_board— the operational surface.kg.admin.historical_consolidationgates dead-letter reprocess + CLI backfill drain.
kg.query.* set plus the kg.session.* flags up to and including commit. User-facing dashboard agents typically receive kg.query.* plus kg.power.natural / kg.power.schema_info. Operator presets layer in kg.admin.* flags. The two power tools kg.power.cypher and kg.session.commit plus the kg.admin.* namespace are the high-trust flags — only grant them deliberately.
When to use which tool
Determinism guarantees
Two properties make the KG safe to depend on across sessions:- No LLM in the read path.
kg_query_natural,kg_find_similar_decisions, and the rest of the primary query tier use the same embedding model (defaultsentence-transformers/all-MiniLM-L6-v2, 384-dim) plus deterministic graph traversal. Same input + same graph state always returns the same result.kg_query_reflectiveis the lone exception — it is a V1 stub that wraps an LLM critic and is not used by the standard pipeline. - Atomic consolidation. The 7 primitives compose into a single transaction:
begin → add → propose → commit. Either every candidate lands or none do, and a content-hash check onbeginshort-circuits a no-op replay (returnsnothing_changed: true). The audit row + outbox event written bycommitare the system-of-record for what changed.
Next steps
Queries
Sample inputs and outputs for the 14 read tools.
Consolidation
Walk through writing a decision into the graph end-to-end.