Npc

From pipecat-ai/gradient-bang · View interactive version

Npc is an AI agent skill from the GitHub repository pipecat-ai/gradient-bang. Runs an autonomous AI task agent as a game character. Resolves a character name to its UUID, then launches the `npc-run` script which connects to the game server and executes the given task using a Pi

How to use this skill

Skill file

NPC

Runs an autonomous AI task agent as a game character. Resolves a character name to its UUID, then launches the npc-run script which connects to the game server and executes the given task using a Pipecat + Gemini LLM pipeline.

Parameters

If character_name is not provided as an argument, ask the user for it. Always ask the user for the task description.

Steps

1. Source environment variables

set -a && source .env.supabase && set +a

2. Resolve the character UUID

Look up the character by name using Supabase REST:

curl -s "${SUPABASE_URL}/rest/v1/characters?name=eq.<character_name>&select=character_id,name" \
  -H "apikey: ${SUPABASE_SERVICE_ROLE_KEY}" \
  -H "Authorization: Bearer ${SUPABASE_SERVICE_ROLE_KEY}"

This returns a JSON array. Extract the character_id from the first result. If no results are returned, report that the character was not found and stop.

3. Run the NPC task agent

Run the npc-run script with the resolved character ID and the task. Redirect all output to a log file (do NOT use tee):

uv run npc-run <character_id> "<task>" > logs/npc-<character_name>.log 2>&1 &
NPC_PID=$!
echo "NPC agent started with PID $NPC_PID, logging to logs/npc-<character_name>.log"

Run the process in the background so it doesn't block the conversation.

4. Report to the user

Show the user:

Important notes

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.