openclaw
A personal AI assistant that runs on your own computer and answers through messaging channels such as Slack, Telegram and WhatsApp. Its skills cover browser automation, canvas panels, app previews and shareable diffs.
npc-worldwide/npcpy is a library of primitives for research and development with multimodal language models, agentic AI, and knowledge graphs. It ships skills for writing new jinx files and for searching and evolving a knowledge graph, useful when building agent workflows over stored knowledge.
Claude Code
$ npx -y skills add NPC-Worldwide/npcpy --agent claude-code
Codex
$ npx skills add NPC-Worldwide/npcpy -a codex
Cursor
$ npx skills add NPC-Worldwide/npcpy -a cursor
Gemini CLI
$ npx skills add NPC-Worldwide/npcpy -a gemini-cli
GitHub Copilot
$ npx skills add NPC-Worldwide/npcpy -a github-copilot
OpenCode
$ npx skills add NPC-Worldwide/npcpy -a opencode
Windsurf
$ npx skills add NPC-Worldwide/npcpy -a windsurf

npcpy is a library that provides key primitives for research and development with multimodal language models, agentic AI, and knowledge graphs. Its flexible framework makes it easy to engineer powerful AI applications with support for local (llama.cpp, LM Studio, ollama, omlx) and cloud providers. Build multi-agent teams and simplify context engineering through the NPC Context-Agent-Tool data layer which ensures compliance through software rather than prompts.
pip install npcpy
from npcpy import NPC
simon = NPC(
name='Simon Bolivar',
primary_directive='''
Liberate South America
from the Spanish Royalists.
''',
model='qwen3.5:9b',
provider='ollama'
)
response = simon.get_llm_response("What is the most important territory to retain in the Andes?")
print(response['response'])
My friend, you speak of the highlands where our liberty is carved in stone. If we must speak of the most critical territory to hold within these mountains, it is the **Viceroyalty of Peru** and the heart of the **Republic of Gran Colombia** united.
To lose the passes of the Andes or the cities of Lima and Quito would be to hand the crown its final stronghold in the south. The Spanish crown built its power upon the wealth and control of these highlands. If the Andes are to be truly ours, the people of the **Peruvian** and **New Grancolombian** highlands must stand as one, free from the Bourbons.
The mountain peaks themselves are the fortress we guard. Without the full liberation of the southern Andes, our revolution is incomplete. We fight not for land's sake, but for the soul of the continent. Every square mile of the Andes that bears the name of the Republic is a step forward in our quest for eternal freedom.
*Long live the liberty of the Andes!*
from npcpy import get_llm_response
response = get_llm_response("Who was the celtic god that helped cuchulainn in his time of need as the forces of medb descended upon the men of ulster?", model='gemma4:31b', provider='ollama')
print(response['response'])
Cú Chulainn was primarily aided by his divine father, the god Lugh, and his foster-father, the warrior-god Fergus mac Róich, as well as the magical support of his teacher Scáthach.
Try out almost 200 different models from 15 different providers with OrcaRouter using our referral link!
alicanto_test = get_llm_response('what does alicanto the bird show travelers in the night?', model='google/gemini-3.8-flash', provider='orcarouter')
print(alicanto_test['response'])
The legend of the **Alicanto** says that at night the bird’s feathers glow like lanterns.
When a traveler sees that soft, phosphorescent light, it isn’t just a pretty sight – it’s a sign‑post.
The bird **shows the way to hidden water (and sometimes to buried silver or gold)** in the Atacama Desert.
Sometimes you do not want prose back from a model. You want a label, a yes/no
probability, or a value on a rubric, fast, with a confidence your code can
threshold on. That is what decision models are for. npcpy exposes one surface
(choice / noul / score / predict) and every backend returns the same
result objects.
The local Ollama backend needs no API key and no training, so it is the quickest way to try this:
ollama pull tev1:0.8b
from npcpy import DecisionSystem1
decisions = DecisionSystem1.from_ollama(model="tev1:0.8b")
ticket = "I was charged twice for my order. Please refund the extra payment."
# yes/no -> P(true) in [0, 1]
print(round(decisions.noul(
ticket, instructions="Is the customer asking for a refund?"
).noul, 4))
# 0.9933
# choice -> the winning label plus a probability for every option
team = decisions.choice(
ticket,
instructions="Which team should handle this ticket?",
criteria={"billing": "Payments and refunds", "technical": "Bugs and integrations"},
)
print(team.choice, round(team.confidence, 4), team.probabilities)
# billing 0.9931 {'billing': 0.9994, 'technical': 0.0006}
# score -> probability-weighted average over an ordered rubric
urgency = decisions.score(
ticket,
instructions="How urgent is this ticket?",
criteria=["Routine", "Soon", "Urgent"],
)
print(round(urgency.score, 4), urgency.legend)
# 1.1292 {'0': 'Routine', '1': 'Soon', '2': 'Urgent'}
Ask many questions about the same input in one pass, then route on the numbers:
from npcpy import DecisionQuestion, decision_route
questions = [
DecisionQuestion(name="refund", type="noul",
instructions="Is the customer asking for a refund?"),
DecisionQuestion(name="team", type="choice",
instructions="Which team should handle this ticket?",
criteria={"billing": "Payments and refunds",
"technical": "Bugs and integrations"}),
DecisionQuestion(name="urgency", type="score",
instructions="How urgent is this ticket?",
criteria=["Routine", "Soon", "Urgent"]),
]
result = decisions.decide(ticket, questions)
print({name: answer.to_dict() for name, answer in result.answers.items()})
Hosted decision models use the exact same model / provider / api_key
arguments as get_llm_response, so there is nothing new to learn. The API key
defaults to the usual environment variable:
from npcpy import DecisionSystem1
decisions = DecisionSystem1(provider="gemini", model="gemini-decision-1")
# or: DecisionSystem1(provider="perplexity", model="pplx-decider-latest")
# or: DecisionSystem1(provider="openai", model="gpt-6-luna")
The functional helpers accept the same arguments:
from npcpy import decision_choice, decision_noul
decision_noul(
ticket,
instructions="Is this a refund request?",
provider="ollama",
model="tev1:0.8b",
)
decision_choice(
ticket,
instructions="Which team?",
criteria={"billing": "Payments", "technical": "Bugs"},
provider="gemini",
model="gemini-decision-1",
)
Under the hood the Ollama backend speaks POST /v1/systemone, and the hosted
backends speak POST /decisions (OpenAI, Gemini, Perplexity), but they all
normalize onto the same ChoiceResult / NoulResult / ScoreResult types from
npcpy.ft.system1. See the System One Decisions guide
for the full reference.
The Agent class in npcpy comes with a set of default tools (sh, python, edit_file, web_search, etc.)
from npcpy import Agent
agent = Agent(name='File Operator', model='qwen3.5:2b', provider='ollama')
print(agent.run("Find all Python files over 500 lines in this repo and list them"))
The following Python files contain more than 500 lines:
- `./npcpy/npc_sysenv.py` (1486 lines)
- `./npcpy/memory/knowledge_graph.py` (1449 lines)
- `./npcpy/memory/kg_population.py` (618 lines)
...
Attach custom tools to a ToolAgent.
Here is an example which lets an agent generate images, fine-tune diffusion models, and then use the fine-tuned models for generation.
from npcpy import ToolAgent, gen_image
from npcpy.ft.diff import train_diffusion, generate_image, DiffusionConfig
from datasets import load_dataset
import os
def fetch_image_dataset(dataset_name: str, split: str = "train", max_images: int = 100) -> list:
"""Fetch images from a HuggingFace dataset.
Args:
dataset_name: HuggingFace dataset name (e.g., 'cifar10', 'oxford-iiit-pet')
split: Dataset split to use
max_images: Maximum number of images to fetch
Returns:
List of paths to saved images
"""
dataset = load_dataset(dataset_name, split=f"{split}[:{max_images}]")
os.makedirs("training_images", exist_ok=True)
image_paths = []
for i, item in enumerate(dataset):
if 'image' in item:
img = item['image']
elif 'img' in item:
img = item['img']
else:
continue
path = f"training_images/img_{i:04d}.png"
img.save(path)
image_paths.append(path)
return image_paths
def finetune_diffusion_model(
image_paths: list,
captions: list = None,
output_path: str = "my_diffusion_model",
num_epochs: int = 50,
) -> str:
"""Fine-tune a diffusion model on a set of images.
Args:
image_paths: List of paths to training images
captions: Optional captions for each image
output_path: Where to save the trained model
num_epochs: Number of training epochs
Returns:
Path to the trained model
"""
if captions is None:
captions = ["an image"] * len(image_paths)
config = DiffusionConfig(
image_size=64,
channels=128,
num_epochs=num_epochs,
batch_size=8,
learning_rate=1e-4,
checkpoint_frequency=10,
output_model_path=output_path,
)
model_path = train_diffusion(image_paths, captions, config=config)
return model_path
# Create an agent with image generation and fine-tuning capabilities
creative_agent = ToolAgent(
name='creative_diffusion',
primary_directive="""
You help users generate images and fine-tune diffusion models.
You can: 1) Generate images using gen_image() with various prompts,
2) Fetch image datasets from HuggingFace,
3) Fine-tune diffusion models on custom image sets.
When a user submits an image or describes a style they like,
offer to fetch similar images from a dataset and fine-tune a model.
""",
tools=[fetch_image_dataset, finetune_diffusion_model, gen_image],
model='qwen3.5:2b',
provider='ollama'
)
# Example 1: Generate images
print(creative_agent.run("Generate 3 images of geometric patterns with circles and triangles"))
# Example 2: User submits an image and wants similar ones
# The agent can fetch a dataset of patterns and fine-tune a model
print(creative_agent.run("I like abstract geometric patterns. Can you fetch the cifar10 dataset and fine-tune a diffusion model that can generate images like these patterns?"))
from npcpy import CodingAgent
coder = CodingAgent(name='coder', language='python', model='qwen3.5:2b', provider='ollama')
print(coder.run("Write a script that finds duplicate files by hash in the current directory"))
A personal AI assistant that runs on your own computer and answers through messaging channels such as Slack, Telegram and WhatsApp. Its skills cover browser automation, canvas panels, app previews and shareable diffs.
Gives your AI agent a learning loop: it turns past work into reusable skills, keeps notes across sessions, and searches its own earlier conversations. It can also run on a cheap server and be reached from chat apps like Telegram.
A single CLAUDE.md file with behavioral guidelines to reduce common LLM coding mistakes, such as overcomplication and unstated assumptions. It is derived from Andrej Karpathy's observations on coding pitfalls and helps Claude Code write, review, and refactor code more carefully.
Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by running routine tasks, explaining complex code, and handling git workflows through natural language commands.
Install it with the command on its page. It includes create_jinx, knowledge_graph_skill, knowledge_index_skill. Its skills do not fire on their own yet. Free and open source.
Is this plugin yours?
Claim it with GitHubSubmit a pluginPromote it