Skip to main content

Global Learnings

Global Learnings is NC's knowledge management system. It automatically crawls your project documentation (CLAUDE.md, learnings, architecture docs), indexes it into a searchable database, and provides both keyword and AI-powered semantic search across all your projects.

How It Works

Development Projects

├── project-a/
│ ├── CLAUDE.md
│ ├── LEARNINGS/*.md
│ └── docs/00-09/*.md
├── project-b/
│ └── ...


┌──────────────────────────────────────────┐
│ Global Learnings System │
│ │
│ ┌──────────┐ ┌────────┐ ┌─────────┐ │
│ │ Crawler │ │ Parser │ │ Store │ │
│ │ (project │ │ (MD │ │ (SQLite │ │
│ │ discovery)│ │ sections)│ │ wisdom.db)││
│ └─────┬────┘ └────┬───┘ └────┬────┘ │
│ └─────────────┘ │ │
│ │ │
│ ┌──────────┐ ┌─────┴─────┐ │
│ │ Embedder │ │ Pattern │ │
│ │ (Ollama) │ │ Sync Mgr │ │
│ └──────────┘ └───────────┘ │
└──────────────────────────────────────────┘

The system has two subsystems:

  • Wisdom System - Crawls, indexes, and searches project documentation
  • Learning Manager - Captures insights from Claude Code sessions and syncs patterns across projects

Quick Start

1. Index Your Projects

ncmd wisdom crawl
Crawling projects...
Discovered: 5 projects
Crawling: neural-commander (42 docs)
Crawling: dexinator (18 docs)
Crawling: counterpartytools (25 docs)

Crawl complete in 3.1s
Projects: 5 | Documents indexed: 105

2. Search Your Knowledge

ncmd wisdom search "error handling"
Search Results (6 matches)

1. [architecture] Error Handling Strategy
Project: neural-commander | Source: docs
"Use structured errors with error codes..."

2. [learning] WSL2 Error Handling Gotcha
Project: neural-commander | Source: LEARNINGS
"Discovered that WSL2 process detection..."

3. Generate Embeddings (Pro)

ollama pull nomic-embed-text
ncmd wisdom embed
ncmd wisdom semantic "how to handle errors gracefully"

CLI Commands

CommandDescription
ncmd wisdom crawlIndex all project documentation
ncmd wisdom crawl --project NAMEIndex specific project
ncmd wisdom crawl --forceRe-index everything
ncmd wisdom search <query>Keyword search across all wisdom
ncmd wisdom semantic <query>AI-powered semantic search (Pro)
ncmd wisdom show <project>Project wisdom summary
ncmd wisdom statsWisdom engine statistics
ncmd wisdom contextRelevant wisdom for current project
ncmd wisdom reindex <project>Force re-index specific project
ncmd wisdom embedGenerate embeddings (Pro)

What Gets Crawled

Documents are crawled in priority order:

PriorityPathDescription
1CLAUDE.mdProject instructions for AI
2.claude/*.mdAI context files
3LEARNINGS/**/*.mdCaptured lessons
4docs/00-overview/*.mdOverview documentation
5docs/02-architecture/*.mdArchitecture docs
6docs/06-planning/*.mdPlanning docs
7README.md, ARCHITECTURE.mdStandard files

Excluded: node_modules/, .git/, vendor/, dist/, build/

Projects are discovered by looking for .git, package.json, go.mod, Cargo.toml, pyproject.toml, or CLAUDE.md.

Wisdom Categories

Documents are automatically categorized during crawl:

CategoryDescriptionExample
architectureSystem design, components"Bubbletea TUI framework"
learningLessons, gotchas, tips"WSL2 process detection quirks"
requirementMust/shall constraints"Resource safety requirements"
workflowProcesses, how-to guides"Release deployment process"
integrationAPI, service integration"Ollama embedding integration"
decisionADRs, rationale"Chose SQLite over PostgreSQL"
instructionRules, conventions"Git commit format rules"
statusProgress updates"Sprint 6 progress report"

Categories are inferred from document titles and content automatically.

Semantic Search (Pro)

Generate embeddings for AI-powered search that finds conceptually related content:

# Setup
ollama pull nomic-embed-text
ncmd wisdom embed

# Search by meaning
ncmd wisdom semantic "how to safely stop background processes"
# Finds documents about "graceful shutdown" even without that keyword

The embedder uses nomic-embed-text (768 dimensions) via local Ollama. Falls back to keyword search if Ollama is unavailable.

Pattern Sharing

The Pattern Sync Manager enables cross-project pattern reuse:

# Patterns from one project become available to others
ncmd patterns sync

# Patterns are scored for relevance to your current project
# Based on: language match (40%), framework (30%), tags (20%), usage (10%)

Patterns are deduplicated by SHA256 content hash. Duplicate patterns increment usage count instead of creating copies.

Automatic Learning Capture

When the daemon is running, the Learning Manager automatically captures insights from Claude Code sessions:

  • Messages with role="learning" are captured directly
  • Assistant messages containing keywords ("pattern", "best practice", "gotcha", "solution") are detected and stored
  • Tags are auto-extracted from content

Captured learnings are stored as JSON files in ~/.neural-commander/learnings/.

Storage

~/.neural-commander/
├── wisdom.db # SQLite: crawled docs + embeddings
├── learnings/ # JSON files: session learnings
│ ├── session-abc-001.json
│ └── session-def-002.json
└── patterns/
└── global/
└── patterns.json # Cross-project patterns

Tier Features

FeatureCommunityPro
Wisdom crawlYesYes
Keyword searchYesYes
Project show/statsYesYes
ReindexYesYes
Capture learningsYesYes
Check patternsYesYes
Semantic searchNoYes
Generate embeddingsNoYes
Context-aware wisdomNoYes
Cross-project sharingNoYes
Learning search/statsNoYes

Troubleshooting

"No projects found"

  1. Verify the projects root contains projects with marker files (.git, package.json, etc.)
  2. Force crawl: ncmd wisdom crawl --force

Semantic Search Returns No Results

  1. Check embedding coverage: ncmd wisdom stats
  2. Ensure Ollama is running: curl http://localhost:11434/api/tags
  3. Generate embeddings: ncmd wisdom embed

Search Quality is Poor

  1. Re-crawl after documentation changes: ncmd wisdom crawl
  2. Re-embed: ncmd wisdom embed
  3. Use semantic search for conceptual queries, keyword search for exact terms

Global Learnings integrates with Pattern Extraction for pattern promotion, Prompt Engine for prompt context, and Session Intelligence for session data.