Agent skill

Sift Kg

by juanceresa in juanceresa/sift-kg

Use sift-kg as an AI second brain — a persistent knowledge graph your agent operates from across sessions.

MITAuto-check passedKnowledge Management

Install Sift Kg

skills CLI
$ npx skills add juanceresa/sift-kg --skill sift-kg -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install juanceresa/sift-kg sift-kg --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/juanceresa/sift-kg.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/sift-kg .claude/skills/sift-kg && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
sift-kg
GitHub stars
800
Token cost
~2.7k tokens
SKILL.md length
1,140 words
Files
1
Skills in repo
1
Repo updated
First seen
Licence
MIT

At a glance

Use sift-kg as an AI second brain — a persistent knowledge graph your agent operates from across sessions.

  • Asks what do I know about X
  • SKILL.md covers Session Start: Orient Yourself, Querying the Graph, Reasoning Patterns and Building the Graph, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • How does X connect to Y

What it does

Sift Kg is an agent skill from juanceresa/sift-kg. Use sift-kg as an AI second brain — a persistent knowledge graph your agent operates from across sessions. Use proactively at session start to orient, when answering questions about the user's projects or domain, when generating ideas or suggestions, when user asks "what do I know about X", "how does X connect to Y", "find connections", "what should I work on", "give me ideas", or when you need to understand the structure of the user's knowledge. Not needed for one-off document analysis — sift's CLI commands work…

Its SKILL.md is about 2.7k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Knowledge Management, covering Second brain and Knowledge graphs. The repository describes itself as: Turn any collection of documents into a knowledge graph. Extract entities and relationships via LLM, deduplicate with your approval. Map domains, find hidden connections, spot… The licence is MIT.

When your agent uses it

  • Asks what do I know about X
  • How does X connect to Y
  • Find connections
  • What should I work on

Example prompts

  • “what do I know about X”
  • “how does X connect to Y”
  • “find connections”
  • “/sift-kg”

What it can do on your machine

Read from SKILL.md and the folder at commit d786991. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are bash).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Sift Kg loads about 2.7k tokens when it runs. Until then it costs about 139 tokens; SKILL.md has 1,140 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~139
When it runs · the whole SKILL.md, loaded when a task matches
~2.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from juanceresa/sift-kg at commit d786991, republished under its MIT licence (© juanceresa). 1,140 words, ~2,688 tokens.

Download SKILL.mdSave it as .claude/skills/sift-kg/SKILL.md (or your agent's skills folder).
name
sift-kg
description
Use sift-kg as an AI second brain — a persistent knowledge graph your agent operates from across sessions. Use proactively at session start to orient, when answering questions about the user's projects or domain, when generating ideas or suggestions, when user asks "what do I know about X", "how does X connect to Y", "find connections", "what should I work on", "give me ideas", or when you need to understand the structure of the user's knowledge. Not needed for one-off document analysis — sift's CLI commands work fine on their own for that.

sift-kg: AI Second Brain

The knowledge graph is your persistent, structured memory of the user's world — entities, relationships, communities, and how they all connect. It is built from the user's documents and persists across sessions.

Treat the graph as your persistent understanding of the user's world. When the user asks about their projects, domain, or knowledge — check the graph first. It grounds your responses in real entities and relationships instead of guessing. You don't need to query it for every interaction, but for anything related to the user's work or knowledge, the graph should inform your answer.

Session Start: Orient Yourself

At the start of every session, orient from the graph:

bash
sift info --json -o output/

This returns: domain, entity_types, entities (count), relations (count), documents_processed, merge_proposals and relation_review status (if dedup has been run), and narrative_generated. If no graph exists yet, go to Build the Graph below.

Then load the structural map:

bash
sift topology -o output/

This returns:

  • Communities — clusters of related entities with member counts and top entity IDs
  • Bridges — entities connecting multiple communities, sorted by cross-community edge count
  • Community connections — which clusters are linked and how strongly (shared edges, bridge count)
  • Isolated — entities with no substantive connections

Keep this topology in mind for the session. Community labels and bridge entities help you navigate the user's knowledge. When relevant questions come up, you already have the structural context.

Note on community labels: Labels are auto-generated as "Community 1", "Community 2" unless sift narrate has been run (which generates descriptive LLM labels like "Palm Beach Elite Network"). To understand what a generically-labeled community represents, look at its top_entities list — these are entity IDs (e.g., person:harry_boyte, program:civic_architecture), not display names. Query interesting IDs with sift query to get full context.

Note on top_entities: These are entity IDs, not display names. Read them by convention: person:harry_boyte = a person named Harry Boyte, company:palantir_technologies = a company named Palantir Technologies.

Querying the Graph

Explore an Entity
bash
sift query "topic or name" -o output/             # fuzzy name search
sift query "person:exact_entity_id" -o output/     # exact ID lookup
sift query "topic" --depth 2 -o output/            # 2-hop neighborhood
sift query "topic" -t PERSON -o output/            # filter by entity type

Returns: matched entity with community membership and bridge status, plus the full subgraph (nodes + edges) around it. If multiple entities match, the top result (by connection count) is returned with an other_matches list — re-query with the exact entity ID for a specific one.

Lightweight Lookup
bash
sift search "name" --json -o output/                    # find entities
sift search "name" --json --relations -o output/         # include direct relations
sift search "name" --json --description -o output/       # include descriptions

Use search when you just need to find an entity or check if something exists. Use query when you need the full neighborhood subgraph.

Reasoning Patterns

Pattern: Ground Responses in the Graph

When the user asks about their work — "what do I know about X?", "tell me about my project Y" — always query the graph first before responding:

bash
sift query "X" -o output/

Read the match info (community, bridge status, connections) and the subgraph. Base your answer on actual entities and relationships from the graph. If the entity isn't in the graph, say so — don't invent connections.

This is the highest-value reasoning pattern. It identifies opportunities to connect knowledge areas that are structurally separated.

Step 1: Get topology and identify disconnected or weakly connected community pairs.

bash
sift topology -o output/

Look at community_connections. Community pairs with 0 shared_edges are completely disconnected — knowledge islands. Pairs with low shared_edges (1-3) are weakly connected.

Step 2: For each disconnected pair, examine what each community contains.

Read the top_entities (entity IDs) from each community in the topology output. Look at entity types — if both communities contain overlapping types (e.g., both have CONCEPT entities, or both have ORGANIZATION entities), there may be a semantic connection that isn't structurally represented yet.

Step 3: Query top entities from each side to find shared concepts.

bash
sift query "top_entity_from_community_A" -o output/
sift query "top_entity_from_community_B" -o output/

Compare the two subgraphs. Look for:

  • Shared relation types — if both subgraphs have FUNDED_BY or LOCATED_IN relations, the domains share a structural pattern
  • Common neighbor entities — entities that appear in both neighborhoods are natural bridge candidates
  • Conceptual overlap — entities in one subgraph that could logically relate to entities in the other

Step 4: Articulate the connection for the user.

Tell them: "Your [Community A topic] and [Community B topic] are currently disconnected in your knowledge graph. But [entity X] in the first area and [entity Y] in the second share [specific relationship or concept]. Connecting these could [specific value]."

The insight is not that the connection exists — the user might already sense it vaguely. The value is identifying which specific entities to connect and why now, grounded in the actual graph structure.

Show full SKILL.md (439 more words)Show less
Pattern: Generate Grounded Suggestions

When the user asks "what should I work on?" or "give me ideas":

bash
sift topology -o output/

Base suggestions on graph structure:

  • Knowledge islands (disconnected communities) — suggest exploring the connection between them
  • High-degree bridge entities — these are the user's most structurally important concepts; suggest deepening them
  • Weakly connected community pairs — suggest adding documents that would strengthen the bridge
  • Entity types concentrated in one community — if all PERSON entities are in one cluster, the other clusters may lack the human dimension

Prefer suggestions grounded in specific entities, communities, or structural features from the topology over generic advice.

Pattern: Track Changes After Rebuild

When the user adds new documents and rebuilds the graph:

bash
# Before rebuild — capture current state
sift topology -o output/ > /tmp/topology_before.json

# Rebuild
sift extract ./new-docs/ -o output/   # confirm with user first (costs money)
sift build -o output/

# After rebuild — compare
sift topology -o output/

Compare the new topology against the previous snapshot:

  • New communities that appeared
  • Communities that merged or split
  • New bridge entities
  • Community pairs that gained or lost connections
  • Changes in entity/relation counts

Report these changes to the user — "Adding those documents created a new cluster around [topic] and connected it to your existing [community] via [bridge entity]."

Building the Graph

When the user provides new documents or wants to create/update the graph:

bash
sift extract ./documents/ -o output/    # extract entities and relations (LLM, costs money)
sift build -o output/                    # construct graph + detect communities

Always confirm with the user before running extract or resolve — these make LLM API calls that cost money.

Extraction is cached — only new/changed documents are processed on re-run. The graph grows incrementally; entity IDs are deterministic ({type}:{normalized_name}) so the same entity from different documents auto-merges.

For better entity deduplication:

bash
sift resolve -o output/        # LLM proposes entity merges (costs money)
sift review                    # user approves/rejects interactively
sift apply-merges -o output/   # apply confirmed merges

Key Concepts

Entity IDs follow the format {type}:{normalized_name} — all lowercase, underscores for spaces. Examples: person:jeffrey_epstein, company:palantir_technologies, location:new_york.

Communities are clusters of densely connected entities detected by Louvain algorithm. They represent natural groupings — topics, domains, networks of people.

Bridge entities connect multiple communities. High cross-community edge count = structurally important. These are the nodes that link otherwise separate knowledge areas.

Substantive connections exclude DOCUMENT nodes and MENTIONED_IN edges (provenance metadata). All agent-facing counts and subgraphs use this filtered view.

Graph scale: For graphs under ~500 entities, graph_data.json can be loaded directly into context. For larger graphs, always use sift topology and sift query — never attempt to load the full JSON.

Output Files

output/
├── graph_data.json          # full knowledge graph (nodes + edges)
├── communities.json         # community assignments (entity_id -> label)
├── extractions/             # per-document extraction results (cached)
├── narrative.md             # prose narrative (optional, from sift narrate)
└── entity_descriptions.json # entity descriptions (optional, from sift narrate)

Troubleshooting

"No graph found" — Run sift extract then sift build first. The graph must be built before querying.

"No communities found" — Run sift build (communities are detected during build). If the graph is very small (<16 entities), community detection may not produce meaningful results.

Empty query results — Try a broader search term, or check sift search "term" --json to see what entities exist. Entity names may differ from what you expect — check aliases.

Large graph, slow queries — Use sift topology for the overview instead of loading graph_data.json. Use sift query with --depth 1 (default) to keep subgraphs manageable.

© juanceresa, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/sift-kg of juanceresa/sift-kg.

Open the folder on GitHubat commit d786991

Compare with similar skills

Sift Kg next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Sift Kg compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Sift Kg this skilljuanceresa/sift-kg800—~2.7kAutomated safety check: PassMIT
Obsidian Canvas BoardsAgriciDaniel/claude-obsidian15k—~1.4kAutomated safety check: PassMIT
Subscription Videos MetadataEfficientStreet/youtube-subscriptions-ingest180—~7.1kAutomated safety check: NotesMIT
Basic Memory Onboardingbasicmachines-co/basic-memory4.1k—~3.4kAutomated safety check: PassAGPL-3.0
Ontology1mancompany/OneManCompany4422 repos~1.5kAutomated safety check: PassApache-2.0
3D Brainnateherkai/AIS-OS1.6k—~2.1kAutomated safety check: PassCustom licence

Similar skills

  • Obsidian Canvas Boards

    AgriciDaniel/claude-obsidian

    Creates, inspects and updates Obsidian JSON Canvas boards in a vault, with text, file, link, group and edge nodes, using safe recoverable edits.

    15k GitHub stars~1.4k tokensUpdated 1 mo ago
    Knowledge ManagementAuto-check passed
  • Subscription Videos Metadata

    EfficientStreet/youtube-subscriptions-ingest

    Pull metadata from YouTube subscription videos into a second-brain vault as a real cross-linked knowledge graph — not just a flat archive.

    180 GitHub stars~7.1k tokensUpdated 1 mo ago
    Knowledge ManagementAuto-check: notes
  • Basic Memory Onboarding

    basicmachines-co/basic-memory

    Guides a newcomer to Basic Memory through designing a personal knowledge system, then teaches its use and sets up their assistant to load it each session.

    4.1k GitHub stars~3.4k tokensUpdated today
    Knowledge ManagementAuto-check passed
  • Ontology

    1mancompany/OneManCompany

    Typed knowledge graph for structured agent memory and composable skills.

    442 GitHub starsUsed in 2 repos~1.5k tokens
    Knowledge ManagementAuto-check passed
  • 3D Brain

    nateherkai/AIS-OS

    A skill your agent uses when someone asks to build a 3D brain, visualize their AIOS or second brain, turn their knowledge into an interactive graph, or run /3d-brain or /3D brain.

    1.6k GitHub stars~2.1k tokensUpdated 1 mo ago
    Knowledge ManagementAuto-check passed
  • Icm Architect

    RinDig/icm-architect

    Design any process, idea, problem, or body of knowledge into an ICM (Interpretable Context Methodology) workspace — folder structure as agent architecture — or restructure an existing folder, repo…

    1.8k GitHub stars~3.2k tokensUpdated 1 mo ago
    Knowledge ManagementAuto-check passed

Questions about Sift Kg

What does Sift Kg do?

Use sift-kg as an AI second brain — a persistent knowledge graph your agent operates from across sessions. Sift Kg is an agent skill from juanceresa/sift-kg. Use sift-kg as an AI second brain — a persistent knowledge graph your agent operates from across sessions.

When should I use Sift Kg?

Sift Kg fits situations like: asks what do I know about X; how does X connect to Y; find connections; what should I work on.

How do I install Sift Kg in Claude Code?

Run `npx skills add juanceresa/sift-kg --skill sift-kg -a claude-code`. Or copy the skill folder (.agents/skills/sift-kg in juanceresa/sift-kg) into .claude/skills/sift-kg in your project. Claude Code loads it when a task matches its description.

How do I install Sift Kg in Codex?

Run `npx skills add juanceresa/sift-kg --skill sift-kg -a codex`. Or copy the skill folder (.agents/skills/sift-kg in juanceresa/sift-kg) into .agents/skills/sift-kg in your project. Codex loads it when a task matches its description.

Can I use Sift Kg in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add juanceresa/sift-kg --skill sift-kg -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/sift-kg, .gemini/skills/sift-kg, .github/skills/sift-kg and .opencode/skills/sift-kg in your project.

What does Sift Kg need to run?

SKILL.md names no scripts, command-line tools or credentials: Sift Kg is instructions for the agent only.

Does Sift Kg access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Sift Kg safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Sift Kg use?

Sift Kg is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Sift Kg use?

About 2.7k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Sift Kg?

Skills that share tags, products or a category with Sift Kg: Obsidian Canvas Boards (AgriciDaniel/claude-obsidian, 15k stars), Subscription Videos Metadata (EfficientStreet/youtube-subscriptions-ingest, 180 stars), Basic Memory Onboarding (basicmachines-co/basic-memory, 4.1k stars) and Ontology (1mancompany/OneManCompany, 442 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Sift Kg?

juanceresa (a GitHub user) maintains it in juanceresa/sift-kg, which has 800 GitHub stars. The repository was last updated on May 12, 2026.

Source: juanceresa/sift-kg on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.