Quickstart

Agents

Give an AI agent the fastest safe path to ingest, query, and debug RawTree data.

Quickstart for agents

Use this page when a coding agent, terminal agent, or CI worker needs to operate RawTree without extra context.

1) Install the RawTree skill

Install the RawTree skill so your agent has the CLI, API, SQL, logs, and error-handling patterns available in its working context.

npx skills add rawtreedb/agent-skills

2) Provide credentials

Use an API key for autonomous runs. You can create one in the RawTree dashboard from your project settings, or from the CLI:

rtree key create --name my-agent --permission read_write

See CLI reference / API keys for the full key commands.

Prefer the least permission that can complete the job.

export RAWTREE_TOKEN=rw_...
export RAWTREE_PROJECT=analytics
export RAWTREE_ORG=team_alpha

Recommended permissions:

TaskPermission
Insert and query dataread_write
Insert onlywrite_only
Query and inspect logsread_only
Manage API keys or delete tablesadmin

3) Verify context

rtree status --json

The response includes the resolved project, organization, authentication state, and dashboard URL.

4) Ingest data

rtree insert --table events \
  --data '[{"action":"click","user":"alice"},{"action":"view","user":"bob"}]' \
  --json

Tables are created automatically when data is inserted for the first time.

5) Query with SQL

rtree query --json \
  "SELECT action, count() AS total FROM events GROUP BY action ORDER BY total DESC LIMIT 10"

Only read-only SQL is accepted through the query API. Use LIMIT while iterating.

6) Check logs

rtree logs --since 1h --limit 50 --json
rtree logs --since 1h --type insert --status error --table events --json

Logs are the fastest way for an agent to diagnose malformed input, invalid SQL, missing tables, and permission errors.

Starter prompt

You are operating a RawTree project.

Use RAWTREE_TOKEN, RAWTREE_PROJECT, and RAWTREE_ORG from the environment.

Goals:
1. Ingest the provided data into table "events".
2. Query the table with read-only SQL.
3. Use LIMIT while exploring data.
4. Check RawTree logs from the last hour if insert or query fails.
5. Return the commands you ran and the final result.

Next steps