Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Contextual reasoning and knowledge retrieval system that indexes documents, provides semantic search capabilities, analyzes meeting transcripts, tracks decision history, and builds knowledge graphs for intelligent information retrieval and contextual insights.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 369% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 402% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 232% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 521% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 327% | 0% |
The Knowledge Base Server skill provides comprehensive contextual reasoning and knowledge retrieval capabilities. It indexes documents, performs semantic search, analyzes meeting transcripts, tracks decision history, and builds knowledge graphs to provide intelligent information retrieval and contextual insights.
bash# Index a single document skill invoke knowledge-base index-document --document-path docs/runbook.md --document-type runbook # Index entire directory skill invoke knowledge-base index-directory --directory-path ./docs --recursive # Batch index with metadata skill invoke knowledge-base index-batch --config indexing-config.yaml # Reindex existing documents skill invoke knowledge-base reindex --document-type runbook --force
bash# Semantic search skill invoke knowledge-base search --query "database troubleshooting" --search-type semantic --limit 10 # Keyword search skill invoke knowledge-base search --query "AWS S3" --search-type keyword --document-types runbook,policy # Hybrid search with filters skill invoke knowledge-base search --query "incident response" --search-type hybrid \ --document-types runbook,meeting_transcript --similarity-threshold 0.7 # Contextual search skill invoke knowledge-base contextual-search --topic "cloud migration" --context-type historical_decisions
bash# Analyze meeting transcript skill invoke knowledge-base analyze-meeting --transcript-path meetings/2024-03-15-team-meeting.txt # Extract decisions only skill invoke knowledge-base extract-decisions --transcript-path meetings/strategy-session.txt # Generate meeting summary skill invoke knowledge-base summarize-meeting --transcript-path meetings/retrospective.txt --include-action-items # Batch analyze meetings skill invoke knowledge-base batch-analyze-meetings --directory-path meetings/ --date-range 2024-01-01:2024-03-31
bash# Track new decision skill invoke knowledge-base track-decision --decision-id DEC-001 \ --title "Adopt Kubernetes for new services" \ --description "Decision to migrate all new microservices to Kubernetes" \ --decision-maker "CTO" --date "2024-03-15" \ --context "Cost optimization and scalability requirements" # Update decision with related decisions skill invoke knowledge-base relate-decisions --decision-id DEC-001 \ --related-decisions DEC-002,DEC-003 # Search decision history skill invoke knowledge-base search-decisions --query "cloud infrastructure" --date-range 2024-01-01:2024-12-31 # Generate decision timeline skill invoke knowledge-base decision-timeline --project "web-platform" --format HTML
bash# Add entity to knowledge graph skill invoke knowledge-base add-entity --entity-id "kubernetes" --entity-type technology \ --name "Kubernetes" --properties '{"category": "orchestration", "vendor": "CNCF"}' # Add relationship skill invoke knowledge-base add-relationship --from-entity "kubernetes" --to-entity "docker" \ --relationship-type "builds_on" --properties '{"strength": "strong"}' # Query knowledge graph skill invoke knowledge-base query-graph --query '{"entity": "kubernetes", "depth": 2}' # Get context for entity skill invoke knowledge-base get-context --entity "kubernetes" --context-type related_documents
bash# Get historical context skill invoke knowledge-base get-context --topic "microservices" --context-type historical_decisions \ --time-range 6m --include-related # Get expertise areas skill invoke knowledge-base get-expertise --topic "database optimization" --include-experts # Get recent changes skill invoke knowledge-base recent-changes --topic "security policies" --time-range 30d # General context retrieval skill invoke knowledge-base context --topic "cloud migration" --depth 3 --breadth 5
bash# Vector Database (for production use) VECTOR_DB_URL=your_vector_database_url VECTOR_DB_API_KEY=your_vector_db_api_key # Document Processing DOCUMENT_PROCESSING_TIMEOUT=300 MAX_DOCUMENT_SIZE=50MB EMBEDDING_MODEL=text-embedding-ada-002 # Search Configuration DEFAULT_SEARCH_LIMIT=10 SIMILARITY_THRESHOLD=0.7 MAX_SEARCH_RESULTS=100 # Storage Configuration KNOWLEDGE_BASE_PATH=/data/knowledge-base BACKUP_SCHEDULE="0 2 * * *" # Daily at 2 AM RETENTION_DAYS=365
yaml# .claude/skills/knowledge-base-server/config.yaml document_processing: supported_formats: - markdown - text - pdf - docx - html - json - yaml chunking: strategy: semantic max_chunk_size: 1000 overlap: 200 min_chunk_size: 100 embeddings: model: text-embedding-ada-002 dimension: 1536 batch_size: 100 cache_embeddings: true entity_extraction: enabled: true entities: - person - organization - technology - project - decision - policy confidence_threshold: 0.7 search_configuration: semantic_search: enabled: true similarity_threshold: 0.7 max_results: 50 rerank_results: true keyword_search: enabled: true boost_recent: true boost_important: true fuzzy_matching: true hybrid_search: semantic_weight: 0.6 keyword_weight: 0.4 fusion_algorithm: reciprocal_rank_fusion filters: document_types: - runbook - meeting_transcript - decision_record - policy - technical_doc date_ranges: recent: 7d month: 30d quarter: 90d year: 365d knowledge_graph: node_types: - technology - person - organization - project - decision - concept - location relationship_types: - uses - implements - decides_on - owns - depends_on - relates_to - manages - documents graph_algorithms: - page_rank - community_detection - shortest_path - centrality_measures visualization: enabled: true layout: force_directed node_size_by: importance edge_width_by: strength meeting_analysis: transcript_processing: speaker_diarization: true sentiment_analysis: true topic_modeling: true action_item_extraction: true decision_extraction: patterns: - "decided to" - "agreed that" - "concluded" - "resolved" confidence_threshold: 0.8 require_context: true action_item_extraction: patterns: - "will" - "should" - "need to" - "action item" assignee_extraction: true due_date_extraction: true summarization: executive_summary: true key_decisions: true action_items: true participant_contributions: true decision_tracking: required_fields: - title - description - decision_maker - date optional_fields: - context - alternatives_considered - rationale - impact - stakeholders - implementation_status relationship_types: - supersedes - implements - relates_to - conflicts_with lifecycle_stages: - proposed - decided - implemented - evaluated - archived indexing_configuration: auto_indexing: enabled: true watch_directories: - ./docs - ./meetings - ./decisions file_patterns: - "*.md" - "*.txt" - "*.pdf" - "*.docx" ignore_patterns: - "*.tmp" - "*.bak" - ".*" scheduling: full_reindex: "0 3 * * 0" # Weekly on Sunday at 3 AM incremental_update: "0 * * * *" # Every hour cleanup: "0 4 * * *" # Daily at 4 AM performance: batch_size: 50 parallel_workers: 4 memory_limit: 2GB timeout: 300 api_configuration: endpoints: search: /api/v1/search documents: /api/v1/documents decisions: /api/v1/decisions graph: /api/v1/graph context: /api/v1/context authentication: enabled: true method: api_key rate_limiting: true requests_per_minute: 100 caching: enabled: true ttl: 3600 # 1 hour max_size: 1GB strategy: lru
This skill integrates with the knowledge-base MCP server for enhanced capabilities:
index_document: Index documents for knowledge retrievalsearch_knowledge: Search knowledge base using semantic or keyword searchanalyze_meeting_transcript: Analyze meeting transcripts for decisions and action itemstrack_decision_history: Track and retrieve decision history and contextbuild_knowledge_graph: Build and query knowledge graph relationshipsget_contextual_information: Get contextual information for topicsjavascript// Using the MCP server directly const searchResults = await mcp.call('search_knowledge', { query: 'database performance optimization', search_type: 'semantic', document_types: ['runbook', 'technical_doc'], limit: 10, similarity_threshold: 0.7 }); const meetingAnalysis = await mcp.call('analyze_meeting_transcript', { transcript_path: 'meetings/2024-03-15-db-team.txt', extract_decisions: true, extract_action_items: true, generate_summary: true }); const decisionContext = await mcp.call('get_contextual_information', { topic: 'cloud migration strategy', context_type: 'historical_decisions', time_range: '6m', include_related: true });
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Document Sources│ │ Processing Engine │ │ Search Engine │
│ │ │ │ │ │
│ • File System │───▶│ • Text Processing│───▶│ • Vector Search │
│ • APIs │ │ • Entity Extract │ │ • Keyword Search │
│ • Databases │ │ • Embedding Gen │ │ • Hybrid Search │
│ • Web Crawlers │ │ • Chunking │ │ • Ranking │
└─────────────────┘ └──────────────────┘ └─────────────────┘
│ │ │
▼ ▼ ▼
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Knowledge Graph │ │ Meeting Analysis │ │ Context Engine │
│ │ │ │ │ │
│ • Entity Mapping│ │ • Transcript Proc│ │ • Context Retrieval│
│ • Relationship │ │ • Decision Extract│ │ • Reasoning │
│ • Graph Queries │ │ • Action Items │ │ • Insight Gen │
│ • Visualization │ │ • Summarization │ │ • Recommendations│
└─────────────────┘ └──────────────────┘ └─────────────────┘pythondef semantic_search(query, documents, threshold=0.7, limit=10): """ Perform semantic search using vector similarity """ query_embedding = generate_embedding(query) similarities = [] for doc in documents: similarity = cosine_similarity(query_embedding, doc.embedding) if similarity >= threshold: similarities.append((doc, similarity)) # Sort by similarity and return top results similarities.sort(key=lambda x: x[1], reverse=True) return similarities[:limit]
pythondef hybrid_search(query, documents, semantic_weight=0.6, keyword_weight=0.4): """ Combine semantic and keyword search results """ semantic_results = semantic_search(query, documents) keyword_results = keyword_search(query, documents) # Reciprocal rank fusion all_docs = set(doc for doc, _ in semantic_results + keyword_results) fused_scores = {} for doc in all_docs: semantic_rank = next((i for i, (d, _) in enumerate(semantic_results) if d == doc), float('inf')) keyword_rank = next((i for i, (d, _) in enumerate(keyword_results) if d == doc), float('inf')) semantic_score = 1 / (semantic_rank + 1) if semantic_rank != float('inf') else 0 keyword_score = 1 / (keyword_rank + 1) if keyword_rank != float('inf') else 0 fused_scores[doc] = semantic_weight * semantic_score + keyword_weight * keyword_score return sorted(fused_scores.items(), key=lambda x: x[1], reverse=True)
pythondef extract_decisions(transcript): """ Extract decisions from meeting transcript using pattern matching and NLP """ decisions = [] # Pattern-based extraction decision_patterns = [ r'(decided|agreed|concluded|resolved|determined)\s+to\s+(.+)', r'it\s+was\s+(decided|agreed)\s+that\s+(.+)', r'we\s+(decide|agree)\s+to\s+(.+)' ] for sentence in transcript.sentences: for pattern in decision_patterns: match = re.search(pattern, sentence.text, re.IGNORECASE) if match: decision = { 'text': sentence.text, 'decision': match.group(2), 'confidence': calculate_confidence(match, sentence), 'context': get_context(sentence, transcript), 'timestamp': sentence.timestamp } decisions.append(decision) # Filter by confidence threshold return [d for d in decisions if d['confidence'] >= 0.7]
pythondef extract_action_items(transcript): """ Extract action items with assignees and due dates """ action_items = [] action_patterns = [ r'(\w+)\s+(will|should|needs?\s+to)\s+(.+)', r'action\s+item:\s*(.+)', r'todo:\s*(.+)' ] for sentence in transcript.sentences: for pattern in action_patterns: match = re.search(pattern, sentence.text, re.IGNORECASE) if match: action_item = { 'text': sentence.text, 'action': match.group(-1), 'assignee': extract_assignee(match, sentence), 'due_date': extract_due_date(match, sentence), 'confidence': calculate_confidence(match, sentence) } action_items.append(action_item) return action_items
pythondef extract_relationships(text, entities): """ Extract relationships between entities in text """ relationships = [] # Dependency parsing for relationship extraction doc = nlp(text) for token in doc: if token.dep_ in ['nsubj', 'dobj', 'pobj']: head_entity = find_entity(token.head.text, entities) child_entity = find_entity(token.text, entities) if head_entity and child_entity: relationship = { 'from_entity': head_entity['id'], 'to_entity': child_entity['id'], 'relationship_type': map_dependency_to_relationship(token.dep_), 'confidence': calculate_relationship_confidence(token), 'context': token.sent.text } relationships.append(relationship) return relationships
Document Indexing Failures
bash# Check document format support skill invoke knowledge-base check-format --document-path docs/example.pdf # Validate document structure skill invoke knowledge-base validate-document --document-path docs/example.md # Debug indexing process export KNOWLEDGE_BASE_DEBUG=true skill invoke knowledge-base index-document --document-path docs/example.md --debug
Search Quality Issues
bash# Analyze search results skill invoke knowledge-base analyze-search --query "test query" --explain-ranking # Test similarity thresholds skill invoke knowledge-base test-thresholds --query "test query" --range 0.5:0.9 # Evaluate embedding quality skill invoke knowledge-base evaluate-embeddings --sample-documents 100
Knowledge Graph Issues
bash# Check graph consistency skill invoke knowledge-base validate-graph --check-orphans --check-cycles # Analyze entity relationships skill invoke knowledge-base analyze-relationships --entity "kubernetes" # Debug graph construction skill invoke knowledge-base debug-graph --document-path docs/architecture.md
bash# Enable comprehensive debugging export KNOWLEDGE_BASE_DEBUG=true export KNOWLEDGE_BASE_TRACE=true skill invoke knowledge-base search --query "test" --debug --trace --verbose
yaml# .github/workflows/knowledge-base-update.yml name: Update Knowledge Base on: push: paths: - 'docs/**' - 'meetings/**' - 'decisions/**' jobs: update-knowledge-base: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Update Knowledge Base run: | skill invoke knowledge-base index-directory --directory-path ./docs --recursive skill invoke knowledge-base index-directory --directory-path ./meetings --recursive skill invoke knowledge-base index-directory --directory-path ./decisions --recursive - name: Validate Knowledge Base run: | skill invoke knowledge-base validate --check-consistency --check-orphans - name: Generate Knowledge Base Report run: | skill invoke knowledge-base generate-report --format HTML --output knowledge-base-report.html - name: Upload Report uses: actions/upload-artifact@v2 with: name: knowledge-base-report path: knowledge-base-report.html
javascript// Slack bot for knowledge search app.command('/knowledge', async ({ command, ack, say }) => { await ack(); const query = command.text; try { const results = await skill.invoke('knowledge-base', { action: 'search', query: query, search_type: 'hybrid', limit: 5 }); const blocks = results.map((result, index) => ({ type: 'section', text: { type: 'mrkdwn', text: `*${index + 1}. ${result.title}*\n${result.excerpt}\n_Relevance: ${result.similarity.toFixed(2)}_` } })); await say({ text: `📚 Knowledge Search Results for "${query}"`, blocks }); } catch (error) { await say(`❌ Error searching knowledge base: ${error.message}`); } });
javascript// REST API for knowledge base operations app.get('/api/knowledge/search', async (req, res) => { const { query, type = 'hybrid', limit = 10 } = req.query; try { const results = await skill.invoke('knowledge-base', { action: 'search', query: query, search_type: type, limit: parseInt(limit) }); res.json({ query, type, total_results: results.length, results }); } catch (error) { res.status(500).json({ error: error.message }); } }); app.post('/api/knowledge/documents', async (req, res) => { const { document_path, document_type, metadata } = req.body; try { const result = await skill.invoke('knowledge-base', { action: 'index-document', document_path: document_path, document_type: document_type, metadata: metadata }); res.json(result); } catch (error) { res.status(500).json({ error: error.message }); } });
/docs/knowledge-base-server.md/examples/knowledge-base/#knowledge-base Slack channelThis skill is licensed under the MIT License. See LICENSE file for details.
Other measured skills in the registry, with their headline benchmark lift.