> ## Documentation Index
> Fetch the complete documentation index at: https://outlit-codex-platform-actions-create-update-cli.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Pi Agents

> Build Pi agents with Outlit customer intelligence tools, skills, and examples

`@outlit/pi` registers Outlit customer intelligence tools inside [Pi](https://github.com/mariozechner/pi-coding-agent). Use it when you want a Pi agent to query complete customer profiles, timelines, facts, sources, customer-context search results, and notifications through Outlit's public tool gateway.

## Install

```bash theme={null}
pi install npm:@outlit/pi
```

Set an Outlit API key before starting Pi:

```bash theme={null}
export OUTLIT_API_KEY=ok_your_api_key
pi
```

## Default Tools

The default Pi extension exposes the customer intelligence tools that are safe for most agents, plus the notification action tool:

| Tool                             | What it does                                                                                      |
| -------------------------------- | ------------------------------------------------------------------------------------------------- |
| `outlit_list_customers`          | Browse customers by billing status, activity, revenue, traits, or name                            |
| `outlit_list_users`              | Browse contacts by journey stage, activity, customer, traits, email, or name                      |
| `outlit_get_customer`            | Retrieve one complete customer profile                                                            |
| `outlit_get_timeline`            | Retrieve customer activity across product, billing, support, and conversation channels            |
| `outlit_list_facts`              | List structured facts with status, source type, date, and provenance filters                      |
| `outlit_get_fact`                | Retrieve one exact fact                                                                           |
| `outlit_get_source`              | Retrieve one exact source record behind a fact or search result                                   |
| `outlit_search_customer_context` | Search grouped source and fact results with natural language                                      |
| `outlit_send_notification`       | Send a notification through the organization's configured notifier; Slack is the default notifier |

Notification action tools are included in the default Pi toolset, but they should only be used when the user explicitly asks to send, post, or notify a result. SQL tools are available through `@outlit/tools`, but they are not enabled by default in `@outlit/pi`. Use them only for internal agents that should run read-only SQL.

## Minimal Extension

If you only need the Outlit tools and the bundled `outlit` Pi skill, the package default is enough:

```ts theme={null}
import { createOutlitPiExtension } from "@outlit/pi"

export default createOutlitPiExtension()
```

The extension reads `OUTLIT_API_KEY` from the environment and uses `https://app.outlit.ai` by default.

## Custom Toolsets

Pass `toolNames` when you want a narrower or broader toolset:

```ts theme={null}
import { allCustomerToolNames, createOutlitPiExtension } from "@outlit/pi"

export default createOutlitPiExtension({
  toolNames: allCustomerToolNames,
})
```

`allCustomerToolNames` includes the SQL tools. If you want to assemble a custom set yourself, import `defaultAgentToolNames`, `actionToolNames`, and `sqlToolNames` from `@outlit/pi` and combine them explicitly. Keep integration setup and integration-management actions outside customer-facing Pi agents unless you are building an internal admin package.

## Growth Agent Examples

The [`examples/pi-agents`](https://github.com/OutlitAI/outlit-sdk/tree/main/examples/pi-agents) package shows four Pi agents built on `@outlit/pi` for revenue and retention work. It includes:

* Outlit customer intelligence, SQL, and schema tools registered in Pi
* the generic `outlit` skill from `@outlit/pi`
* a shared growth-agent skill with evidence-gathering playbooks
* a local usage-decay churn pretriage helper with a `churn.json` config
* slash commands and editable prompt templates for usage decay, friction-to-churn, activation failure, and expansion readiness

Try it locally from the SDK repo:

```bash theme={null}
cd examples/pi-agents
npm install
export OUTLIT_API_KEY=ok_your_api_key
pi install -l .
pi
```

The example package currently uses the `canary` dist-tag for `@outlit/pi` and `@outlit/tools` so fresh installs include the notification action contracts before the next stable release is promoted.

Then ask:

```text theme={null}
/outlit-usage-decay-watchtower paying customers over $500 MRR
```

or:

```text theme={null}
Which paying customers are active enough to be expansion candidates but blocked by plan limits?
```

<CardGroup cols={2}>
  <Card title="Public Tool Gateway" icon="terminal" href="/api-reference/tools">
    See the HTTP route and shared `@outlit/tools` contracts
  </Card>

  <Card title="Agent Skills" icon="book" href="/ai-integrations/skills">
    Install Outlit guidance for coding agents
  </Card>
</CardGroup>
