<!-- https://staircase.co/agents/roster/data-lake-assistant -->
# Data-lake assistant

# Data-lake assistant

Data

<!--source:agent-kits-->
Answers questions over the accumulated loan and partner data in plain language, and draws the chart where a chart is the answer.
<!--/source-->

- **Used when**
<!--source:agent-kits-->
— When someone needs a figure out of the warehouse and does not want to write the query.
<!--/source-->

- **Collects**
<!--source:agent-kits-->
- The question, and which body of data it should be answered from.
<!--/source-->

- **Returns**
<!--source:agent-kits-->
- The answer, the query behind it, and a chart where one was asked for.
<!--/source-->

- **Evidence**
- `prompt-graphql-data`

## Operations

<!--source:api-specifications-->

### ChatMTG
<!--/source-->

`POST` `/handle_query`

<!--source:api-specifications-->

#### Handle US Data ChatMTG querying via SQL query
<!--/source-->

`handleUSDataQueryingViaSQL`

<!--source:api-specifications-->
Endpoint function serves as an interface for users to interact with a US Data database by accepting a SQL query as an input and executing the query.

<!--/source-->

##### Request

<!--source:api-specifications-->
application/json Copy
```
{
 "sql": "select count(*) from \"sc-us-data-consumer-data\""
}
```

<!--/source-->

##### Response

<!--source:api-specifications-->
200400403
<!--/source-->

<!--source:api-specifications-->
application/json Copy Success

```
Total Number of People - 258,617,916
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Request data invalid

```
{
 "message": "Request body is invalid."
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Forbidden

```
{
 "message": "Invalid Api Key"
}
```

<!--/source-->

##### Request body`application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `sql`required | `string` | <!--source:api-specifications-->SQL statement<!--/source--> |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Request data invalid
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error message<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Forbidden
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error message<!--/source--> |

##### Other responses

`200`

## Others in Data

- Counterparty document expectations
- Dataset fulfilment
- Knowledge search
- Metric reconciliation
- Model curator
- Pipeline control panel
- Property data exploration
- Public record ingestion
- Question answering
- Report catalog
- Search to production
