MCPInstall

knowledge-extractor

Extracts key learnings from conversations, debugging sessions, and failed attempts. Use at session end or after solving complex problems to capture insights. Stores discoveries in memory (via amplihack.memory.discoveries), suggests PATTERNS.md updates, and recommends new agent creation. Ensures knowledge persists across sessions via Kuzu memory backend.

Installs
280
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/rysweet/amplihack --skill knowledge-extractor
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads knowledge-extractor automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

Knowledge Extractor Skill

Purpose

This skill automatically extracts, synthesizes, and preserves knowledge from conversations, debugging sessions, failed attempts, and solved problems. It converts ephemeral interactions into persistent organizational knowledge that improves future performance.

When to Use This Skill

  • Session End Analysis: Extract learnings before session context is lost
  • After Complex Debugging: Capture root causes and solutions while fresh
  • Following Failed Attempts: Document what didn't work and why
  • Successful Problem Solving: Preserve solutions for future reuse
  • New Pattern Discovery: Identify patterns that should be documented
  • Repeated Workflows: Recognize when to create new specialized agents
  • Cross-Session Learning: Build organizational memory from individual sessions

Core Philosophy: Knowledge Preservation

Session Context: Ephemeral conversation context that will be lost without active preservation Persistent Knowledge: Structured learnings that improve future performance Pattern Recognition: Identifying when solutions are repeated and should be automated Organizational Growth: Converting individual learning into system-wide improvement

Knowledge Extraction Framework

Three Types of Knowledge Extraction

1. Discoveries - Novel Insights and Root Causes

What it captures: Problems encountered, root causes identified, solutions implemented

When to extract:

  • After solving a complex bug
  • When debugging reveals unexpected behavior
  • When discovering wrong assumptions
  • After identifying missing functionality
  • When learning why something failed

Format for DISCOVERIES.md:

## [Brief Title] (YYYY-MM-DD)

### Issue

What problem or challenge was encountered?

### Root Cause

Why did this happen? What was the underlying issue?

### Solution

How was it resolved? Include code examples if relevant.

### Key Learnings

What insights were gained? What should be remembered?

### Prevention

How can this be avoided in the future?

Quality Criteria:

  • ✅ Specific problem, not generic advice
  • ✅ Root cause clearly identified
  • ✅ Working solution included
  • ✅ Learning generalized for reuse
  • ✅ Prevention strategy documented

2. Patterns - Reusable Solutions

What it captures: Proven solutions to recurring problems, architectural approaches, design patterns

When to extract:

  • After solving a problem similar to known patterns
  • When recognizing a repeated problem type
  • When implementing a proven solution
  • When discovering a best practice that works
  • When solution applies across multiple contexts

Format for PATTERNS.md:

## Pattern: [Name]

### Challenge

What problem does this pattern solve?

### Solution

How does the pattern work? Include code/examples.

### Key Points

- Main insight 1
- Main insight 2
- When to use / when not to use

### When to Use

Specific scenarios where this pattern applies.

### Real Impact

Where has this pattern been used successfully?

### Related Patterns

Links to similar or complementary patterns.

Quality Criteria:

  • ✅ General enough to apply to multiple situations
  • ✅ Problem clearly defined
  • ✅ Solution has proven track record
  • ✅ Working code examples
  • ✅ Clear when/when-not-to-use guidance

3. Agent Creation - Automation of Repeated Workflows

What it captures: Workflows that are repeated frequently, specialized expertise areas, complex multi-step processes

When to extract:

  • After performing the same workflow 2-3 times
  • When recognizing a specialized skill area
  • When workflow has clear inputs/outputs
  • When automating would save significant time
  • When problem domain is narrow and well-defined

Agent Creation Trigger Checklist:

  • Same workflow repeated 2+ times
  • Workflow takes 30+ minutes to execute
  • Workflow has clear specialized focus
  • Workflow can be automated with current tools
  • Problem domain is narrow and well-defined
  • Would be high-value to automate

Example Agent Creation:

## Recommended New Agent: [domain]-[specialty]

### Problem

What repeated workflow would this agent handle?

### Scope

What's in scope | What's explicitly out of scope

### Inputs

What information does the agent need?

### Process

Step-by-step workflow the agent follows

### Outputs

What does the agent produce?

### Value

How much time/effort does this save?

### Integration

Where in the workflow does this fit?

Step-by-Step Extraction Process

Step 1: Session Analysis (5 minutes)

Review entire conversation/session:

1. What was the original problem/request?
2. What approaches were tried?
3. Which attempts failed and why?
4. What succeeded and why?
5. What was learned in the process?
6. What surprised you?
7. What took longer than expected?
8. What would have helped?

Step 2: Pattern Recognition (5 minutes)

Identify patterns in the work:

1. Have I seen this problem before? (→ DISCOVERIES)
2. Is this a generalizable solution? (→ PATTERNS)
3. Would this be worth automating? (→ AGENT)
4. What was the root cause? (Why, not just what)
5. What should others know about this?
6. What should be remembered to avoid repetition?

Step 3: Knowledge Extraction (10 minutes)

Extract and structure knowledge:

For DISCOVERIES.md:

  • Specific issue encountered
  • Root cause analysis
  • Solution implemented
  • Key learnings generalized
  • Prevention strategy

For PATTERNS.md:

  • Problem the pattern solves
  • How the pattern works
  • When to use / when not to use
  • Working code examples
  • Related patterns

For New Agent:

  • Repeated workflow identified
  • Clear scope and boundaries
  • Input/output requirements
  • Step-by-step process
  • Expected value/time savings

Step 4: Integration (3 minutes)

Place knowledge in correct locations:

Memory → Store discovery using `amplihack memory store-discovery`
PATTERNS.md → New pattern in appropriate section
Agent → Create in .claude/agents/amplihack/specialized/

Step 5: Validation (2 minutes)

Ensure quality:

[ ] Entry is specific, not generic
[ ] Entry follows template format
[ ] Examples/code provided
[ ] Quality sufficient for reuse
[ ] Grammar and clarity checked
[ ] Related items cross-referenced

Usage Examples

Example 1: Extract Discovery After Bug Fix

Scenario: Just spent 45 minutes debugging why pre-commit hooks weren't working

User: Extract what we learned from debugging the pre-commit issue.

Claude:
1. Analyzes conversation showing:
   - Initial problem: hooks appeared to run but didn't modify files
   - False leads: blamed merge conflicts, tool versions
   - Root cause found: Hooks couldn't write to files due to cloud sync lock
   - Solution: Added exponential backoff retry logic
   - Time to discover: 45 minutes

2. Creates DISCOVERIES.md entry:
   - Issue: Pre-commit hooks silently failing
   - Root Cause: Cloud sync (OneDrive) file locks
   - Solution: Exponential backoff retry (0.1s, 0.2s, 0.4s...)
   - Key Learning: Cloud sync issues silent - need defensive coding
   - Prevention: Add retry logic for file I/O, test with cloud storage

3. Offers to also:
   - Add pattern for "Resilient File I/O" to PATTERNS.md
   - Suggest new agent for cloud-sync issue detection

Example 2: Extract Pattern from Successful Implementation

Scenario: Just finished implementing module regeneration strategy

User: Extract the pattern we discovered for building regeneratable modules.

Claude:
1. Analyzes implementation showing:
   - Clear __all__ exports defining public interface
   - Self-contained module structure
   - Type-hinted functions with docstrings
   - Comprehensive test coverage
   - Working examples

2. Creates PATTERNS.md entry:
   - Pattern: Module Regeneration Structure
   - Challenge: Modules become tightly coupled, hard to regenerate
   - Solution: Brick & studs design with __all__ public API
   - Key Points: Clear contracts, single responsibility, testable behavior
   - When to Use: Any utility module, anything that might be regenerated
   - Real Impact: Enables AI to rebuild modules without breaking system

3. Cross-references:
   - Relates to "Bricks & Studs Module Design"
   - Enables "Builder Agent Workflow"

Example 3: Identify New Agent Creation Opportunity

Scenario: Just debugged CI failure using 5-step diagnostic process for 3rd time

User: We keep using the same CI debugging process. Should we automate it?

Claude:
1. Analyzes past sessions:
   - Session 1: 45 minutes CI debugging (version mismatch issue)
   - Session 2: 30 minutes CI debugging (pre-commit hook issue)
   - Session 3: 25 minutes CI debugging (merge conflict issue)
   - Pattern: Same 5-step process each time

2. Recommends new agent:
   - Name: ci-diagnostic-workflow
   - Problem: Each CI failure requires manual diagnosis, takes 30-45 min
   - Scope: Diagnoses CI failures, suggests fixes (doesn't auto-fix)
   - Process:
     1. Check environment (Python version, tool versions)
     2. Analyze CI logs for error patterns
     3. Detect common issues (conflicts, missing deps)
     4. Suggest solutions
     5. Coordinate parallel diagnostic agents
   - Value: Reduce diagnosis time from 45 min → 15 min

3. Proposes creating:
   - .claude/agents/amplihack/ci-diagnostic-workflow.md
   - Can delegate to: fix-agent for implementation

Example 4: Multi-Level Extraction

Scenario: Complex architectural decision with multiple learnings

User: Extract everything we learned from deciding on the memory architecture.

Claude:
1. Session involved:
   - 2 failed approaches (too complex, wrong threat model)
   - 1 successful approach (simple, fits threat model)
   - Discovery of meta-pattern for architecture decisions

2. Creates THREE extractions:

   DISCOVERIES.md:
   - Issue: Pattern Applicability Analysis
   - Root Cause: Importing patterns without validating threat match
   - Solution: Five-phase applicability analysis framework
   - Learning: Threat model match is critical first check

   PATTERNS.md:
   - New Pattern: Threat Model Precision Principle
   - Challenge: Fault tolerance mechanisms mismatch problem space
   - Solution: Validate threat model before adopting patterns
   - When: Before adopting any "best practice" from different domain

   Recommended Agent:
   - Name: pattern-applicability-analyzer
   - Automate: Quick assessment of pattern applicability
   - Value: Prevent adopting wrong patterns early

Knowledge Quality Checklist

Before finalizing an extraction, verify:

For DISCOVERIES.md

  • Issue is specific, not generic ("Pre-commit hooks failing" not "Tools broken")
  • Root cause is identified (Why, not just what)
  • Solution is working/proven
  • Learning is generalized (applies beyond this specific case)
  • Prevention strategy is actionable
  • No speculation or future-proofing
  • Code examples provided where relevant

For PATTERNS.md

  • Problem is clear and recognizable
  • Solution has proven track record (used 2+ times successfully)
  • When/when-not-to-use guidance is clear
  • Pattern is general enough for reuse
  • Code examples are working and clear
  • Related patterns are cross-referenced
  • Real impact or usage is documented

For New Agent

  • Workflow has been repeated 2+ times
  • Would save 30+ minutes per execution
  • Problem domain is narrow and well-defined
  • Inputs and outputs are clear
  • Step-by-step process documented
  • High-value worth the automation effort
  • Clear where it fits in workflow

Integration with System

Discovery Memory Lifecycle

  1. Extraction: Stored in memory via store_discovery() during session
  2. Visibility: Retrieved by get_recent_discoveries() at session start
  3. Action: Agents can query memory when solving similar problems
  4. Prevention: Prevents repeating same mistakes across sessions
  5. Evolution: Updated when better solution found

PATTERNS.md Lifecycle

  1. Extraction: Added to PATTERNS.md when pattern proven
  2. Catalog: Becomes part of available patterns library
  3. Usage: Referenced in relevant agent instructions
  4. Teaching: Used in documentation and onboarding
  5. Refinement: Improved as more usage data collected

Agent Creation Lifecycle

  1. Recommendation: Identified as valuable automation candidate
  2. Proposal: Presented to system with expected value
  3. Creation: New agent created with clear scope/boundaries
  4. Integration: Added to delegation triggers in CLAUDE.md
  5. Usage: Available for orchestration across workflows

Real-World Impact Examples

Impact 1: Prevent Wasted Debugging Time

Without knowledge extraction: Repeat same 45-minute debugging process With extraction: Retrieve from memory, fix in 10 minutes

Impact 2: Faster Solution Discovery

Without extraction: Rediscover solutions from scratch With extraction: Reference PATTERNS.md, apply known solution

Impact 3: Automated Workflows

Without extraction: Manual CI debugging every time (30-45 min) With new agent: Automated diagnosis in 5-10 minutes

Common Extraction Mistakes to Avoid

Mistake 1: Too Generic

BAD: "Learned that good error handling is important"
GOOD: "Discovered cloud sync issues cause silent file I/O failures - need exponential backoff retry"

Mistake 2: Missing Root Cause

BAD: "CI failed, fixed it"
GOOD: "CI failed because version mismatch (local 3.12 vs CI 3.11) - fixed by updating pyproject.toml version constraint"

Mistake 3: No Actionable Learning

BAD: "This was complicated"
GOOD: "Multi-layer sanitization at every data transformation prevents credential leakage"

Mistake 4: Over-Generalizing Pattern

BAD: "Always use caching everywhere"
GOOD: "Use smart caching with lifecycle management for expensive operations where results may become stale"

Mistake 5: Agent Creation Without ROI

BAD: "Create agent for task that happens once per quarter"
GOOD: "Create agent for CI debugging workflow that happens 2-3x per week and takes 30-45 minutes"

Extraction Prompts

Use these prompts to trigger knowledge extraction:

Extract Discoveries

Extract what we discovered/learned from this session.
Focus on: root causes, unexpected behaviors, solutions that worked.
Update DISCOVERIES.md appropriately.

Extract Patterns

What patterns should we capture for future reuse?
These should be proven solutions that apply to multiple situations.
Update PATTERNS.md appropriately.

Identify Agent Opportunities

Should we create a new agent to automate any repeated workflows?
Check if any workflow has been done 2+ times and takes 30+ minutes.
Recommend creation with scope and value calculation.

Full Extraction

Perform complete knowledge extraction on this session.
Extract: discoveries, patterns, and agent creation recommendations.
Verify quality and update all three knowledge bases.

Integration Points

With Document-Driven Development

  • Use knowledge extraction to update specs and documentation
  • Extract patterns to guide next implementation

With Agent Delegation

  • Extract when delegating reveals new specializations needed
  • Create agents based on repeated delegation patterns

With Pre-Commit Analysis

  • Extract discoveries about CI/CD and testing patterns
  • Update PATTERNS.md with new approaches discovered

With Session Reflection

  • Automatic knowledge extraction at session end
  • Preserve learnings before context compaction

Success Metrics

Track effectiveness of knowledge extraction:

  • Discoveries Reused: How often DISCOVERIES.md prevents mistakes (target: 80%+)
  • Patterns Applied: How often PATTERNS.md enables faster solutions (target: 70%+)
  • Agent Usage: How often extracted agents used vs manual approaches (target: 60%+)
  • Time Saved: Cumulative time saved by reusing knowledge (target: hours/week)
  • Repeated Mistakes: Reduction in making same mistake twice (target: 95%+)

Future Evolution

This skill should grow based on:

  • What types of knowledge are most valuable to extract?
  • What prevents good extraction?
  • How can we make extractions more actionable?
  • What knowledge sources are underutilized?
  • How can we better surface relevant knowledge?

Document learnings in ~/.amplihack/.claude/context/DISCOVERIES.md.

FAQ

What does the knowledge-extractor skill do?

Extracts key learnings from conversations, debugging sessions, and failed attempts. Use at session end or after solving complex problems to capture insights. Stores discoveries in memory (via amplihack.memory.discoveries), suggests PATTERNS.md updates, and recommends new agent creation. Ensures knowledge persists across sessions via Kuzu memory backend.

How do I install knowledge-extractor?

Run npx skills add https://github.com/rysweet/amplihack --skill knowledge-extractor in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/knowledge-extractor/ (personal) or .claude/skills/knowledge-extractor/ (project).

Which AI agents can use knowledge-extractor?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is knowledge-extractor safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains knowledge-extractor?

It is published by rysweet in rysweet/amplihack. It has 280 recorded installs.

More from rysweet/amplihack

View all →

cybersecurity-analyst

rysweet/amplihack

Analyzes events through cybersecurity lens using threat modeling, attack surface analysis, defense-in-depth, zero-trust architecture, and risk-based frameworks (CIA triad, STRIDE, MITRE ATT&CK). Provides insights on vulnerabilities, attack vectors, defense strategies, incident response, and security posture. Use when: Security incidents, vulnerability assessments, threat analysis, security architecture, compliance. Evaluates: Confidentiality, integrity, availability, threat actors, attack patterns, controls, residual risk.

Security1.5K installs

lawyer-analyst

rysweet/amplihack

Analyzes events through legal lens using statutory interpretation, case law analysis, legal reasoning, constitutional principles, and multiple legal frameworks (common law, civil law, international law). Provides insights on legal rights, obligations, liabilities, remedies, and compliance requirements. Use when: Legal disputes, contracts, regulations, compliance, rights analysis, liability assessment. Evaluates: Legal obligations, rights, liabilities, remedies, precedent, statutory authority, constitutionality.

Business & Finance688 installs

psychologist-analyst

rysweet/amplihack

Analyzes events through psychological lens using cognitive psychology, social psychology, developmental psychology, clinical psychology, and neuroscience. Provides insights on behavior, cognition, emotion, motivation, group dynamics, decision-making biases, mental health, and individual differences. Use when: Behavioral patterns, decision-making, group behavior, mental health, leadership, persuasion, trauma, development. Evaluates: Cognitive processes, emotional responses, motivations, biases, group dynamics, personality, mental states.

mermaid-diagram-generator

rysweet/amplihack

Converts architecture descriptions, module specs, or workflow docs into Mermaid diagrams. Use when visualizing brick module relationships, workflows (DDD, investigation), or system architecture. Supports: flowcharts, sequence diagrams, class diagrams, state machines, entity relationship diagrams, and Gantt charts. Generates valid Mermaid syntax for embedding in markdown docs.

Docs & Writing428 installs

pptx

rysweet/amplihack

Presentation creation, editing, and analysis. When Claude needs to work with presentations (.pptx files) for: (1) Creating new presentations, (2) Modifying or editing content, (3) Working with layouts, (4) Adding comments or speaker notes, or any other presentation tasks

Docs & Writing420 installs

economist-analyst

rysweet/amplihack

Analyzes events through economic lens using supply/demand, incentive structures, market dynamics, and multiple schools of economic thought (Classical, Keynesian, Austrian, Behavioral). Provides insights on market impacts, resource allocation, policy implications, and distributional effects. Use when: Economic events, policy changes, market shifts, financial crises, regulatory decisions. Evaluates: Incentives, efficiency, opportunity costs, market failures, systemic risks.

Business & Finance378 installs

Popular backend & apis skills

View category →

find-skills

vercel-labs/skills

Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.

OfficialBackend & APIs4.1M installs

entra-app-registration

microsoft/azure-skills

Guides Microsoft Entra ID app registration, OAuth 2.0 authentication, and MSAL integration. USE FOR: create app registration, register Azure AD app, configure OAuth, set up authentication, add API permissions, generate service principal, MSAL example, console app auth, Entra ID setup, Azure AD authentication. DO NOT USE FOR: Key Vault secrets (use azure-keyvault-expiration-audit), general Azure resource security guidance.

OfficialBackend & APIs566.7K installs

This skill should be used when the user wants to "write agent code", "build an agent with ADK", "add a tool", "create a callback", "define an agent", "use state management" — in a project that needs ADK (Agent Development Kit) API patterns and code examples. It provides a quick reference for agent types, tool definitions, orchestration patterns, callbacks, state management, the graph Workflow API, and reference recipes to study. Do NOT use for scaffolding (use google-agents-cli-scaffold) or deployment (use google-agents-cli-deploy).

Backend & APIs514.8K installs

embedded-captions

heygen-com/hyperframes

Add captions or subtitles to an existing single-subject talking-head video without editing the footage. Use for plain verbatim captions, cinematic captions embedded behind the subject, VFX captions, “炸/特效/酷炫字幕,” or a named identity from the 35-style catalog. Route by visual identity, not by backend engine. The quiet anchor rail is the default; embed every word only when the user explicitly wants a fully cinematic treatment. The workflow runs locally end to end, including transcription and subject matting; split multi-shot footage before applying it.

Backend & APIs453.3K installs

entra-agent-id

microsoft/azure-skills

Provision Microsoft Entra Agent Identity Blueprints, BlueprintPrincipals, and per-instance Agent Identities via Microsoft Graph, and configure OAuth 2.0 token exchange (fmipath, OBO, cross-tenant) including the Microsoft Entra SDK for AgentID sidecar. USE FOR: Agent Identity Blueprint, BlueprintPrincipal, agent OAuth, fmipath token exchange, agent OBO, Workload Identity Federation for agents, polyglot agent auth, Microsoft.Identity.Web.AgentIdentities. DO NOT USE FOR: standard Entra app registration (use entra-app-registration), Microsoft Foundry agent authoring (use microsoft-foundry).

OfficialBackend & APIs336.6K installs

neon

neondatabase/agent-skills

Overview of Neon, a complete set of cloud backend primitives around Lakebase Postgres: Auth, Object Storage, Functions, the AI Gateway, and Realtime. Start here to choose Neon for undecided login, files, APIs, and LLM calls, set up the CLI or MCP server, and follow the branch-first workflow. Use when building an app or backend on Neon, or when "Neon" or "Lakebase Postgres" is mentioned. Child skill neon-postgres wins for an existing DATABASEURL, SQL, schema, inspect, or search. Child skill neon-auth wins for login, users, sessions, identity routing, and Managed Better Auth setup. Child skill neon-realtime wins for live queries in reactive apps and agents. Also use for object storage, S3, buckets, serverless functions, function triggers, cron, AI gateway, LLM calls, realtime, logs, Loki, Grafana, observability, postgres, database, backend, Claimable Neon, neon.new, or a no-signup database.

Backend & APIs237.1K installs