MCPcopy
hub / github.com/supermemoryai/supermemory / getMemoryString

Function getMemoryString

packages/tools/src/tools-shared.ts:128–138  ·  view source on GitHub ↗
(item: MemoryItem | string)

Source from the content-addressed store, hash-verified

126 const searchItems = data.searchResults ?? []
127
128 const getMemoryString = (item: MemoryItem | string): string | null => {
129 if (!item) return null
130 // Handle both string format (from API) and object format
131 if (typeof item === "string") {
132 const trimmed = item.trim()
133 return trimmed.length > 0 ? trimmed : null
134 }
135 if (typeof item.memory !== "string") return null
136 const trimmed = item.memory.trim()
137 return trimmed.length > 0 ? trimmed : null
138 }
139
140 const staticMemories: string[] = []
141 const seenMemories = new Set<string>()

Callers 1

deduplicateMemoriesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…