MCPcopy Create free account
hub / github.com/diillson/chatcli / graphIndexBlock

Method graphIndexBlock

cli/knowledge_graph.go:48–57  ·  view source on GitHub ↗

graphIndexBlock renders the prompt block: the deterministic MOC card plus the pull hint. Returns "" when disabled or the graph is empty, so quiet setups pay nothing. The card itself is byte-stable between knowledge changes, so it does not bust the prompt cache turn to turn.

()

Source from the content-addressed store, hash-verified

46// nothing. The card itself is byte-stable between knowledge changes, so it does
47// not bust the prompt cache turn to turn.
48func (cli *ChatCLI) graphIndexBlock() string {
49 if !graphIndexEnabled() {
50 return ""
51 }
52 card := cli.buildKnowledgeGraph().IndexCard(graphIndexMaxHubs)
53 if card == "" {
54 return ""
55 }
56 return "# Knowledge Graph (index)\n" + card + "\n" + graphRecallHint
57}
58
59// buildKnowledgeGraph assembles the graph from the live stores. Safe to call
60// with a nil memory store or persona handler — it simply yields a smaller graph.

Callers 1

buildWorkspaceBlocksMethod · 0.80

Calls 3

buildKnowledgeGraphMethod · 0.95
graphIndexEnabledFunction · 0.85
IndexCardMethod · 0.80

Tested by

no test coverage detected