diff --git a/apps/web/components/memory-graph/memory-graph.tsx b/apps/web/components/memory-graph/memory-graph.tsx
index cb17104c2..f0ac58bbd 100644
--- a/apps/web/components/memory-graph/memory-graph.tsx
+++ b/apps/web/components/memory-graph/memory-graph.tsx
@@ -446,7 +446,7 @@ export const MemoryGraph = ({
/>
{!isLoading &&
- nodes.filter((n) => n.type === "document").length === 0 &&
+ !nodes.some((n) => n.type === "document") &&
children}
n.type === "document").length === 0) && (
+ (!data || !nodes.some((n) => n.type === "document")) && (
<>{children}>
)}
diff --git a/packages/ui/memory-graph/memory-graph.tsx b/packages/ui/memory-graph/memory-graph.tsx
index 07895a201..97b0a604b 100644
--- a/packages/ui/memory-graph/memory-graph.tsx
+++ b/packages/ui/memory-graph/memory-graph.tsx
@@ -410,7 +410,7 @@ export const MemoryGraph = ({
{/* Show welcome screen when no memories exist */}
{!isLoading &&
- (!data || nodes.filter((n) => n.type === "document").length === 0) && (
+ (!data || !nodes.some((n) => n.type === "document")) && (
<>{children}>
)}