> ## Documentation Index
> Fetch the complete documentation index at: https://docs.decimal.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> See both demos in 2 minutes on seeded data, then wire DecimalAI to your own agent.

## See it first — 2 minutes, no waiting for your own data

The impact report and the skills leaderboard are most convincing on *real* data — so both ship with a one-command sandbox that seeds a realistic agent and trace corpus into your workspace. See the payoff before you instrument anything.

```bash theme={null}
pip install decimalai   # requires Python 3.10+
export DECIMAL_API_KEY="dai_sk_..."   # grab one at app.decimal.ai/settings
```

<Warning>
  DecimalAI requires **Python 3.10 or newer**. On Python 3.9 and older, `pip` silently installs an outdated release that lacks the `demo` command.
</Warning>

Pick the door that matches your job — or run both:

<CardGroup cols={2}>
  <Card title="For engineers" icon="shield-check">
    **Catch regressions before they ship.**

    ```bash theme={null}
    decimalai demo regression
    ```

    Seeds a v1→v2 agent change and links you straight to the impact report — which production traces the change would break, which may behave differently, and which are unaffected.
  </Card>

  <Card title="For prompt engineers" icon="puzzle-piece">
    **Find skills that actually work.**

    ```bash theme={null}
    decimalai demo skills
    ```

    Seeds three skills with real, varied effectiveness and links you to the ranked registry — per-model pass rates and cross-org activation, not download counts.
  </Card>
</CardGroup>

<Tip>
  No account yet? Browse the [public skill registry](https://app.decimal.ai/skills) right now — no signup — to see skills ranked by production effectiveness.
</Tip>

Once a demo makes the value land, wire DecimalAI to your own agent below.

***

You'll do five things in this guide:

<Steps>
  <Step title="Install the SDK" stepNumber={1}>
    *1 minute.*
  </Step>

  <Step title="Get your API key and verify your setup" stepNumber={2}>
    *1 minute.*
  </Step>

  <Step title="Instrument your agent" stepNumber={3}>
    *3 minutes.*
  </Step>

  <Step title="View your first trace in the dashboard" stepNumber={4}>
    *1 minute.*
  </Step>

  <Step title="Add the GitHub Action so every PR gets a manifest impact report" stepNumber={5}>
    *5 minutes.*
  </Step>
</Steps>

By the end, your team's next agent change will get an automatic structural impact analysis on the PR — without you writing any eval cases. Here's the kind of report that lands on the PR:

```mermaid theme={null}
%%{init: {'theme':'base','themeVariables':{'primaryColor':'#f5f5f4','primaryBorderColor':'#a8a29e','primaryTextColor':'#44403c','lineColor':'#a8a29e'}}}%%
pie showData
    title Impact across 2,002 traces
    "HIGH IMPACT" : 247
    "MEDIUM IMPACT" : 501
    "LOW IMPACT" : 1254
```

<Card title="Run this in Colab" icon="play" horizontal href="https://colab.research.google.com/github/decimal-labs/decimalai-python/blob/main/examples/quickstart/quickstart.ipynb">
  Run the SDK portion interactively — no local setup required.
</Card>

## 1. Install the SDK

```bash theme={null}
pip install decimalai   # requires Python 3.10+
```

## 2. Get Your API Key

Sign in to the [DecimalAI Dashboard](https://app.decimal.ai) and navigate to **Settings → API Key**.

Or generate one via the API:

```bash theme={null}
curl -X POST https://api.decimal.ai/api/v1/api-keys \
  -H "Authorization: Bearer <your-token>" \
  -d '{"label": "my-key", "scope": "global"}'
```

<Tip>
  **Verify your setup instantly:** Run `decimalai init` to check your API key, test connectivity, and send a test trace — all in one command.
</Tip>

You should see:

```
✓ API key: dai_sk_8f3...3a2c
✓ Connected to workspace: ws_7Hq2Kp (scope: workspace)
✓ Test trace sent successfully

→ Open dashboard: https://app.decimal.ai/traces
→ Docs: https://docs.decimal.ai/quickstart
→ Quickstart notebook: https://colab.research.google.com/github/decimal-labs/decimalai-python/blob/main/examples/quickstart/quickstart.ipynb
```

## 3. Instrument Your Agent

<Tabs>
  <Tab title="LangChain">
    ```python theme={null}
    import decimalai

    decimalai.init(
        api_key="dai_sk_...",
        langchain=True,
    )

    # Run your agent as usual — traces are captured automatically
    agent.invoke({"input": "Hello!"})
    ```

    <Card title="Run this in Colab" icon="play" horizontal href="https://colab.research.google.com/github/decimal-labs/decimalai-python/blob/main/examples/quickstart/quickstart_langchain.ipynb">
      Live notebook, no setup — just paste your API key.
    </Card>
  </Tab>

  <Tab title="OpenAI Agents">
    ```python theme={null}
    import decimalai

    decimalai.init(
        api_key="dai_sk_...",
        openai_agents=True,
    )

    result = await Runner.run(agent, "Hello!")
    ```

    <Card title="Run this in Colab" icon="play" horizontal href="https://colab.research.google.com/github/decimal-labs/decimalai-python/blob/main/examples/quickstart/quickstart_openai_agents.ipynb">
      Live notebook, no setup — just paste your API key.
    </Card>
  </Tab>

  <Tab title="LlamaIndex">
    ```python theme={null}
    import decimalai

    decimalai.init(
        api_key="dai_sk_...",
        llamaindex=True,
    )

    # Query engines, retrievers, and LLM calls are traced automatically
    from llama_index.core import VectorStoreIndex
    index = VectorStoreIndex.from_documents(documents)
    response = index.as_query_engine().query("What is the revenue?")
    ```
  </Tab>

  <Tab title="CrewAI">
    ```python theme={null}
    import decimalai

    decimalai.init(
        api_key="dai_sk_...",
        crewai=True,
    )

    # CrewAI agent tasks, tool calls, and LLM interactions are traced
    from crewai import Crew
    crew = Crew(agents=[...], tasks=[...])
    result = crew.kickoff()
    ```
  </Tab>

  <Tab title="AutoGen / AG2">
    ```python theme={null}
    import decimalai

    decimalai.init(
        api_key="dai_sk_...",
        autogen=True,
    )

    # AutoGen agent conversations and LLM calls are traced
    from autogen import AssistantAgent
    agent = AssistantAgent("assistant", llm_config={...})
    result = await agent.run(task="Analyze this data")
    ```
  </Tab>

  <Tab title="Any Framework">
    ```python theme={null}
    import decimalai

    decimalai.init(api_key="dai_sk_...")

    @decimalai.trace(agent_name="my-agent")
    def run_agent(query: str):
        result = call_llm(query)
        return result

    run_agent("Hello!")
    ```
  </Tab>

  <Tab title="Environment Variables">
    ```bash theme={null}
    # Zero code changes — just set env vars
    export DECIMAL_API_KEY="dai_sk_..."

    # Supported values: langchain, openai-agents, llamaindex, crewai, autogen
    export DECIMAL_AUTO_TRACE=langchain

    python my_agent.py
    ```
  </Tab>
</Tabs>

<Note>
  Auto-detection depth varies by framework. LangChain and OpenAI Agents (with explicit `install(agent=...)`) extract full tool schemas; LlamaIndex / CrewAI / AutoGen extract tool *names* only. See the [capability matrix](/guides/manifests#how-auto-detection-works) before deciding which integration to commit to.
</Note>

## 4. View Your Traces

Open the [Traces page](https://app.decimal.ai/traces) in the dashboard. Your first trace should appear within seconds. Each trace is auto-tagged with the <Tooltip tip="A SHA-256 content hash of the agent's manifest — its structural fingerprint. Same config produces the same hash.">manifest hash</Tooltip> of the agent that produced it — this is what powers the regression check in the next step.

<Tip>
  Skills (SKILL.md files) in your project are auto-discovered and tracked automatically — no extra configuration needed. See [Skills](/guides/skills).
</Tip>

## 5. Add the Regression Check to your PRs (recommended)

Now wire DecimalAI into your CI so every PR gets a manifest impact report. This is the most-used capability for engineering teams.

Three things, all copy-pasteable below: a tiny `scripts/init_for_decimal.py` that calls your agent factory, a `.github/workflows/decimal.yml` that runs it under `DECIMALAI_MODE=manifest_only`, and your `DECIMAL_API_KEY` in GitHub Secrets. Here's what runs on every PR:

```mermaid theme={null}
%%{init: {'theme':'base','themeVariables':{'primaryColor':'#f5f5f4','primaryBorderColor':'#a8a29e','primaryTextColor':'#44403c','lineColor':'#a8a29e'}}}%%
flowchart LR
    A[Open PR<br/>agent change] --> B[GitHub Action<br/>DECIMALAI_MODE=manifest_only]
    B --> C[Build manifest<br/>from your agent factory]
    C --> D[Diff vs. baseline<br/>+ query trace store]
    D --> E[Post impact<br/>comment on PR]
```

**1. Add `scripts/init_for_decimal.py`** — five lines that import and call your existing agent factory. In `manifest_only` mode the SDK reads tools, prompts, and models from the runtime objects, then exits without any LLM calls:

```python scripts/init_for_decimal.py theme={null}
from myapp.agent import build_agent  # adjust to your agent factory

if __name__ == "__main__":
    build_agent()  # DECIMALAI_MODE=manifest_only captures the manifest, no LLM calls
```

**2. Add `.github/workflows/decimal.yml`:**

```yaml .github/workflows/decimal.yml theme={null}
name: Decimal Manifest Impact
on: [pull_request]

permissions:
  contents: read
  pull-requests: write  # required for the Action to post/update its PR comment

jobs:
  check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: '3.12'
      - name: Install dependencies
        run: pip install -e .
      - name: Manifest extraction
        env:
          DECIMALAI_MODE: manifest_only
          DECIMAL_API_KEY: ${{ secrets.DECIMAL_API_KEY }}
          OPENAI_API_KEY: dummy_for_init  # placeholder; NOT called in manifest_only mode
        run: python scripts/init_for_decimal.py
      - name: Impact check
        uses: decimal-labs/regression-check@v1
        with:
          api-key: ${{ secrets.DECIMAL_API_KEY }}
          agent-name: support-agent  # the same name you use in decimalai.init()
```

**3. Add the `DECIMAL_API_KEY` secret** in **Settings → Secrets and variables → Actions → New repository secret**, with the value from [app.decimal.ai/settings](https://app.decimal.ai/settings).

That's the whole setup. On your next PR you'll get a comment like this within \~30 seconds:

```
🔍 Decimal Manifest Impact — support-agent

🔴 HIGH IMPACT — 247 traces will break (called the removed `compare_competitors` tool)
🟡 MEDIUM IMPACT — 501 traces may behave differently
🟢 LOW IMPACT — 1,254 traces unaffected
```

Full setup, troubleshooting, severity thresholds, override behavior, and alerting are in the **[Regression Check Guide](/guides/regression-check)**.

## Here for skills instead?

The steps above wire up the **regression** capability — what most teams start with. The **skills** workflow is a separate, shorter track (no GitHub Action needed):

<Steps>
  <Step title="Browse the registry">
    Find skills ranked by [SkillScore](/guides/skillscore) in the [public registry](https://app.decimal.ai/skills) — no signup.
  </Step>

  <Step title="Prove one helps">
    A/B-benchmark a skill with [`skillevaluation`](/guides/skillevaluation) (`pip install "skillevaluation[runner]"`) to measure its lift on your own cases.
  </Step>

  <Step title="Install it">
    Fork it into your workspace and write it to disk with `router.install(...)` — see the [Skills guide](/guides/skills).
  </Step>
</Steps>

## Next Steps

<CardGroup cols={2}>
  <Card title="Regression Check Guide" icon="shield-check" href="/guides/regression-check">
    Full configuration, troubleshooting, and severity tuning for the GitHub Action.
  </Card>

  <Card title="Manifests Guide" icon="layer-group" href="/guides/manifests">
    What manifests capture, how diffs work, and the compatibility policy model.
  </Card>

  <Card title="Concepts" icon="book-open" href="/concepts">
    How traces, manifests, evals, and datasets connect.
  </Card>

  <Card title="Training Pipeline" icon="graduation-cap" href="/tutorials/training-pipeline">
    End-to-end: trace → evaluate → fine-tune.
  </Card>
</CardGroup>
