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

Function useAgentMemoryQuery

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

Source from the content-addressed store, hash-verified

62 * when no agent is selected) to skip the call entirely.
63 */
64export function useAgentMemoryQuery(
65 agentPubkey: string | null | undefined,
66 options?: { enabled?: boolean },
67) {
68 const enabled = (options?.enabled ?? true) && !!agentPubkey;
69 return useQuery<AgentMemoryListing>({
70 enabled,
71 queryKey: agentMemoryQueryKey(agentPubkey ?? ""),
72 queryFn: () => getAgentMemory(agentPubkey as string),
73 staleTime: 30_000,
74 });
75}
76
77/**
78 * Convenience wrapper: feeds the listing through {@link buildMemoryGraph}

Callers 2

UserProfilePanelFunction · 0.90
useAgentMemoryGraphFunction · 0.85

Calls 2

getAgentMemoryFunction · 0.90
agentMemoryQueryKeyFunction · 0.85

Tested by

no test coverage detected