---
title: "npcpy Packs Multi-Agent Teams, Memory Graphs, and Fine-Tuning Into one Open-Source Library"
subtitle: "npcpy bundles agents, knowledge graphs, sleep-and-dream memory cycles, and fine-tuning into a single Python library for local or cloud LLMs."
url: "https://alphasignal.ai/news/npcpy-packs-multi-agent-teams-memory-graphs-and-fine-tuning-into-one-open"
author: "AlphaSignal Newsroom"
author_url: "https://alphasignal.ai/editorial-team"
company: "AlphaSignal"
company_url: "https://alphasignal.ai/company/alphasignal"
published: "2026-05-10T04:19:28.000Z"
updated: "2026-08-22T03:39:51.381Z"
type: "Repo"
topics:
  - "Development"
  - "Open Source"
subtopics:
  - "Code Agents"
upvotes: 11
source_url: "https://github.com/NPC-Worldwide/npcpy"
comments: 0
truncated: true
---

# npcpy Packs Multi-Agent Teams, Memory Graphs, and Fine-Tuning Into one Open-Source Library

> npcpy bundles agents, knowledge graphs, sleep-and-dream memory cycles, and fine-tuning into a single Python library for local or cloud LLMs.

Most agent frameworks pick a lane: orchestration, memory, tool calling, or fine-tuning. [npcpy](https://github.com/NPC-Worldwide/npcpy) tries to be all of them at once, packaging multi-agent teams, a knowledge graph with a sleep/dream lifecycle, parallel model arrays, and SFT/DPO training into one MIT-licensed Python library. It has crossed 1.4k stars on GitHub, and the design choices are unusual enough to be worth a closer look.

The library provides primitives for research and development with multimodal language models, agentic AI, and knowledge graphs, with support for local runtimes like Ollama, llama.cpp, omlx, and LM Studio alongside cloud providers. Everything hangs off a single abstraction, the NPC (Non-Player Character), which carries a persona, a directive, tools, and memory across whichever backend you point it at.

## Agents that know what they are

The core object is an `NPC` with a name, a primary directive, and a model/provider pair. Three agent subclasses sit on top: Agent with default tools, ToolAgent for custom tools plus MCP, and CodingAgent that auto-executes code blocks from LLM responses. The tool set on the base Agent already includes shell, Python, file editing, and web search, so a two-line agent can list every Python file over 500 lines in a repo without extra wiring.

Teams are defined either in code or through files on disk. A `team.ctx` YAML file picks a coordinator (the `forenpc`), each agent lives in its own

_Preview only. Full text requires an AlphaSignal Pro account._

## Sources

- [NPC-Worldwide/npcpy](https://github.com/NPC-Worldwide/npcpy)
- [npcpy documentation](https://npcpy.readthedocs.io/en/latest/)
- [A Quantum Semantic Framework for NLP](https://arxiv.org/abs/2506.10077)
