/npi

Tool use APIs platform for AI Agent

Primary LanguagePythonOtherNOASSERTION

NPI

Warning

NPi is currently under active development and the APIs are subject to change in the future release. It is recommended to use the command line tool to try it out.

NPi (Natural-language Programming Interface), pronounced as "N π", is an open-source platform providing Tool-use APIs to empower AI agents with the ability to operate and interact with a diverse array of software tools and applications.

📢 Join our community on Discord

Quickstart

Installation

Command Line Tool

Download the binary from the following links.

# For darwin/arm64
curl -O https://s.npi.ai/cli/latest/darwin/arm64/npi

# For darwin/amd64
curl -O https://s.npi.ai/cli/latest/darwin/amd64/npi

# For linux/arm64
curl -O https://s.npi.ai/cli/latest/linux/arm64/npi

# For linux/amd64
curl -O https://s.npi.ai/cli/latest/linux/amd64/npi

Then move it to /usr/local/bin or any other directory in your PATH:

chmod +x npi
sudo mv npi /usr/local/bin

Verify the installation by running npi version. If you see the output similar to the following, you are all set:

{
  "BuildDate": "2024-04-23_02:23:50-0700",
  "GitCommit": "934739f",
  "Platform": "darwin/arm64",
  "Version": "v0.0.1"
}

Setting Up NPi Server

Tip

Don't have installed Docker? Follow the official Docker Installation Guide to install Docker on your system.

Replace YOUR_OAI_KEY with your actual OpenAI API Key, then execute:

docker run -d --name npi --pull always \
    -p 9140:9140 \
    -p 9141:9141 \
    -e OPENAI_API_KEY=YOUR_OAI_KEY npiai/npi

if you run on macOS, please use:

docker run -d --name npi --pull always \
   -p 9140:9140 \
   -p 9141:9141 \
   -e OPENAI_API_KEY=YOUR_OAI_KEY npiai/npi-mac

Confirm server connectivity by running npi connect test. If you receive a NPi Server is operational! message, the setup is successful. Otherwise, consult the logs with docker logs npi and report issues to NPi GitHub Repository.

Try the GitHub App

Authorize NPi to access your GitHub account

Generate a new token via GitHub Tokens Page for NPi, you may need to grant the repo scope so that NPi can access repositories on behalf of you. (Read more about scopes)

img.png

and authorize NPi's access to your GitHub account with the following command.

npi auth github --access-token YOUR_GITHUB_ACCESS_TOKEN

Support the NPi Repository

Easily star and fork the NPi Repository using:

npi app github "Star, fork, and leave a supportive message in issue #27 of npi-ai/npi"

Clean up

  1. Stop and remove the NPi container:
    docker stop npi
    docker rm npi
  2. Revoke your GitHub access token by revisiting: GitHub Tokens Page.

Python SDK

NPI Python SDK

Multi-app Agent Examples

  1. Calendar Negotiator
  2. Twitter Crawler

More: https://docs.npi.ai/examples

Roadmap

https://docs.npi.ai/roadmap

License

BSL v1.1.