sync: Workflows P2 features from private repo

- 5 bundled workflows (prep, research, connect, integrate, survey)
- quickLink tool for fast edge creation
- queryDimensionNodes tool for dimension queries
- Workflow orchestration tools (list, get, edit)
- Dimension awareness with active dimension tracking
- Unified Workflows tab in Agent Panel
- MCP server updates for workflow execution

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
“BeeRad”
2026-01-11 18:54:34 +11:00
co-authored by Claude Opus 4.5
parent 3951d9daf4
commit f9271aeeb4
24 changed files with 2842 additions and 153 deletions
+44 -52
View File
@@ -1,71 +1,63 @@
export const INTEGRATE_WORKFLOW_INSTRUCTIONS = `You are executing the INTEGRATE workflow for the currently focused node.
MISSION
Find meaningful connections across the user's knowledge graph and append an Integration Analysis to the node.
Find meaningful connections across the user's knowledge graph, create edges, and append an Integration Analysis.
YOU HAVE DIRECT WRITE ACCESS via updateNode. The tool automatically appends you cannot overwrite existing content.
YOU HAVE DIRECT WRITE ACCESS via updateNode (appends only) and createEdge (creates graph connections).
WORKFLOW STEPS
0. PLAN (MANDATORY)
- Call think to outline your approach for steps 14
- Focus on what entities/concepts to extract and how to search for them
1. RETRIEVE & GROUND THE NODE
1. RETRIEVE & UNDERSTAND
- Call getNodesById for the focused node
- Identify what type of thing this is (person, project, paper, idea, video, tweet, technique, etc.)
- Extract key entities: specific names, projects, concepts, techniques mentioned
- Summarize the core insight in one sentence
- Identify: what type of thing is this? (person, project, paper, idea, video, etc.)
- Extract key entities: names, projects, concepts, techniques
- Note the core insight in one sentence
2. SEARCH FOR CONNECTIONS
Search the database using entities from step 1:
a) Structural connections:
- Names mentioned → queryNodes to find nodes about those people
- Projects/tools mentioned → queryNodes to find those nodes
2. SEARCH THE DATABASE FOR CONNECTIONS
Search the ENTIRE database:
a) Obvious structural connections:
- If names mentioned → queryNodes to find existing nodes about those people
- If projects mentioned → queryNodes to find those project nodes
- If specific techniques/tools mentioned → search for those exact terms
b) Thematic connections:
- Use searchContentEmbeddings with key concepts from step 1
- Use searchContentEmbeddings with key concepts
- Look for shared themes, complementary ideas, contradictions
- Prefer nodes with high-signal relevance over weak matches
- Aim for 38 strong connections, not 20 weak ones
- Check existing edges with queryEdge to avoid duplicating connections
3. CONTEXTUALIZE WITH TOP NODES
Review the BACKGROUND CONTEXT (top nodes by edge count):
- Why might this node matter given the user's focus areas?
- Does it advance any themes visible in their most connected nodes?
- Keep this brief 12 sentences maximum
Target: 3-5 strong connections (quality over quantity)
3. CREATE EDGES
For each connection found, call createEdge:
- from_node_id: the focused node ID
- to_node_id: the connected node ID
- context: { explanation: "why this connection matters" }
The tool handles duplicates gracefully - if edge exists, it returns an error and you continue.
Create 3-5 edges total.
4. DOCUMENT IN CONTENT
Call updateNode ONCE with ONLY this new section:
4. APPEND INTEGRATION ANALYSIS
Call updateNode ONCE with ONLY the new section (do NOT include existing content):
---
## Integration Analysis
[23 sentences: what this node is, why it matters, core insight]
**Database Connections:**
- [NODE:123:"Title"] — [why: authorship/shared concept/dependency/contradiction]
- [NODE:456:"Title"] — [why: ...]
- [continue for 38 connections found in step 2]
**Relevance:** [12 sentences connecting to user's top nodes/focus areas]
CRITICAL: Send ONLY this new section. The tool will automatically append it to existing content.
After ONE successful updateNode call, IMMEDIATELY move to step 5. Do NOT call updateNode again.
[2-3 sentences: what this is, why it matters, core insight]
**Connections:**
- [NODE:123:"Title"] — [why connected]
- [NODE:456:"Title"] — [why connected]
[list all edges created in step 3]
CRITICAL: Send ONLY the new section. The tool appends automatically.
5. RETURN SUMMARY
Reply with: Task / Actions / Result / Nodes / Follow-up (≤120 words)
Reply with: Task / Actions / Result / Nodes / Follow-up (≤100 words)
CRITICAL RULES
- Search the FULL database, not just top nodes
- Use entities from step 1 to guide searches in step 2
- Call updateNode EXACTLY ONCE - after success, move to step 5 immediately
- Keep total tool calls ≤ 18 (be efficient)
- Adapt to any node type don't assume it's always a paper or video
RULES
- Keep total tool calls ≤ 12
- Create edges BEFORE documenting (step 3 before step 4)
- Call updateNode exactly once
- Adapt to any node type
The goal: integrate this node into the knowledge graph through meaningful, database-wide connections.`;
OPTIONAL: Call think at any point if you need to plan your approach.`;