MCPcopy Create free account
hub / github.com/block/buzz / useAgentMemoryGraph

Function useAgentMemoryGraph

desktop/src/features/agent-memory/hooks.ts:84–97  ·  view source on GitHub ↗
(
  agentPubkey: string | null | undefined,
  options?: { enabled?: boolean },
)

Source from the content-addressed store, hash-verified

82 * worker-ize this if the numbers warrant).
83 */
84export function useAgentMemoryGraph(
85 agentPubkey: string | null | undefined,
86 options?: { enabled?: boolean },
87): {
88 query: ReturnType<typeof useAgentMemoryQuery>;
89 graph: MemoryGraph | null;
90} {
91 const query = useAgentMemoryQuery(agentPubkey, options);
92 const graph = React.useMemo<MemoryGraph | null>(() => {
93 if (!query.data) return null;
94 return buildMemoryGraph(query.data);
95 }, [query.data]);
96 return { query, graph };
97}

Callers 2

MemoryRefreshButtonFunction · 0.90
MemorySectionForOwnerFunction · 0.90

Calls 2

buildMemoryGraphFunction · 0.90
useAgentMemoryQueryFunction · 0.85

Tested by

no test coverage detected