🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated
TypeScript agentic-aiagentic-frameworkagentic-workflowagentsai-agentsai-assistantai-skillsautonomous-agentsclaudecodexdsh-pluginharnessmcp-servermulti-agentmulti-agent-systemsnpmskillsswarmswarm-intelligencetypescript
🔖 Checkpoint: Edit /workspaces/claude-code-flow/src/cli/simple-commands/hive-mind.js
rUv154f3e534f19
diff --git a/.claude/checkpoints/1754227181.json b/.claude/checkpoints/1754227181.jsonnew file mode 100644index 0000000000..5dcd7a7dc1--- /dev/null+++ b/.claude/checkpoints/1754227181.json@@ -0,0 +1 @@+{"branch": "checkpoint/pre-edit-20250803-131941", "file": "/workspaces/claude-code-flow/src/cli/simple-commands/hive-mind.js", "timestamp": "2025-08-03T13:19:41Z", "type": "pre-edit", "original_branch": "alpha-84b"}diff --git a/.claude/checkpoints/1754227183.json b/.claude/checkpoints/1754227183.jsonnew file mode 100644index 0000000000..33507665fe--- /dev/null+++ b/.claude/checkpoints/1754227183.json@@ -0,0 +1 @@+{"tag": "checkpoint-20250803-131943", "file": "/workspaces/claude-code-flow/src/cli/simple-commands/hive-mind.js", "timestamp": "2025-08-03T13:19:43Z", "type": "post-edit", "branch": "alpha-84b", "diff_summary": " .claude-flow/metrics/performance.json | 2 +- .claude-flow/metrics/system-metrics.json | 60 ++++++++++++++++++++++++++++++++ .claude-flow/metrics/task-metrics.json | 6 ++-- .claude/checkpoints/1754227128.json | 1 + .claude/checkpoints/1754227130.json | 1 + claude-flow-wiki | 0 src/cli/simple-commands/hive-mind.js | 59 +++++++++++++++++++++---------- 7 files changed, 107 insertions(+), 22 deletions(-) "}diff --git a/src/cli/simple-commands/hive-mind.js b/src/cli/simple-commands/hive-mind.jsindex a920747b8b..e49076e909 100644--- a/src/cli/simple-commands/hive-mind.js+++ b/src/cli/simple-commands/hive-mind.js@@ -1618,29 +1618,49 @@ async function searchMemories() {console.log(chalk.blue(`\n🔍 Searching for: "${searchTerm}"\n`));- const mcpWrapper = await getMcpWrapper();- const searchResult = await mcpWrapper.searchMemory('hive-mind', searchTerm);+ // Search directly in hive.db collective_memory table+ const dbPath = path.join(cwd(), '.hive-mind', 'hive.db');+ const db = new Database(dbPath);- // Handle different possible response structures- let memories = [];- if (searchResult && Array.isArray(searchResult.results)) {- memories = searchResult.results;- } else if (searchResult && Array.isArray(searchResult)) {- memories = searchResult;- } else if (searchResult && searchResult.data && Array.isArray(searchResult.data)) {- memories = searchResult.data;- }+ const searchPattern = `%${searchTerm}%`;+ const memories = db+ .prepare(+ `+ SELECT cm.*, s.name as swarm_name+ FROM collective_memory cm+ LEFT JOIN swarms s ON cm.swarm_id = s.id+ WHERE cm.key LIKE ? OR cm.value LIKE ? OR cm.type LIKE ?+ ORDER BY cm.created_at DESC+ LIMIT 50+ `,+ )+ .all(searchPattern, searchPattern, searchPattern);++ db.close();if (!memories || memories.length === 0) {console.log(chalk.yellow('No memories found matching your search.'));return;}+ console.log(chalk.gray(`Found ${memories.length} memories matching "${searchTerm}":\n`));+memories.forEach((memory, index) => {- console.log(chalk.green(`${index + 1}. ${memory.key || `result-${index}`}`));- console.log(` Category: ${memory.type || 'general'}`);- console.log(` Created: ${new Date(memory.timestamp || Date.now()).toLocaleString()}`);- console.log(` Value: ${JSON.stringify(memory.value || memory, null, 2)}`);+ console.log(chalk.green(`${index + 1}. ${memory.key}`));+ console.log(` Swarm: ${memory.swarm_name || memory.swarm_id}`);+ console.log(` Type: ${memory.type || 'knowledge'}`);+ console.log(` Created: ${new Date(memory.created_at).toLocaleString()}`);++ // Parse and display value with highlighting+ let displayValue = memory.value;+ try {+ const parsed = JSON.parse(memory.value);+ displayValue = JSON.stringify(parsed, null, 2);+ } catch {+ // Keep as string+ }++ console.log(` Value: ${displayValue}`);console.log('');});} catch (error) {