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_store_skillnpx skills add NPC-Worldwide/npcpy --skill knowledge_store_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_store_skill)<a href="https://agentmods.dev/skills/npc-worldwide/npcpy/knowledge_store_skill"><img src="https://agentmods.dev/badge/skills/npc-worldwide/npcpy/knowledge_store_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.00346 | $0.00943 |
| Opus 5 | $0.00173 | $0.00472 |
| Sonnet 5 | $0.00069 | $0.00189 |
| Haiku 4.5 | $0.00035 | $0.00094 |
Grade A, and why
knowledge_store_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.
How it starts
The opening of the file, as written. The whole thing — 51 lines — stays where its author put it; the contents beside it link to each section on GitHub.
knowledge_store_skill
Skill for working with local .knowledge.yaml files via KnowledgeStore. Use this when you need to recall, search, or manage directory-local memories and knowledge links stored in plain YAML alongside the user's project files.
KnowledgeStore is directory-scoped. Each directory that contains a .knowledge.yaml file maintains its own append-only memory graph. There is no global database — the YAML IS the source of truth.
Key operations: - Load a directory's store: npcpy.memory.knowledge_store.get_store_for_path(path) - Append a memory: store.append_memory(initial_memory="...", status="pending_approval", ...) - Update a memory (approve/reject/edit): store.update_memory(mem_id, status, final_memory) - Search memories (keyword substring): store.search_memories("query", limit=20) - Get approved context for LLM prompts: store.build_context(max_memories=10) - Get links for a memory: store.get_links_for_memory(mem_id) - Create a link between memories: store.append_link(from_mem, to_mem, relation="refines", agent="your_name") - Aggregate across a tree: KnowledgeStore.aggregate(root_directory, max_depth=3)
Memory statuses: - pending_approval — raw extraction, needs human review - human-approved — confirmed and available for context injection - human-rejected — discard, can be used as negative examples - human-edited — corrected version supersedes initial_memory
When answering questions, prefer build_context() for recently approved local knowledge, and search_memories() for targeted recall. Always respect human-rejected memories — do not repeat them.
Inputs
name(default:'action')description(default:'load | search | append | update | link | context | aggregate')name(default:'directory_path')description(default:'Absolute path of the directory containing .knowledge.yaml')name(default:'query_or_memory')description(default:'Search query, memory text, or JSON params depending on action')
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 · 51 lines · 346 tokens per session scan A 92c06b063f8c
knowledge_store_skill is a skill published in the GitHub repository NPC-Worldwide/npcpy (1,495 stars, last pushed 2d ago), licensed MIT. It adds 346 tokens to every session and 943 once invoked, about $0.0017 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
mem0-tour
Browses all stored memories grouped by category with full content display. Use when reviewing all project memories, exploring stored knowledge, onboarding to a project, or getting an overview of captured decisions, conventions, and learnings.
mem0-vercel-ai-sdk
Mem0 provider for Vercel AI SDK (@mem0/vercel-ai-provider). TRIGGER when: user mentions "vercel ai sdk", "@mem0/vercel-ai-provider", "createMem0", "retrieveMemories", "addMemories", "getMemories", "searchMemories", "mem0 vercel", "AI SDK provider", "AI SDK memory", or is using generateText/streamText with mem0. Also…
stats
Displays memory usage statistics for the current session and project including counts by category, age distribution, and API latency. Use when checking how many memories exist, reviewing session activity, or auditing memory distribution across categories.
peek
Searches memories and displays compact one-liner results, or looks up a specific memory by ID. Use for quick memory lookups, checking if a decision was recorded, resolving [mem0:id] citations, or browsing memories without full category detail.
pause
Pause Mem0 memory capture on this machine. Use when the user wants to stop memories being recorded, for example for private work or experiments.
mine
Mine a project or conversation into your MemPalace — extract and store memories for later retrieval.