# Quickstart

This guide walks you through using the DBNL [Sandbox](/v0.26.x/platform/deployment/sandbox.md) and [SDK Log Ingestion](/v0.26.x/configuration/data-connections/sdk-log-ingestion.md) using the [Python SDK](/v0.26.x/reference/python-sdk.md) to create your first project, submit log data to it, and start analyzing. See this Quickstart as a 3 min video here \[link].

{% hint style="warning" %}
If you would like to create your first project using [SQL Integration Ingestion](/v0.26.x/configuration/data-connections/sql-integration-ingestion.md) or [OTEL Trace Ingestion](/v0.26.x/configuration/data-connections/otel-trace-ingestion.md) instead of  [SDK Log Ingestion](/v0.26.x/configuration/data-connections/sdk-log-ingestion.md) then skip over to the full [Project Setup](/v0.26.x/configuration/data-pipeline.md) docs. The approach and example data below is the fastest way to explore the product locally from scratch.
{% endhint %}

{% stepper %}
{% step %}

### Get and install the latest DBNL SDK and Sandbox.

{% hint style="info" %}
If you already have the SDK and a deployment of DBNL already running and accessible, just log in and skip to step 2.
{% endhint %}

```bash
pip install --upgrade dbnl
dbnl sandbox start
```

Log into the sandbox at <http://localhost:8080> using

* Username: `admin`
* Password: `password`

{% hint style="info" %}
For more deployment options see [Deployment](/v0.26.x/platform/deployment.md), including more detailed instructions for deploying and administering the [Sandbox](/v0.26.x/platform/deployment/sandbox.md).
{% endhint %}
{% endstep %}

{% step %}

### Create a Project

1. Click the "+ New Project" button on the [Namespace](/v0.26.x/platform/administration.md) landing page
2. Give the project a name like `DBNL quickstart project`
3. Add or create a default [Model Connection](/v0.26.x/configuration/model-connections.md) for the Project.
4. Choose SDK Ingestion as the [Data Connection](/v0.26.x/configuration/data-connections.md). Creating and saving an [API Token](/v0.26.x/platform/authentication.md) for later.

{% hint style="info" %}
Check out the Setup docs \[link] for more details about Projects \[link], LLM Connections \[link], Data Connections \[link], and more.
{% endhint %}
{% endstep %}

{% step %}

### Upload example data

{% hint style="info" %}
You can replace the data below with your real production AI logs. Just make sure they are formatted using our DBNL Semantic Convention \[link]. For more information see SDK Ingestion \[link].
{% endhint %}

```python
DBNL_API_URL = "http://localhost:8080/api"
DBNL_API_TOKEN = ""

import random
from datetime import UTC, datetime, timedelta

import dbnl
import pandas as pd

# Login to dbnl.
dbnl.login(api_url=DBNL_API_URL, api_token=DBNL_API_TOKEN)
# Use current time as reference point.
now = datetime.now(tz=UTC)
# Get or create a new project.
project = dbnl.get_or_create_project(
    name=f"quickstart-{now.isoformat()}",
    schedule="daily",
)
```

<pre class="language-python"><code class="lang-python"><strong># Backfill first 8 days of data.
</strong>now_date = now.replace(hour=0, minute=0, second=0, microsecond=0)
start_date = now_date - timedelta(days=17)
end_date = now_date - timedelta(days=9)
for dt in pd.date_range(start_date, end_date):
    dbnl.report_run_with_results(
        project=project,
        data_start_time=dt,
        data_end_time=dt + timedelta(days=1),
        column_data=pd.DataFrame([
            {
                "timestamp": dt + timedelta(minutes=30 * i),
                "input": f"Is {i} an even or odd number?",
                "output": random.choice(["even", "odd"]),
            }
            for i in range(20)
        ]).astype({
            "timestamp": "datetime64[us, UTC]",
            "input": "string",
            "output": "category",
        }),
    )
</code></pre>

{% hint style="info" %}
You should see data rolling into the platform. Depending on the latency of your LLM Connection \[link] it may take several minutes to ingest, enrich, analyze, and report your first insights. You can check on the status of these jobs by clicking on the "Status" button on the lower left of the project panel.
{% endhint %}
{% endstep %}

{% step %}

### Discover, investigate, and track behavioral signals

1. Go back to the DBNL project at <http://localhost:8080>
2. Discover your first behavioral signals by clicking on "Insights"
3. Investigate these insights by clicking on the "Explorer" or "Logs" button
4. Track segments by clicking "Add Segment to Dashboard"
   {% endstep %}

{% step %}

### Upload more data to see new signals and see tracked signals evolve over time

```python
# Backfill another 8 days of data.
now_date = now.replace(hour=0, minute=0, second=0, microsecond=0)
start_date = now_date - timedelta(days=8)
end_date = now_date - timedelta(days=1)
for dt in pd.date_range(start_date, end_date):
    dbnl.report_run_with_results(
        project=project,
        data_start_time=dt,
        data_end_time=dt + timedelta(days=1),
        column_data=pd.DataFrame([
            {
                "timestamp": dt + timedelta(minutes=30 * i),
                "input": f"Is {i} an even or odd number?",
                "output": random.choice(["even", "odd"]),
            }
            for i in range(20)
        ]).astype({
            "timestamp": "datetime64[us, UTC]",
            "input": "string",
            "output": "category",
        }),
    )
```

Go back to the DBNL project at <http://localhost:8080> and repeat step 4
{% endstep %}
{% endstepper %}

## Next Steps

* Create a Project with your own data using OTEL Trace, SQL, or SDK ingestion. \[link]
* Learn more about the Adaptive Analytics Workflow \[link]
* Deploy the full DBNL platform \[link]


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.dbnl.com/v0.26.x/get-started/quickstart.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
