> For the complete documentation index, see [llms.txt](https://planck-ai.gitbook.io/planck-ai-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://planck-ai.gitbook.io/planck-ai-docs/documentation/guides/chat-with-databases.md).

# Chat with Databases

Use database chat when a workspace is connected to a database or business system.

Planck AI lets users ask natural-language questions about structured data without needing to write SQL or understand the underlying database schema.

### Supported database and system types

Depending on your deployment, Planck AI can connect to systems such as:

* PostgreSQL
* MySQL
* Odoo
* Salesforce
* Adobe Commerce / Magento
* Collate
* CSV and Excel-based datasets
* Other customer-specific systems

Available integrations may vary by customer setup.

### How database chat works

When a database or business system is connected to a workspace, Planck AI can use that connection to answer questions.

A typical flow looks like this:

1. The user asks a natural-language question.
2. Planck AI identifies the relevant connected data source.
3. Workspace context helps map the business question to the right tables, fields, filters, and calculations.
4. Planck AI retrieves or computes the relevant result.
5. The answer is returned as text, table, chart, or another structured output.

### Example questions

#### Finance

```
Show monthly revenue for the last two quarters.
```

```
Which customers have overdue invoices above 10,000 euros?
```

```
Calculate supplier spend by category for this month.
```

```
Show accounts receivable by customer and aging bucket.
```

#### Sales and CRM

```
Show open opportunities by stage.
```

```
Which accounts have not been contacted in the last 30 days?
```

```
Summarize pipeline value by region.
```

```
Which customers have renewals coming up this quarter?
```

#### Commerce and catalog

```
Which products are enabled but out of stock?
```

```
Show products with missing descriptions or metadata.
```

```
Summarize products with special pricing ending this week.
```

```
Group product inventory by category.
```

#### Operations

```
Which projects are delayed?
```

```
Show open tasks by contractor.
```

```
Summarize blocked rollout milestones by region.
```

```
Compare planned versus actual completion dates.
```

### Asking follow-up questions

Database chat works well with follow-up questions.

Example:

```
Show monthly revenue for the last two quarters.
```

Follow-up:

```
Break this down by customer segment.
```

Follow-up:

```
Show it as a bar chart.
```

Follow-up:

```
Which records support this answer?
```

### Understanding outputs

Depending on the question and connected data, Planck AI may return:

* Plain-language explanation
* Table
* Chart
* KPI summary
* Map
* SQL or code snippet
* Source context
* Follow-up suggestions

For business-critical decisions, review the source context and supporting data before taking action.

### Workspace context

Workspace context helps Planck AI understand the business meaning of your data.

For example, a raw database may contain fields such as:

```
customer_id
```

```
invoice_due_date
```

```
amount_outstanding
```

```
sku
```

Workspace context helps Planck AI understand how these fields relate to business concepts such as customers, overdue invoices, revenue, product inventory, or supplier spend.

### Deterministic calculations

Some database questions require calculations.

Examples:

```
Calculate average invoice value by customer.
```

```
Show percentage change in revenue month over month.
```

```
Flag categories where supplier spend increased by more than 20%.
```

```
Compare planned versus actual rollout completion.
```

Planck AI can use a deterministic compute layer for structured calculations, transformations, and validations before presenting the final answer.

### Permissions

Users can only query data sources they are allowed to access.

Workspace permissions and data-source permissions determine what a user can see and do.

Some deployments may also restrict:

* Which databases a user can query
* Which tables or views are available
* Whether users can see generated SQL
* Whether users can export results
* Whether users can run automations from database results

### Best practices

Ask specific questions.

Good examples:

```
Show overdue invoices above 10,000 euros by customer and due date.
```

```
Summarize supplier spend for this month and group it by category.
```

```
Show products that are enabled, online, and out of stock.
```

```
Compare planned rollout dates with actual completion dates by region.
```

Less useful examples:

```
Analyze the database.
```

```
What is going on?
```

```
Tell me everything.
```

### Troubleshooting

#### No database appears in the workspace

The database integration may not be configured, or you may not have access to it.

#### The answer is too broad

Ask a narrower question with a specific time period, entity, metric, or grouping.

#### The answer seems incorrect

Check whether the underlying data is current and whether the workspace context has the right business definitions.

#### The system cannot answer the question

The required table, field, or integration may not be available in the workspace.

#### You cannot export or view generated SQL

Your workspace permissions may not allow this action.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://planck-ai.gitbook.io/planck-ai-docs/documentation/guides/chat-with-databases.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.
