knowledge
Typed knowledge graph for people, organizations, products and concepts — canonical JSON facts, provenance, relations, validation, person matching and…
by hyper-code-harness★ 22 GitHub stars
Install knowledge in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
About this skill
Knowledge
A standalone typed knowledge graph in Postgres schema knowledge. It owns canonical entities, provenance observations, derived relations and a searchable projection. It has no dependency on LinkedIn or another source: importers and future plugins submit normalized facts through the public API.
Workflow
Search first, then read the selected entity with provenance and graph edges:
const hits = await ctx.fns.knowledge.find({ query: "Health Samurai" });
await ctx.fns.knowledge.get({ id: hits[0].id });
Create or update an entity without replacing unspecified fields:
await ctx.fns.knowledge.upsert({
id: "Organization/health-samurai",
data: { title: "Health Samurai", description: "Healthcare software company" }
});
Attach a sourced observation separately from canonical data:
await ctx.fns.knowledge.observe({
subject: "Organization/health-samurai",
attribute: "website",
value: "https://health-samurai.io",
source: "website",
url: "https://health-samurai.io"
});
Use knowledge.importFiles to import the legacy ~/knowledge-base/<Type>/<slug>.md and provenance NDJSON repository. Use knowledge.resolve after reference attributes change, and knowledge.rebuildSearch after bulk updates. knowledge.validate checks class-required fields; knowledge.matchPerson resolves names and phone numbers.
Future source plugins such as LinkedIn should remain independent and call knowledge.upsert / knowledge.observe as optional producers.
Entity sidecar (agent chats)
When scratchpad.knowledgeTrackingEnabled is on for an agent (Meta panel → Observed entities → Track entities, or knowledge.setTracking), every successfully completed agent turn launches knowledge.updateSidecar: a hidden fork whose reporter submits knowledge.setObservedMentions({ mentions }). The extraction prompt includes an explicit JSON window of persisted parent messages, with durable indices in the text itself. Inherited history is context only. Failed extraction does not advance the authoritative appliedSourceMessageIdx checkpoint; oversized windows fail visibly instead of silently skipping text. Runs have a bounded deadline and archive their child on completion or failure.
setObservedMentions resolves each mention with knowledge.resolveMentions (exact Unicode-normalized names/aliases and validated existing entity IDs) and then writes directly with provenance: matched → observations on the existing entity, new → a canonical Type/slug created in the writer transaction, ambiguous → previewed only, nothing written. Each attribute, relation and the mention itself becomes a knowledge.provenance row with source: agent-chat, a verified source agent/message URL (legacy hyper://agent/<id>/message/<idx> is rendered as /agent/<id>/message/<idx>), verbatim evidence and confidence. The entity's Provenance section and Observed entities list link to a read-only persisted-message page with a backlink to the source chat. Deleted messages return 404; no unsupported hyper:// navigation is required. Observations can be audited by source (this is not an automatic rollback facility):
SELECT subject, attribute, value, url, evidence FROM knowledge.provenance WHERE source = 'agent-chat' ORDER BY id DESC;
Extractable types are data, not code. knowledge.extractionSchema derives them from the graph: an Entity/<Type> record with extract: true (mixins excluded) is extractable; its required list, extract_hint and anonymous flag are rendered into the prompt and enforced by the writer. Anonymous types (Event, EventParticipation) carry a synthesized name that need not appear in the evidence, are never matched by label, and are skipped (cascading to dependants) unless every required attribute/relation is evidenced. Attribute.vocabulary (root Concept) restricts a reference attribute to the root's isA/subClassOf descendants — the writer rejects other targets and the quote need not contain the concept title. date values are YYYY-MM-DD, datetime values are YYYY-MM-DD or ISO date-time; both are evidenced by the quote containing the ISO literal, the year or the day number. Adding a new type or attribute in Knowledge is enough to extract it. Anonymous records are deduplicated deterministically by knowledge.matchAnonymous before creation: identity = the type's required fields (dates compare by day); an all-reference identity (EventParticipation = event × participant) matches outright, a scalar identity (Event = kind × start) additionally needs one shared non-Concept link (organizer/about or a participant reported in the same batch) — one corroborated candidate is reused, several are ambiguous (skipped), disjoint links mean a distinct record, unknown links skip conservatively.
The sidecar receives a compact CHAT_ENTITIES list with current canonical facts and IDs already observed in this chat. Ordinary facts fill missing values; explici
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
Bundled files
- package.json
- sidecar-updates.mock.test.ts
- src/knowledge/$app_knowledge.json
- src/knowledge/$migration_20290819000000_knowledge.ts
- src/knowledge/$migration_20290820000000_entity_changes.ts
- src/knowledge/$route_$type_$slug_GET.ts
- src/knowledge/$route_$type_GET.ts
- src/knowledge/$route__GET.ts
- src/knowledge/$route_agent_$id_tracking_POST.ts
- src/knowledge/$search_people.ts
- src/knowledge/$setting_sidecarTimeoutMs.ts
- src/knowledge/ExtractionSpec.ts
- src/knowledge/Mention.ts
- src/knowledge/MentionResolution.ts
- src/knowledge/agentMetaSection.ts
- src/knowledge/dedupCandidates.ts
- src/knowledge/dedupDecide.ts
- src/knowledge/dedupMerge.ts
- src/knowledge/ensure.ts
- src/knowledge/eventExtraction.mock.test.ts
- src/knowledge/extractionSchema.ts
- src/knowledge/find.ts
- src/knowledge/get.ts
- src/knowledge/history.mock.test.ts
- src/knowledge/identityKeys.ts
- src/knowledge/importFiles.ts
- src/knowledge/knowledge.test.ts
- src/knowledge/link.ts
- src/knowledge/lookup.ts
- src/knowledge/matchAnonymous.ts
- src/knowledge/matchPerson.ts
- src/knowledge/observe.ts
- src/knowledge/rebuildSearch.ts
- src/knowledge/renderBacklinks.ts
- src/knowledge/renderHistory.ts
- src/knowledge/resolve.ts
- src/knowledge/resolveIdentity.ts
- src/knowledge/resolveMentions.ts
- src/knowledge/searchPeople.mock.test.ts
- src/knowledge/setObservedMentions.ts
FAQ
What does the knowledge skill do?
Typed knowledge graph for people, organizations, products and concepts — canonical JSON facts, provenance, relations, validation, person matching and full-text search in the isolated Postgres schema knowledge. Use to look up known entities, contacts, organizations, products, concepts, facts and their sources.
How do I install the knowledge skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the knowledge skill run scripts?
Yes, this skill bundles executable scripts. Review the source before installing.
Related skills
agent-skill-stack
GitHubFind, evaluate, and assemble the smallest compatible set of AI Agent Skills for an end-to-end natural-language goal. Use when a user wants Skills for a…
build-evidence-map
GitHubBuild an auditable evidence map for a contested technical choice, research synthesis, proposal review, or consequential decision. Use when Copilot must…
pinecone-rag
GitHubBuild production RAG pipelines and persistent agent memory using Pinecone as the vector database backend. ALWAYS USE THIS SKILL when the user mentions…
qdrant-monitoring-debugging
GitHubDiagnoses Qdrant production issues using metrics and observability tools. Use when someone reports 'optimizer stuck', 'indexing too slow', 'memory too high'…