Skip to content

Getting Started with AI-Parrot

AI-Parrot is an async-first Python framework for building AI agents and chatbots. This guide takes you from a plain operating system to a working install and a first running agent.

Every command below is explained — what it does, why the step needs it, and what it changes on your machine — so you can decide whether to run it rather than pasting it blindly. Commands that need sudo or fetch something over the network additionally state their blast radius and, where one exists, a non-piped alternative you can inspect before running.

Supported Python: AI-Parrot requires Python 3.11 (3.11.4 or later), 3.12 or 3.13. Python 3.14 is not yet supported — the package will refuse to install on it.


1. Prerequisites

Pick your operating system below. Each block installs Python (if you don't already have a supported version) and git.

Ubuntu 24.04.4 LTS+

sudo apt-get update
sudo apt-get install -y python3.12 python3.12-venv python3-pip git
  • apt-get update refreshes Ubuntu's local package index from its configured repositories — it does not install or change anything by itself.
  • apt-get install -y ... installs Python 3.12 (a supported version), its standard-library venv module, pip, and git. Blast radius: this modifies system-wide packages under /usr and requires sudo. If you'd rather not run it blind, inspect what it would do first with apt-get install -y --dry-run python3.12 python3.12-venv python3-pip git, which prints the plan without changing anything.
  • Ubuntu 24.04 ships Python 3.12 in its default repositories, so no extra PPA is required for a supported interpreter.

macOS 14+

xcode-select --install   # if you don't already have the Xcode CLI tools
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install python@3.12 git
  • xcode-select --install installs Apple's Command Line Tools (compiler, git, standard Unix utilities) if you don't already have them — a one-time, interactive, GUI-prompted install; skip it if xcode-select -p already prints a path.
  • The curl | bash line installs Homebrew, macOS's package manager. Blast radius: it downloads and executes a remote script with your user's privileges (it will prompt for sudo itself when it needs to create /opt/homebrew). A non-piped alternative: download the script first (curl -fsSL -o install.sh <url>), read it, then run bash install.sh. Skip this step entirely if you already have Homebrew (brew --version).
  • brew install python@3.12 git installs a supported Python and git under Homebrew's own prefix — it does not touch the system Python.

Windows 10+

winget install Python.Python.3.12
winget install Git.Git
  • winget install Python.Python.3.12 installs a supported Python release via the Windows Package Manager (already present on Windows 10 2004+ and all of Windows 11). It installs to the current user's app data by default — no system-wide change.
  • winget install Git.Git installs Git for Windows the same way.
  • Prefer an interactive install instead? Download both installers directly from python.org and git-scm.com and run them manually — the winget commands above are a scripted shortcut to the same installers, not a different source.

2. Install the package

Create an isolated virtual environment first, then install AI-Parrot into it. Using a venv means the install only ever touches files inside the project directory — nothing system-wide, and rm -rf .venv fully undoes it.

Linux / macOS:

python3.12 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install ai-parrot

Windows (PowerShell):

py -3.12 -m venv .venv
.venv\Scripts\Activate.ps1
pip install --upgrade pip
pip install ai-parrot
  • python -m venv .venv creates a self-contained Python environment in a new .venv/ directory — no admin/sudo privileges needed.
  • The activate step points your shell's python/pip at that environment instead of the system one, for the rest of this session only.
  • pip install --upgrade pip updates the venv-local pip (not the system one) so the next command resolves dependencies with a current resolver.
  • pip install ai-parrot downloads AI-Parrot and its core dependencies from PyPI into .venv/. This is a real network fetch of third-party code — the package is public on PyPI if you want to inspect it first.

If you prefer uv (a faster, drop-in alternative to pip/venv), the equivalent is:

uv venv .venv
uv pip install --python .venv/bin/python ai-parrot

A bare install alone is not enough to talk to an LLM — see the next section.

Global install (managed runtime, no project venv)

Instead of a per-project venv you can install AI-Parrot once per machine. One command puts parrot, wikitoolkit and bookstore on your PATH, backed by a managed runtime under ~/.parrot (or $PARROT_HOME): a compatible system uv or a private pinned uv, a uv-managed Python 3.12 and a venv holding ai-parrot together with ai-parrot-tools at the same version (wikitoolkit mcp needs it). It needs no system Python.

Supported platforms. The global install is officially supported on Linux x86_64 only. Linux aarch64 (ARM servers) is not supported: no wheel is published for it and the installer refuses it. On macOS arm64 and Windows x64 the installer runs but prints a warning. On macOS some dependencies (python-datamodel, navconfig, navigator-api, navigator-auth) publish no arm64 wheel, so the install compiles them and needs a C toolchain. On Windows it currently fails: navigator-auth has no Windows wheel, and uvloop, which proxylists requires, does not run on Windows. This affects a project install on Windows too. Details: wiki/operations/install/global-runtime.md.

Linux / macOS:

curl -fsSL https://raw.githubusercontent.com/phenobarbital/ai-parrot/main/scripts/install/install-parrot.sh | bash -s -- --global

Downloads: the script above and, only when no compatible system uv is available, the pinned uv 0.11.28 archive plus its .sha256 file (https://github.com/astral-sh/uv/releases/download/0.11.28/uv-<target>.tar.gz), then ai-parrot and ai-parrot-tools from PyPI. A system uv in >=0.11.28,<0.12 is recorded and reused; all other system uv installations are left as is. Writes: ~/.parrot/bin, ~/.parrot/libexec, ~/.parrot/venv and ~/.parrot/python, plus a # >>> parrot >>> PATH block in your shell profile. If they are missing, it also writes the credentials file ~/.parrot/env/.env (mode 0600, every key commented out) and an empty ~/.parrot/etc/config.ini for navconfig. Existing ~/.parrot data (wikis, library, skills, brains, parrot.db, an existing env/.env) is never touched. Your own uv is never modified, moved or removed; a pinned fallback lives under ~/.parrot/libexec, never on PATH. Verified by: the uv archive checksum, then parrot self doctor --runtime-only; a failure removes only what the run created. Before writing anything the script checks the platform, curl/wget, sha256sum, git, 2 GiB of free space under PARROT_HOME and that GitHub and PyPI are reachable, and prints a plan first. Without piping: download install-parrot.sh and SHA256SUMS from https://raw.githubusercontent.com/phenobarbital/ai-parrot/main/scripts/install/, run sha256sum -c --ignore-missing SHA256SUMS (macOS: shasum -a 256 -c --ignore-missing SHA256SUMS), read the script, then run bash install-parrot.sh --global. Add --dry-run to print the plan only.

Windows (PowerShell):

powershell -ExecutionPolicy Bypass -Command "& ([scriptblock]::Create((irm https://raw.githubusercontent.com/phenobarbital/ai-parrot/main/scripts/install/install-parrot.ps1))) -Global"

Downloads: the script above and, only when no compatible system uv is available, the pinned uv 0.11.28 zip plus its .sha256 file, then ai-parrot and ai-parrot-tools from PyPI. A system uv in >=0.11.28,<0.12 is recorded and reused; all other system uv installations are left as is. Writes: ~\.parrot\bin, ~\.parrot\libexec, ~\.parrot\venv and ~\.parrot\python, and adds ~\.parrot\bin to your USER PATH (never the Machine PATH); reopen the terminal afterwards. If they are missing, it also writes ~\.parrot\env\.env (readable only by you, every key commented out) and an empty ~\.parrot\etc\config.ini. Your own uv is never modified, moved or removed; a pinned fallback lives under ~\.parrot\libexec, never on PATH. Verified by: the uv checksum (Get-FileHash), then parrot self doctor --runtime-only; a failure removes only what the run created. Without piping: Invoke-WebRequest both install-parrot.ps1 and SHA256SUMS from the same folder, compare (Get-FileHash install-parrot.ps1).Hash with its line in SHA256SUMS, read the script, then run powershell -ExecutionPolicy Bypass -File install-parrot.ps1 -Global.

Windows status (pending CI verification): the -Global path has not yet run on a Windows runner. CI checks the script's syntax, its -DryRun plan and its pre-write gates under pwsh on Linux; the install itself, the post-install rollback and the USER PATH restore are covered only by an offline harness that is still marked expected-to-fail. They become verified claims when the install-matrix Windows leg passes.

Options (PowerShell name in parentheses):

  • --provider <k>[,<k>...] (-Provider): the LLM provider extras of the managed venv: anthropic (the default), openai, google, claude-code, codex-code. To add a provider later, run the installer again with --provider <k>; it reuses the existing venv.
  • --with <component>[,...] (-With): also install the packages an MCP toolkit needs, for example --with scraping (Playwright and Chromium). It is the same as running parrot self add <component> later (see MCP toolkits below). An unknown name fails before anything is downloaded and lists the valid ones.
  • --version <X> (-Version): pin ai-parrot and ai-parrot-tools to one release.

--with and --version only apply to --global.

Your API keys go in ~/.parrot/env/.env: uncomment the lines you need and fill them in. The SDD flow and wikitoolkit need no key.

Reference detail (gate, plan text, launcher order, --portable, version skew) is in wiki/operations/install/global-runtime.md.

Manage the runtime: parrot self

  • parrot self add <component> installs the packages an MCP toolkit needs into the managed venv; --here installs into the current project venv instead, and is the only way a dependency enters a project venv.
  • parrot self env prints the venv the launcher resolves, the rule that picked it and the versions; parrot self env --init creates env/.env and etc/config.ini if they are missing.
  • parrot self doctor diagnoses the runtime, host configs and toolkit requirements.
  • parrot self update upgrades ai-parrot and ai-parrot-tools together in the managed venv (--version pins one).
  • parrot self uninstall removes only bin/, venv/ and python/; your credentials (env/), etc/ and data stay (--yes skips the prompt). The PATH block in your shell profile stays too; delete it by hand.

MCP toolkits: parrot self add and parrot toolkits install

A toolkit (scraping, querysource, sdd-coder, ...) is an MCP server your coding assistant can call. Using one takes up to two steps, with different scopes:

  1. parrot self add <name>: installs the Python packages the toolkit needs (and a post-install step, such as downloading Chromium) into the managed venv. Once per machine. --with <name> at install time does the same. Only scraping and browsing (Playwright and Chromium) and querysource (ai-parrot-tools[db]) need it; the other toolkits run on the base runtime.
  2. parrot toolkits install <name> --yes: adds the toolkit to the repository's .parrot/mcp-toolkits.yaml and registers its MCP server with Claude Code, Codex or Antigravity (--host claude|codex|google; default: every host detected in the repository). Once per repository. Without a name it opens an interactive picker.
parrot self add scraping                                # once per machine
cd my-repo && parrot toolkits install scraping --yes    # once per repository
parrot toolkits list                                    # state, hosts and missing packages per toolkit

parrot toolkits install does not install packages. If a toolkit's packages are missing it prints run: parrot self add <name>, and parrot self doctor reports it.


3. Install a provider (REQUIRED)

pip install ai-parrot alone registers ZERO LLM providers. Every concrete provider client ships as its own ai-parrot-client-<provider> satellite package, discovered via Python entry points. Until you install at least one, LLMFactory.list_providers() returns {} and any agent you create will fail with an "unsupported LLM" error the first time it tries to call a model — with no earlier warning. Installing a provider is not optional; it is step 3 of getting a working agent, not a later refinement.

There are two supported ways to add a provider:

Option A — API-key providers

Install the extra for the vendor whose API key you have, then set the key as an environment variable.

pip install "ai-parrot[anthropic]"    # Anthropic (Claude models)
# or:
pip install "ai-parrot[openai]"       # OpenAI
# or:
pip install "ai-parrot[google]"       # Google Gemini
  • Each command installs one ai-parrot-client-<provider> satellite package and its SDK from PyPI — a normal, scoped dependency install, not a system change.
  • Set the matching API key as an environment variable before running any code that uses it, e.g. (Linux/macOS) export ANTHROPIC_API_KEY=sk-... or (PowerShell) $env:ANTHROPIC_API_KEY = "sk-...". Never commit a key to a file in your repository.

Option B — CLI-backed providers

If you already run the Claude Code or Codex coding-agent CLI on this machine, AI-Parrot can reuse that CLI's own authentication instead of a separate API key.

pip install "ai-parrot[claude-agent]"
pip install "ai-parrot[codex-agent]"
  • These extras install ai-parrot-client-anthropic / ai-parrot-client-openai with the SDK that talks to an already-running claude / codex CLI session — they do not install the CLI binaries themselves (see the installer scripts below for that).
  • Authentication is delegated to the CLI. ClaudeAgentClient picks up ANTHROPIC_API_KEY from the environment when set, otherwise it relies on whatever auth flow you already completed via claude auth. The same idea applies to Codex and its own CLI auth.
  • Caveat: AI-Parrot's detect_coding_agent_llm() helper only checks whether the claude/codex binary is on your PATH (shutil.which) — it does not check whether you're actually logged in. A CLI binary that is installed but logged out will pass detection and then fail the first time it actually tries to call the model. If a call fails right after a clean detection, check your CLI's own auth status first (claude auth status / the Codex equivalent).
  • You can install one, several, or none of the CLI-backed options independently of the API-key options above — pick whichever paths match what you already have.

You can install any combination of the extras above; LLMFactory discovers whatever is present.

One asymmetry to know: Gemini has no CLI-backed provider path in AI-Parrot. It is reachable only via the google (API key) extra above, or google-compat (OpenAI-compatible wire format over the same Gemini API key) — never through a coding-agent CLI.


4. Hello world

With a provider installed and its key/auth in place, this runs a minimal agent end to end. It is adapted from examples/basic_agent.py in the repository, with one deliberate change: it passes llm="anthropic" (swap in whichever provider extra you installed) and from_database=False explicitly.

import asyncio
from parrot.bots.agent import BasicAgent

async def get_agent(question: str):
    # from_database=False is deliberate: Chatbot (which BasicAgent extends)
    # defaults to from_database=True, which tries to load the bot's
    # configuration from a Postgres database you likely haven't set up yet.
    # For a first run, skip that and configure the agent manually instead.
    agent = BasicAgent(name="HelperAgent", llm="anthropic", from_database=False)
    await agent.configure()
    response = await agent.invoke(question)
    return response.output, response

if __name__ == "__main__":
    answer, response = asyncio.run(get_agent("What is the capital of France?"))
    print(answer)

Run it with python hello_world.py (after activating your venv). It makes one real network call to whichever provider you chose in step 3 — expect a one-line answer. With the global install there is no venv to activate: run ~/.parrot/venv/bin/python hello_world.py and put the key in ~/.parrot/env/.env (the managed venv already has the anthropic provider unless you chose another --provider).

Two things this snippet deliberately avoids:

  1. The from_database=True trap. Chatbot.__init__ (the base class BasicAgent extends) defaults from_database=True, which — with no explicit argument — tries to load the bot's configuration from a Postgres database on configure(). That's the right choice once you're persisting named bots, but it is the wrong default for a first run with nothing set up. Passing from_database=False configures the agent purely from the constructor arguments instead.
  2. The zero-providers trap from step 3. llm="anthropic" is explicit here, not left to the default, precisely because a bare install has no default provider to fall back to.

5. Building and querying the codebase knowledge graph

wikitoolkit ships as a console script with the base package — no extra install needed for build/query themselves (some optional per-language scanners are covered in the next section).

wikitoolkit build
  • Scans the current repository deterministically — no LLM calls, no embeddings, no network access — and writes a local SQLite knowledge-graph index under .parrot/wiki/. Safe to re-run; it incrementally re-indexes only changed files.
wikitoolkit query "where is the ingest pipeline implemented?"
  • Runs a token-budgeted, ranked lexical search over that local index and prints matching page stubs — again, fully offline once build has run.

Use the SDD flow in your repo

With the global runtime installed, any git repository (Python or not) can adopt the Spec-Driven Development flow:

parrot sdd install --host claude --dry-run   # preview: write / skip / upgrade per file; changes nothing
parrot sdd install --host claude             # deploy commands, skills, helpers and seeds
parrot self doctor --sdd                     # origin, base branch, ledger, worktrees ignore, gh, jq, python3, host CLIs
parrot sdd status                            # missing | current | outdated | edited | foreign
  • The install writes the host's /sdd-* commands, the seeds sdd/config.json, sdd/CONVENTIONS.md and sdd/tasks/.id_ledger.json, an ignore block for the resolved worktree root (default .parrot/worktrees/, or WORKTREE_BASE_PATH) and .parrot/, a marked .gitattributes block (merge=union for the ledger log) and the four parrot-ledger git hooks. What it wrote is recorded in sdd/.sdd-installed.json; commit it. parrot sdd install and parrot self doctor refuse while worktrees remain under the legacy .claude/worktrees/ and print the migration recipe. /sdd-insight is not installed.
  • Edit sdd/config.json: base_branch, hotfix_base, issue_tracker, test_command, ... A repository whose tests are not pytest (Node, Rust, Go, ...) MUST set test_command (e.g. "npm test"): without it, /sdd-task rejects every non-pytest validation command. When test_command is set, the shipped test steps run it once from the repo root instead of the selection/report steps (cache_test_contract in /sdd-task, select_tests / test_report in /sdd-done), and a run with no tests shows "not run". When it is null the ai-parrot selection path applies, and parrot sdd install warns.
  • Fill in the sdd/CONVENTIONS.md seed (## Repository layout, ## Project areas); it is created once and never overwritten.
  • Then open your assistant and run your first /sdd-spec ... command. Helpers run as parrot sdd <noun> <verb> (for example parrot sdd ids reserve --help).
  • The install also prepares the SDD base branch (base_branch from sdd/config.json, default dev): when the repository has a commit and the branch is missing it creates the local branch (tracking origin/<base> if that exists, otherwise from HEAD); it never moves or deletes an existing branch and uninstall keeps it. A repo with no commit yet, or no origin, gets a warning: / note: with the exact command. --base-branch NAME seeds sdd/config.json with that branch (refused if the config already sets another); a repo that integrates on main also passes --hotfix-base NAME, because the base and hotfix branches must differ and main is the default hotfix branch; --push-base also runs git push -u origin <base> when origin lacks it. --dry-run shows plan: base-branch ... and creates nothing.
  • For the Claude host the install also registers a portable dangerous-actions guard (a PreToolUse hook on Bash|Edit|Write|MultiEdit in .claude/settings.json, served by parrot sdd hooks dangerous-actions --hook; stdlib only, so it works the same on Linux, macOS and Windows). It blocks git reset --hard, git clean -fd, force-push to (--force, -f or a +refspec) or deleting a protected branch (dev, main, master, staging always, plus base_branch, staging_branch and hotfix_base from sdd/config.json), git worktree remove --force, recursive deletes of /, ~, a drive root or .git/.venv, mkfs/diskutil erase*/format X:, destructive SQL through a database client, direct package publication, bare pip install in a uv-managed repo, literal API keys, and writes to secret files; each block names a safe alternative. A deliberate recovery session can set PARROT_ALLOW_DANGEROUS=1; parrot sdd install --no-dangerous-guard skips the registration. Foreign hook entries are never touched, a repository that already runs dangerous-actions-blocker is left alone, and parrot sdd uninstall removes only the entry the install recorded.
  • The install also registers the two MCP toolkits the sdd-worker agent relies on — sdd-coder and bounded-source — in .parrot/mcp-toolkits.yaml and the host MCP config (.mcp.json for Claude). It keeps the shipped sdd-coder roster and prints a static note: sdd-coder seats available: …; unavailable: … (<reason>) line (credentials and CLIs only, no model call). A warning: that complex tasks have "no retry seat" means fewer than two strong MCP seats (codex/gemini/nova) are usable — add credentials and re-run. Toolkits you installed yourself are never recorded or removed by parrot sdd uninstall; parrot sdd install --no-sdd-coder skips all of this.
  • Re-running parrot sdd install (e.g. after upgrading parrot) replaces every installed SDD file — commands, agents, rules, templates — with the packaged copy, including ones you edited or copied in by hand. Pass --keep-edits to leave those untouched (a warning lists them). Seeds such as sdd/config.json are never overwritten.

More: wiki/operations/install/global-runtime.md.


6. Optional extras

Two extras worth knowing about beyond the provider ones in step 3:

pip install "ai-parrot[jev]"
  • Installs the client for TypeSafe AI's Jev System One model — typed, calibrated decisions (routing/ranking/verification) instead of free text. Requires a TYPESAFE_API_KEY environment variable. See wiki/clients/jev.md for the full client reference.
pip install "ai-parrot[rust]"
  • Installs parrot_codec, an optional Rust-accelerated columnar codec used to compress large tool results. Pre-built wheels are published for common platforms; without this extra, AI-Parrot transparently falls back to a pure-Python implementation, so this is a performance optimization, not a functional requirement.

7. Verification checklist & troubleshooting

Confirm each of these before moving on:

  • python -c "import parrot; print(parrot.__name__)" succeeds inside your activated venv.
  • python -c "from parrot.clients.factory import LLMFactory; print(LLMFactory.list_providers())" prints a non-empty dict. An empty {} means no provider satellite is installed yet — go back to step 3.
  • wikitoolkit --help runs without error.
  • Global install: in a new terminal, parrot self doctor shows no ✗.
  • The hello-world snippet in step 4 prints an answer instead of raising.

Common failures:

Symptom Likely cause Fix
ValueError: Unsupported LLM: '<provider>' That provider's satellite isn't installed pip install "ai-parrot[<provider>]" (step 3)
Agent construction or a call raises an auth/401 error API key not set, or CLI not logged in Re-check the environment variable, or run claude auth / the Codex login flow
A CLI-backed provider "works" during detection but the call itself fails detect_coding_agent_llm() only checks the binary is on PATH, not that you're logged in Check the CLI's own auth status directly
pip install ai-parrot fails outright Unsupported Python version Confirm python --version is 3.11.4 or later, 3.12, or 3.13

8. Where to go next

  • wiki/wiki/wiki-claude-code.md — wiring wikitoolkit into Claude Code as coding-assistant infrastructure.
  • wiki/clients/jev.md — the Jev typed-decision client in depth.
  • The repository's .agent/CONTEXT.md — architectural overview of AI-Parrot's core abstractions (AbstractClient, AbstractBot/Chatbot/Agent, AbstractTool) if you're going to build beyond the hello-world above.