NPC-Worldwide/npcpy
The python library for research and development in NLP, multimodal LLMs, Agents, ML, Knowledge Graphs, and more.
What it solves
npcpy is a library designed to simplify the development of complex AI applications by providing a unified interface for multimodal language models, agentic AI, and knowledge graphs. It removes the friction of switching between different local and cloud LLM providers and provides structured ways to manage AI personas, multi-agent collaboration, and long-term memory.
How it works
The library acts as a data layer between the user and various LLM providers (such as Ollama, Llama.cpp, Gemini, and OpenAI). It uses a "Context-Agent-Tool" architecture to ensure application compliance through software logic rather than relying solely on prompts.
Key components include:
- NPCs and Agents: High-level abstractions for personas with specific directives. Specialized agents like
CodingAgentcan auto-execute code, whileToolAgentcan be extended with custom Python functions. - NPCArray: A framework for running parallel inference across multiple models and managing multi-agent debates or iterative refinement chains.
- Knowledge Graphs: A memory system that supports an incremental evolution lifecycle, including "sleep" (consolidation/pruning) and "dream" (speculative connection generation) processes.
- Team Orchestration: A system for defining multi-agent teams via configuration files (
.npc,.jinx,.ctx) that can be executed as standalone scripts.
Who it’s for
It is built for researchers and developers creating agentic AI systems, multimodal applications, or simulations requiring structured multi-agent interactions and persistent, evolving knowledge bases.
Highlights
- Provider Agnostic: Supports local (Ollama, LM Studio, etc.) and cloud providers (Gemini, OrcaRouter, etc.) through a single API.
- Multi-Agent Debate: Built-in tools for parallel inference and consensus-building among different AI personas.
- Automated Coding:
CodingAgentcan write and execute scripts to solve tasks autonomously. - Lifecycle-based Memory: Implements a knowledge graph with biological-inspired sleep and dream cycles for data refinement.
- Multimodal Support: Integrated functions for image, audio, and video generation.
- Structured Output: Native support for JSON and Pydantic models for reliable data extraction.
Related
- Project
- Project
- Project
- Project
- Project