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 skills add NPC-Worldwide/npcpy --skill knowledge_graph_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_graph_skill)<a href="https://agentmods.dev/skills/npc-worldwide/npcpy/knowledge_graph_skill"><img src="https://agentmods.dev/badge/skills/npc-worldwide/npcpy/knowledge_graph_skill/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/npc-worldwide/npcpy/knowledge_graph_skill"><img src="https://agentmods.dev/badge/skills/npc-worldwide/npcpy/knowledge_graph_skill.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.1 | $0.00474 | $0.01301 |
| Opus 5.5 | $0.00190 | $0.00520 |
| Sonnet 5.5 | $0.00095 | $0.00260 |
| Haiku 4.5 | $0.00047 | $0.00130 |
Grade A, and why
knowledge_graph_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 1mo 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.
How it starts
The opening of the file, as written. The whole thing — 80 lines — stays where its author put it; the contents beside it link to each section on GitHub.
knowledge_graph_skill
Skill for searching and evolving the SQLite-backed Knowledge Graph. Use this when you need structured fact/concept/link search across one or more teams, NPCs, or directory scopes. The Knowledge Graph (KG) is stored in the application's database (not YAML). It is scoped by (team_name, npc_name, directory_path). Facts and concepts carry generation numbers and origin tags. Search methods (choose the right one):
-
Keyword search — fast substring match over fact statements.
kg_search_facts(engine_or_kg, "keyword")→ List[str] -
Embedding search — semantic cosine similarity via vector embeddings.
kg_embedding_search(engine_or_kg, query="...", embedding_model="nomic-embed-text", embedding_provider="ollama", similarity_threshold=0.6, max_results=20)→ List[dict] with 'content', 'type', 'score' -
Link search — graph traversal (BFS/DFS) starting from keyword-matched seeds.
kg_link_search(engine_or_kg, query="...", max_depth=2, breadth_per_step=5, strategy="bfs", max_results=20)→ List[dict] with 'content', 'type', 'depth', 'path', 'score' -
Hybrid search — combines keyword + embedding + link, boosting results found by multiple methods.
kg_hybrid_search(engine_or_kg, query="...", mode="all", max_depth=2, similarity_threshold=0.6, max_results=20)→ List[dict] with 'content', 'type', 'score', 'source'
Graph evolution (use sparingly, usually in background): - kg_initial(content, model, provider) — build a new KG from text - kg_evolve_incremental(existing_kg, new_content_text, ...) — add content - kg_sleep_process(existing_kg, model, provider) — prune/deepen/consolidate - kg_dream_process(existing_kg, model, provider, num_seeds) — speculative synthesis
When a user asks a question that spans facts, concepts, and their relationships, prefer hybrid search. For pure semantic similarity without graph structure, use embedding search. For exploring connected neighborhoods, use link search with BFS.
Inputs
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.
- 1mo ago First seen · 80 lines · 474 tokens per session scan A c7e4d0a292f7
knowledge_graph_skill is a skill published in the GitHub repository NPC-Worldwide/npcpy (1,518 stars, last pushed 2d ago), licensed MIT. It adds 474 tokens to every session and 1,301 once invoked, about $0.0019 per session on Opus 5.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
playwright
Use when the task requires capturing or automating a real browser from the terminal.
ai-agent-tool-routing
Use when designing or reviewing an AI agent tool registry or MCP router: document parameter schemas, caller authorization, execution limits, replay-safe retries and verification evidence.
prior-auth-packet-builder
Build a concise prior authorization packet from local case files and payer policy docs.
credit-note-fixer
Fix the tiny credit-note formatting bug and rerun the exact targeted test command.
csv-workbench
Analyze CSV files in /mnt/data and return concise numeric summaries.
detect-framework
Detect Python agent frameworks from code imports and map them to Omnigent executor types. Load when the user has existing agent code to integrate.