npcpy  by NPC-Worldwide

AI toolkit for agent-based workflows, model integration, and rapid NLP development

Created 1 year ago
1,161 stars

Top 33.2% on SourcePulse

GitHubView on GitHub
Project Summary

This Python library and shell provide an agent-based framework for integrating AI models into workflows. It targets developers and researchers seeking to easily use, test, and explore AI models, agents, and agent systems through various interfaces like a Python library, a bash-like shell (npcsh), and an interactive coding environment (guac). The primary benefit is accelerated development and simplified testing of NLP and agent-based applications.

How It Works

The framework leverages LiteLLM for broad LLM provider integration (Ollama, OpenAI, Anthropic, Gemini, etc.). npcsh acts as a natural language and bash-compatible shell, intelligently routing commands to AI agents or executing bash code. guac offers a Pomodoro-inspired REPL for interactive coding, allowing code generation, execution, and variable inspection. Agents can be defined with directives and models, enabling complex agentic behaviors and tool use.

Quick Start & Requirements

  • Installation: pip install npcpy (or npcpy[lite], npcpy[local], npcpy[yap], npcpy[all] for extended features).
  • Prerequisites: Python 3.x, espeak, portaudio19-dev, alsa-base, alsa-utils, libcairo2-dev, libgirepository1.0-dev, ffmpeg, inotify-tools (Linux); portaudio, ffmpeg, pygobject3 (macOS); Ollama, FFmpeg (Windows). Ollama and model pulls (e.g., ollama pull llama3.2) are recommended.
  • Setup: Requires installing system dependencies and potentially Ollama. Configuration involves an .npcshrc file and optional .env for API keys.
  • Docs: npcpy.readthedocs.io

Highlighted Details

  • Supports local and enterprise LLM providers via LiteLLM integration.
  • npcsh allows switching between agentic, conversational, and direct bash execution modes.
  • guac provides a unique interactive coding REPL with a Pomodoro-like session structure.
  • Pioneering methods for knowledge graph construction and mixture-of-agent scenarios.

Maintenance & Community

  • Active development with recent significant structural changes noted (v0.3.35, v0.3.33).
  • Contributions welcome via GitHub issues and pull requests.
  • Newsletter signup available for updates.

Licensing & Compatibility

  • MIT License.
  • Compatible with commercial use and closed-source linking.

Limitations & Caveats

The project has undergone significant structural changes, with some components like NPCCompiler being phased out. Fedora installation is noted as "under construction." Some functionalities like /ots and /whisper are specifically mentioned as working well on Windows, implying potential platform-specific nuances.

Health Check
Last Commit

2 days ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
3
Star History
48 stars in the last 30 days

Explore Similar Projects

Starred by Elvis Saravia Elvis Saravia(Founder of DAIR.AI), Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), and
5 more.

activepieces by activepieces

0.5%
20k
Open-source Zapier alternative for AI workflow automation
Created 3 years ago
Updated 14 hours ago
Feedback? Help us improve.