Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

simplify: parallelize per-type projection fetch in brainGraph loadNodes

[._.]/ Adam Eivy4459921dc81f
diff --git a/server/services/brainGraph.js b/server/services/brainGraph.js
index 9486438737..f6d9824edb 100644
--- a/server/services/brainGraph.js
+++ b/server/services/brainGraph.js
@@ -87,9 +87,9 @@ const journalDate = (entry) => entry.id || entry.date;
// Load all non-archived brain entities as graph nodes (no edges).
async function loadNodes() {
const nodes = [];
- for (const type of ENTITY_TYPES) {
- const records = await getBrainProjections(type, { ranked: false });
- for (const record of records) {
+ const perType = await Promise.all(ENTITY_TYPES.map((type) => getBrainProjections(type, { ranked: false })));
+ ENTITY_TYPES.forEach((type, i) => {
+ for (const record of perType[i]) {
if (record.archived) continue;
nodes.push({
id: record.id,
@@ -101,7 +101,7 @@ async function loadNodes() {
status: record.status
});
}
- }
+ });
// Goals (identity system): active goals only (completed/abandoned excluded)
const goalsData = await getGoals().catch(() => null);