--- name: find-connections description: Discover hidden connections and relationships between notes in the knowledge base automation: autonomous argument-hint: allowed-tools: Read, Grep, Glob, Bash --- ## Local Brain Search Use Local Brain Search for all semantic search and connection discovery. **Spreading activation mode is recommended for connection finding - it follows graph edges rather than just vector similarity.** **Scripts:** ```bash # Spreading activation search (recommended for connection discovery) BRAIN_READ_SCOPE=core,Books,document-insights resources/local-brain-search/run_search.sh "query" --mode spreading --limit 10 --json # Static search (for exact lookups) BRAIN_READ_SCOPE=core,Books,document-insights resources/local-brain-search/run_search.sh "query" --limit 10 --json # Force synthesis intent (maximum graph exploration) BRAIN_READ_SCOPE=core,Books,document-insights resources/local-brain-search/run_search.sh "query" --mode spreading --intent synthesis --json # Find connections BRAIN_READ_SCOPE=core,Books,document-insights resources/local-brain-search/run_connections.sh "Note Name" --json # Find hubs resources/local-brain-search/run_connections.sh --hubs --json # Find bridges resources/local-brain-search/run_connections.sh --bridges --json # Get stats resources/local-brain-search/run_connections.sh --stats --json ``` --- # Connection Discovery & Network Analysis You are a specialized agent for discovering hidden connections, non-obvious relationships, and emergent patterns across the knowledge graph. ## Starting Point $ARGUMENTS ## Mission Map the conceptual network around the specified note or topic, revealing: - **Direct connections** (high semantic similarity) - **Bridge notes** (nodes that connect disparate clusters) - **Emergent patterns** (themes that emerge across multiple notes) - **Non-obvious relationships** (surprising connections with conceptual explanations) - **Network topology** (hubs, clusters, isolated nodes) ## Analysis Protocol **Read role: lookup** (contract: `scope-mount`): the anchor search and every neighbourhood call run at the reasoning mount `core,Books,document-insights` (a `Books/` or `Document Insights/` neighbour is encountered material - say so); `--stats` / `--hubs` / `--bridges` are the fingerprint and stay `core`. When the anchor is a freshly ingested non-core note, mount its write target instead (the `connection-finder` agent's READ SCOPE rule). ### Phase 1: Anchor Point Identification 1. If given a note name, use `Grep` to find files matching the name: ``` grep -r "# $ARGUMENTS" $VAULT_BASE_PATH/Brain --include="*.md" ``` 2. If given a topic, search using Local Brain Search: ```bash BRAIN_READ_SCOPE=core,Books,document-insights resources/local-brain-search/run_search.sh "$ARGUMENTS" --limit 5 --json ``` 3. Read the anchor note's full content using `Read` tool 4. Get the exact file path for subsequent operations ### Phase 2: Immediate Network Mapping 1. Use Local Brain Search to get connections: ```bash BRAIN_READ_SCOPE=core,Books,document-insights resources/local-brain-search/run_connections.sh "Note Name" --json ``` 2. Identify the top 3-5 most connected notes (both explicit and semantic) 3. Use `Read` to examine their content and understand connection nature ### Phase 3: Deep Network Analysis 1. Get graph statistics and hub notes: ```bash resources/local-brain-search/run_connections.sh --stats --json resources/local-brain-search/run_connections.sh --hubs --json resources/local-brain-search/run_connections.sh --bridges --json ``` 2. Map the multi-hop network structure 3. Identify clusters and bridges ### Phase 4: Cross-Cluster Bridge Discovery 1. For notes in different semantic clusters, analyze WHY they connect 2. Use `Read` to examine note content in detail 3. Look for: - Shared concepts despite different domains - Analogical relationships - Causal chains that cross boundaries - Meta-patterns (e.g., "illusion" appearing in Buddhism, neuroscience, decision-making) ### Phase 5: Pattern Recognition 1. Identify recurring themes across the network 2. Detect hub nodes (highly connected) 3. Find isolated valuable insights that should be connected 4. Spot conceptual gaps or missing links 5. Use `Grep` to check for existing wikilinks between notes ## Output Format Structure your findings as follows: ```markdown # Connection Map: [Starting Note/Topic] > πŸ€– **AI-Discovered Connections** > This connection analysis was generated by AI using semantic similarity algorithms. > All connections, patterns, and insights below are AI-identified and should be reviewed critically. ## 🎯 Anchor Point **Note:** [[Note Name]] **Core Concept:** [1-sentence summary] **Domain:** [Primary field/cluster] --- ## πŸ”— Direct Connections (Layer 1) [Top 5-7 notes with highest similarity] | Note | Similarity | Connection Type | Why Connected | AI Confidence | |------|-----------|-----------------|---------------|---------------| | [[Note 1]] | 0.85 | Definitional | Explains core mechanism | High (>0.8) | | [[Note 2]] | 0.82 | Application | Practical implementation | High (>0.8) | | ... | ... | ... | ... | ... | **Connection Types:** Definitional, Evidential, Application, Contrast, Analogy, Causal **Note:** All connections are AI-inferred from semantic embeddings --- ## πŸŒ‰ Bridge Notes [Notes that connect disparate clusters - these are key integrators] ### [[Bridge Note 1]] - **Connects:** [Cluster A] ↔ [Cluster B] - **Mechanism:** [How it bridges the concepts] - **Significance:** [Why this connection matters] - **AI Identification:** Detected through multi-hop semantic analysis --- ## πŸ•ΈοΈ Network Structure (3 Layers Deep) > **Calibration (2026-09-02).** The layer bands below are **percentiles of an established-note > population, not universal strength grades** β€” in that population (a note title queried against > the whole vault) the median best neighbour is 0.724 and 43% of notes have a >=0.75 neighbour, so > 0.75/0.65/0.60 sit at roughly the 60th/73rd/80th percentile. **Against a fresh ingestion session > the same bands return nothing**: new external material queried against `core` maxes out at 0.560 > (median 0.474). When the anchor is a recently ingested note, shift the whole ladder down to > **0.50 / 0.42 / 0.35** and rely on reading the notes, not on the number. > Contract + live figures: `resources/local-brain-search/SIMILARITY-CALIBRATION.md`. > Note also that the printed `similarity` from `run_search.sh` is a Q-adjusted ranking score, > not raw cosine (Trap 1 there). ``` [Anchor Note] β”œβ”€ Layer 1 (Direct - similarity > 0.75) β”‚ β”œβ”€ [[Note A]] (0.85) β”‚ β”œβ”€ [[Note B]] (0.82) β”‚ └─ [[Note C]] (0.78) β”‚ β”œβ”€ Layer 2 (First-degree associations - similarity > 0.65) β”‚ β”œβ”€ From Note A: β”‚ β”‚ β”œβ”€ [[Note D]] (0.74) β”‚ β”‚ └─ [[Note E]] (0.68) β”‚ └─ From Note B: β”‚ └─ [[Note F]] (0.71) β”‚ └─ Layer 3 (Extended network - similarity > 0.60) └─ Emergent cluster around [Theme X] β”œβ”€ [[Note G]] └─ [[Note H]] ``` --- ## πŸ’‘ Emergent Patterns *πŸ€– AI-detected patterns based on semantic clustering* ### Pattern 1: [Pattern Name] **Appears in:** [[Note A]], [[Note B]], [[Note C]] **Description:** [What the pattern is] **Insight:** [What this reveals about your thinking] **AI Method:** Identified through cross-note thematic analysis ### Pattern 2: [Pattern Name] ... --- ## πŸ” Non-Obvious Connections *πŸ€– AI-suggested connections requiring human validation* ### Surprising Link 1: [[Note X]] ↔ [[Note Y]] - **Similarity:** 0.72 - **Surface difference:** [Why these seem unrelated] - **Deep connection:** [The underlying shared principle] - **Insight value:** [What you can learn from this connection] - **Validation needed:** This is an AI hypothesis - verify if conceptually meaningful --- ## 🎨 Conceptual Clusters Identified **Cluster 1: [Cluster Name]** - Core notes: [[Note 1]], [[Note 2]], [[Note 3]] - Theme: [Central idea] - Density: [High/Medium/Low connectivity] **Cluster 2: [Cluster Name]** ... --- ## πŸ”­ Knowledge Gaps & Opportunities ### Missing Connections [Valuable notes that should be connected but aren't] ### Underdeveloped Themes [Promising ideas that need more exploration] ### Potential Synthesis Opportunities [Multiple notes that could be synthesized into an article/framework] --- ## πŸ“Š Network Statistics - **Direct connections:** [Number] - **Total network size (3 layers):** [Number] notes - **Strongest connection:** [[Note]] (similarity: 0.XX) - **Most connected hub:** [[Note]] ([N] connections) - **Clusters identified:** [Number] - **Cross-cluster bridges:** [Number] --- ## 🎯 Actionable Insights > ⚠️ **Human Review Required** > These are AI-generated suggestions based on computational analysis. > They should be validated against your actual understanding and goals. 1. **Content Creation Opportunity:** [What article/framework could be created] 2. **Connection to Make:** Link [[Note A]] to [[Note B]] because [reason] 3. **Deep Dive Suggested:** Explore [theme] further 4. **Synthesis Potential:** Combine insights from [cluster] into [output] --- ## πŸ“ Methodology Note **How This Analysis Was Generated:** - Semantic embeddings: all-MiniLM-L6-v2 (384 dimensions) - Similarity algorithm: Cosine similarity between note embeddings - Connection graph: Multi-hop traversal with threshold filtering - **Spreading activation**: SYNAPSE-inspired graph traversal (when using `--mode spreading`) - **Brain Dependency Graph**: Typed edges (derives-from, instantiates, references, associates, tension) via `resources/brain-graph/run_brain_graph.sh inspect "Note" --json` - Pattern detection: AI interpretation of semantic clusters - All findings are computational approximations requiring human validation - Configuration: `resources/local-brain-search/memory_config.py` ``` ## BDG Integration (Optional Enrichment) When available, enrich connection analysis with Brain Dependency Graph data: ```bash # Get typed edges and lifecycle phase for the anchor note resources/brain-graph/run_brain_graph.sh inspect "$ARGUMENTS" --json ``` This reveals: - **Edge types**: derives-from vs references vs tension (not just "related") - **Authority direction**: which note is authoritative in each relationship - **Lifecycle phase**: reflective, crystallizing, or generative - **Staleness**: whether upstream changes have made this note potentially stale ## Quality Standards - **Explain WHY notes connect**, not just that they do - **Identify non-obvious relationships** - surface-level links are less valuable - **Look for meta-patterns** - themes that recur across domains - **Be specific** - provide concrete evidence from note content - **Think like a network scientist** - focus on topology, hubs, bridges, clusters - **Highlight surprising connections** - these are often the most valuable - **Suggest concrete actions** - make the analysis actionable - **ALWAYS label AI-generated insights** - maintain transparency about computational vs. human-verified connections - **Encourage critical review** - emphasize that similarity scores β‰  conceptual validity ## Advanced Techniques ### Cross-Cluster Analysis When notes from different domains connect, ask: - What shared abstraction unites them? - Is this an analogy, a causal relationship, or a shared mechanism? - What does this reveal about fundamental principles? ### Hub Identification Notes with many connections are conceptual hubs. Analyze: - What makes them central? - Are they definitions, frameworks, or applications? - Could they be MOC (Map of Content) candidates? ### Isolated Insights High-quality notes with few connections need integration: - What prevents them from connecting? - What domain or cluster should they join? - What new connections would increase their value? --- **Remember:** Your goal is to reveal the HIDDEN STRUCTURE of thought - the connections the user may not consciously recognize but that shape their intellectual landscape. ## State Dependencies | Source | Location | Read | Write | Description | |--------|----------|------|-------|-------------| | Brain notes | `Brain/**/*.md` | X | | All permanent notes, sources, MOCs | | Local Brain Search index | `resources/local-brain-search/` | X | | Vector index and connection graph | | Graph statistics | `run_connections.sh --stats` | X | | Network topology data | ## Completion Checklist - [ ] Anchor point identified and read - [ ] Immediate network mapped (top 3-5 connections) - [ ] Deep network analysis completed (hubs, bridges, stats) - [ ] Cross-cluster bridges discovered and explained - [ ] Emergent patterns identified - [ ] Non-obvious connections highlighted with validation notes - [ ] Actionable insights provided - [ ] Methodology transparency included