npcpy is a Python library for building applications with multimodal language models, agent-based AI, and knowledge graphs. Researchers and developers use it with local or cloud model providers to create agents, multi-agent teams, and AI workflows.
Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/npc-worldwide/npcpy/knowledge_index_skillnpx skills add NPC-Worldwide/npcpy --skill knowledge_index_skillgit clone --depth 1 https://github.com/NPC-Worldwide/npcpyWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/npc-worldwide/npcpy/knowledge_index_skill)<a href="https://agentmods.dev/skills/npc-worldwide/npcpy/knowledge_index_skill"><img src="https://agentmods.dev/badge/skills/npc-worldwide/npcpy/knowledge_index_skill.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00272 | $0.00766 |
| Opus 5 | $0.00136 | $0.00383 |
| Sonnet 5 | $0.00054 | $0.00153 |
| Haiku 4.5 | $0.00027 | $0.00077 |
Grade A, and why
knowledge_index_skill scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
What it actually says
knowledge_index_skill
Skill for using the KnowledgeIndex registry to discover which directories contain .knowledge.yaml files without walking the filesystem.
KnowledgeIndex is a lightweight SQLite cache. It maps directory paths to file metadata (mtime, memory_count, link_count). The database path is caller-provided — npcpy does not hardcode a default.
Key operations: - Upsert a directory after writing to its YAML:
upsert_directory(db_path, directory, memory_count, link_count)
- List known directories:
get_known_directories(db_path, min_mtime=None)- Full rescan of a tree:scan_root(db_path, root, max_depth=5)- Remove a stale directory:remove_directory(db_path, directory)Typical flow: 1. Callscan_root(db_path, root="/home/user/projects", max_depth=5)to populate the index with every.knowledge.yamlfound.
- Query
get_known_directories(db_path)to get a list of directories with memory/link counts. - For each directory of interest, instantiate
KnowledgeStore(directory)and callload()orbuild_context().
The index is a cache, not the source of truth. If a .knowledge.yaml is deleted or modified outside the app, re-run scan_root to refresh.
Inputs
name(default:'action')description(default:'scan | list | upsert | remove')name(default:'db_path')description(default:'Path to the knowledge index SQLite file')name(default:'root_or_directory')description(default:'Root to scan or specific directory to upsert/remove')
Steps
instruct→instruct.py
Usage
/run_jinx jinx_ref=knowledge_index_skill input_values={"name": "root_or_directory", "description": "Root to scan or specific directory to upsert/remove"}
What ships with it
1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 5d ago First seen · 54 lines · 272 tokens per session scan A a05b917f6ab6
knowledge_index_skill is a skill published in the GitHub repository NPC-Worldwide/npcpy (1,497 stars, last pushed yesterday), licensed MIT. It adds 272 tokens to every session and 766 once invoked, about $0.0014 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
langchain-orchestration
Comprehensive guide for building production-grade LLM applications using LangChain's chains, agents, memory systems, RAG patterns, and advanced orchestration.
final-release-review
Perform pre-release planning or a final release-candidate review for openai-agents-python by comparing the target with the previous remote tag, determining the minimum compatible release type, auditing regressions and contract changes, reviewing open documentation PR coverage, drafting minor-release Key Changes, and…
release-candidate-prep
Preflight and prepare an OpenAI Agents Python release candidate in a dedicated worktree from exact origin/main, gate readiness before branch creation, freeze the released API contract, create or replace the local release branch with one release commit, enforce final release review as a checker, and produce…
implementation-strategy
Choose compatibility-aware scope for runtime and API changes in openai-agents-python. Use before initial implementation and each review-feedback batch to decide whether to patch, reset the design, preserve compatibility, or reject unsupported cases.
memory-triage
Persistent long-term memory protocol powered by mem0. Evaluate conversations for durable facts worth storing via memoryadd. Handles identity, preferences, decisions, configurations, rules, projects, and relationships. Loaded by the openclaw-mem0 plugin when skills mode is active.
pr-draft-summary
Create the required PR-ready summary block, branch suggestion, title, and draft description for openai-agents-python. Use before the final response whenever the current task changed runtime code, tests, examples, build/test configuration, or docs with behavior impact, regardless of perceived change size and including…