/learn:learn-kbfrom learn
Operator knowledge base management for the Feynman learning loop. Lets operators add, list, query, update, and remove custom knowledge bases (Dify, surreal-memory palace, local files, Firecrawl URLs) that ground the learning loop in domain-specific material. KB content never leaves the local environment.
Ships in learn. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
/learn-kb <subcommand> [options]
Subcommands: add, list, query, update, remove
Invoke when an operator wants to manage domain-specific knowledge sources that ground the Feynman learning loop. Typical triggers:
Different operators benefit from different KB types:
In every case the KB content stays local. Nothing is forwarded to external APIs during query time. See Privacy guarantee below.
add/learn-kb add --type dify|palace|local|url --name <kb-name> [options]
Registers a new KB entry. The --name value is the identifier used in all
other subcommands and in the --kb flag of /learn-goal.
Type: dify
Register a Dify knowledge base by name. Queries are routed through
content-grounding-kb.sh --kb dify:<name> at query time.
Requirements:
DIFY_API_KEY environment variable setDIFY_BASE_URL set (default: http://localhost/v1)/learn-kb add --type dify --name legal-frameworks
Type: palace
Create or register a surreal-memory palace by ID. If --content-dir is
provided, immediately ingests all files via palace_ingest.
/learn-kb add --type palace --name company-playbook \
--palace-id kb-company-playbook \
--content-dir ~/docs/playbook
Palace IDs follow the convention kb-<name> by default when --palace-id is
omitted.
Type: local
Register a local directory as a KB. Content is read at query time (not
ingested). Supported file formats: .md, .txt, .json.
/learn-kb add --type local --name architecture-docs \
--content-dir ~/projects/myapp/docs
Type: url
Scrape a URL via Firecrawl and ingest the result into a surreal-memory palace. Once ingested, subsequent queries hit the palace only — the URL is not re-scraped at query time.
Requirements:
FIRECRAWL_API_KEY environment variable set/learn-kb add --type url --name openai-api-docs \
--url https://platform.openai.com/docs
All add calls write a registry entry to ~/.prometheus/learn/kb-registry.json.
list/learn-kb list
Reads ~/.prometheus/learn/kb-registry.json and prints a table:
NAME TYPE CREATED_AT LAST_QUERIED
legal-frameworks dify 2024-06-28T10:00:00Z 2024-06-28T11:30:00Z
company-playbook palace 2024-06-28T09:00:00Z never
architecture-docs local 2024-06-27T14:00:00Z 2024-06-28T08:00:00Z
openai-api-docs url 2024-06-28T10:30:00Z never
If the registry is empty or absent, print: No knowledge bases registered. Run /learn-kb add to register one.
query/learn-kb query --name <kb-name> --subject "query text" [--top-k N]
Calls content-grounding-kb.sh with the appropriate adapter and prints the
returned corpus JSON. Default --top-k is 5.
Under the hood:
bash "<directory-containing-this-SKILL.md>/scripts/content-grounding-kb.sh" \
--kb "<type>:<id>" \
--subject "<query text>" \
--level practitioner \
--output /tmp/learn-kb-query-result.json
cat /tmp/learn-kb-query-result.json | jq .
Updates last_queried in the registry entry after a successful query.
update/learn-kb update --name <kb-name> [--content-dir <path>] [--url <url>]
Re-ingest or refresh a KB:
palace_ingest on --content-dir (required for palace
type if directory content changed)remove/learn-kb remove --name <kb-name> [--purge-palace]
Removes the KB registry entry from ~/.prometheus/learn/kb-registry.json.
With --purge-palace: also deletes the surreal-memory palace data for palace
and url type KBs by calling palace_delete on the palace ID.
Without --purge-palace: the palace data is retained (safe default). Print a
note reminding the operator that palace data remains at the palace ID.
The registry lives at ~/.prometheus/learn/kb-registry.json:
{
"version": "1.0.0",
"kbs": [
{
"name": "company-playbook",
"type": "palace",
"palace_id": "kb-company-playbook",
"content_dir": "/Users/operator/docs/playbook",
"created_at": "2024-06-28T10:00:00Z",
"last_queried": null,
"description": "Internal business methodology"
},
{
"name": "legal-frameworks",
"type": "dify",
"dify_kb_name": "legal-frameworks",
"created_at": "2024-06-28T10:00:00Z",
"last_queried": "2024-06-28T11:30:00Z",
"description": null
},
{
"name": "architecture-docs",
"type": "local",
"content_dir": "/Users/operator/projects/myapp/docs",
"created_at": "2024-06-27T14:00:00Z",
"last_queried": "2024-06-28T08:00:00Z",
"description": null
},
{
"name": "openai-api-docs",
"type": "url",
"source_url": "https://platform.openai.com/docs",
"palace_id": "kb-openai-api-docs",
"created_at": "2024-06-28T10:30:00Z",
"last_queried": null,
"description": "OpenAI API reference scraped via Firecrawl"
}
]
}
Type-specific optional fields (palace_id, dify_kb_name, content_dir,
source_url) are set only for the relevant type. description is always
optional. last_queried is null until the first query.
All four adapter types respect the privacy rule from content-grounding-kb.sh:
KB content is NEVER forwarded to external APIs during query time.
dify — queries run against a local or self-hosted Dify instance. If
DIFY_BASE_URL points to a remote host, that is the operator's explicit
choice.palace — queries hit the local surreal-memory server only.local — files are read from the local filesystem only.url — Firecrawl scrapes the URL once during add or update. After
ingestion into a palace, all subsequent queries hit the palace only. No
re-scrape occurs at query time.To use a KB in a learning goal:
/learn-goal "master our company's sales methodology" --kb company-playbook
The --kb flag passes the KB name to content-grounding-kb.sh automatically.
The resolved KB type and ID are looked up from the registry. The kb_id field
in the resulting goal.json artifact records which KB was used, so downstream
skills (learn-survey, learn-plan, learn-grade) can re-query the same KB
without prompting the operator again.
| Condition | Behavior |
|---|---|
| Registry file missing | Create it with empty kbs: [] on first add |
| Name already exists | Print error; suggest update or remove first |
| Type-specific env var missing | Print which var is needed; abort |
--name not found in registry | Print available names; abort |
| palace_ingest fails | Print error with palace ID; registry entry is NOT written |
When the a learn-kb query answer is turned into a learner-verified explanation that is worth keeping, persist what was learned so the next prompt on this topic is
answered from the knowledge base instead of triggering another
[prometheus-gap] suggestion (emitted by karpathy-hook-dispatch.sh, design
docs/design/team-aware-learning-memory.md §4).
Ingest the final explanation as a Lesson. Use project scope by default; use
shared scope (with --yes) only when the topic is generic and not specific to
this project:
# project scope (default)
printf '%s' "$EXPLANATION_TEXT" | pk ingest --type Lesson --source "learn-kb:${GOAL_ID:-manual}" --tag learn
# generic topic -> shared scope
printf '%s' "$EXPLANATION_TEXT" | pk ingest --type Lesson --scope shared --yes --source "learn-kb:${GOAL_ID:-manual}" --tag learn
Mark the matching knowledge gap resolved in
~/.prometheus/knowledge-gaps/gaps.jsonl:
python3 "${CLAUDE_PLUGIN_ROOT:-$PROMETHEUS_PLUGIN_ROOT}/shared/scripts/lib/prompt_gap.py" \
resolve --topic "$QUERY_TOPIC" --by learn-kb --scope project
This appends one record per matching open gap (same topic key, or at least two shared keywords with the subject):
{"ts":"<utc>","status":"resolved","topicKey":"<16 hex>","topic":"<gap topic>","resolvedBy":"learn-kb","scope":"project"}
The latest record per topicKey wins; an open record is any gap whose
latest record has status:"open". The step never fails the flow: with no
pk on PATH, skip step 1 and tell the user the explanation was not persisted;
with no matching gap, step 2 prints nothing.
For in-depth information on each adapter type, environment requirements, and ingestion mechanics, see references/kb-types.md.
skills/learn/learn-kb/
├── SKILL.md — this file
└── references/
└── kb-types.md — adapter-type deep-dive
What SKILL.md sets; muted values are Claude Code's defaults
12 skills in this plugin
/feynman-loopThe core Feynman learning cycle for prometheus-skill-pack. Maps Feynman's explain-grade-gap-relearn cycle to the PMPO lifecycle. Supports vertical recursion (child loops on gap concepts), horizontal escalation (novice→peer→skeptic audiences), recursion floor guards, and all three mastery closure criteria./learn-about-systemZero-friction adoption entry point for the Prometheus Skill Pack. Routes operators into the Feynman learning loop for the KBD lifecycle, skill pack capabilities, or AI harness orientation. The skill pack teaches itself using its own learning infrastructure./learn-certifyCertification endpoint for the Feynman learning loop. Runs prerequisite gates (feynman-artifacts, practice results, capstone), emits an Open Badges 3.0 / W3C Verifiable Credential self-issued JSON-LD signed with did-plc, and detects anomalous mastery trajectories via an integrity guardrail.Other plugins' skills for the same job
npx claudepluginhub prometheus-ags/prometheus-skill-system --plugin learn2 plugins in one repository ship this exact skill · first indexed Nov 27, 2026