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

# Work with AI Prompts

export const TimeKey = "TimeKey®";

export const Ocient = "Ocient®";

Use this guide to draft high-quality prompts to assist AI tools in using the {Ocient} documentation and SQL dialect with greater accuracy.

The guide explains why drafting AI prompts for the Ocient documentation helps produce better results. These reasons include:

* Large models often default to generic SQL or other vendor syntax.
* Additional guidance helps scrapers navigate documentation libraries.
* The `llms.txt` index page provides the cleanest and AI-friendly entry point to the documentation.

## Key AI Prompt Recommendations

Follow these key recommendations for working with the Ocient documentation:

<Steps>
  <Step>
    **Include Ocient Documentation URLs**

    Start prompts with one or more links to anchor the model on authoritative content. In prompts, specify the AI index page [/llms.txt](https://docs.ocient.com/llms.txt) to provide full documentation reference for models.

    If relevant, include the exact topic URL (e.g., SQL reference, machine learning, data pipelines).
  </Step>

  <Step>
    **Explicitly Require Ocient SQL**

    In your prompt, specifically dictate to the AI model to use Ocient SQL, such as `Use Ocient SQL syntax` or `Do not use non‑Ocient SQL variants`. Such text is particularly helpful to avoid generic responses for prompts that involve complex data types or Ocient-specific syntax for {TimeKey}, secondary indexes, or DDL statements.
  </Step>
</Steps>

## AI Prompt Templates

Use these templates and fill in your question and context-setting information in the `< ... >` sections, while keeping the rest of the text intact.

**General Questions**

This template is suitable for general questions for Ocient System usage. Use this context-setting text prior to asking your question.

```text Text theme={null}
You are answering using the official Ocient documentation.
Start from https://docs.ocient.com/llms.txt and reference the linked pages there.
Use only Ocient SQL syntax in examples and explanations.
Do not include SQL features or syntax from other databases.

Question: <your question here>
```

**Create an Ocient SQL Query**

This AI prompt helps ensure an AI tool adheres to Ocient SQL in the response. The performance of the generated SQL query depends on the specifics of your data. Edit the resulting SQL query to meet your needs.

```text Text theme={null}
You are answering using the official Ocient documentation.
Start at https://docs.ocient.com/llms.txt and reference the linked pages there.
Use Ocient SQL syntax only; do not use Postgres/MySQL/Spark SQL or other variants.
If uncertain about any detail, cite the exact Ocient page used.

Task:
Draft an Ocient SQL query to achieve
<Describe the goal clearly, including relevant tables or columns and any filters or joins.>

Context (optional but helpful):
- Schema snippets, table snippets, or column types
- Performance or indexing considerations
- Any assumptions or edge cases

Output format:
1) A single Ocient SQL query
2) A brief explanation (2–3 sentences)
3) Citations to the specific Ocient documentation pages used

Reference pages (if applicable to the task):
<Point to any relevant reference pages.>
```

## AI Prompts for Specific Use Cases

For more accurate responses, use your prompt to point to the relevant page URL in the documentation. Each page in this table provides high-level usage information for the specified topic.

| **Topic**           | **URL**                                                                                                |
| ------------------- | ------------------------------------------------------------------------------------------------------ |
| Loading             | [/load-data](/load-data)                                                                               |
| Installation        | [/install-an-ocient-system](/install-an-ocient-system)                                                 |
| Machine Learning    | [/machine-learning-model-functions](/machine-learning-model-functions)                                 |
| Geospatial          | [/geospatial-functions](/geospatial-functions)                                                         |
| Data Types          | [/data-types](/data-types)                                                                             |
| DDL Statements      | [/data-definition-language-ddl-statement-reference](/data-definition-language-ddl-statement-reference) |
| Errors and Warnings | [/errors-and-warnings](/errors-and-warnings)                                                           |

## Troubleshooting Low‑Quality Responses

If the responses from your AI prompts are inaccurate, try modifying them with these suggestions:

* For generic responses, add the `Use Ocient SQL only` text and also the SQL reminders in [Key AI Prompt Recommendations](#key-ai-prompt-recommendations).
* For functions that appear incorrect, ask the AI tool to navigate to `/llms.txt` and cite the specific page it referenced.
* For incorrect structure, provide a minimal schema snippet and restate data types (such as complex types of arrays, tuples, or matrices).
* If navigation or footer text appears, restate `Start from llms.txt, ignore navigation and footer content`.
* If the AI tool continues to have issues accessing the documentation, download the PDF of the Ocient documentation and upload it into the AI prompt.

## Related Links

[ Prompt Engineering](https://platform.openai.com/docs/guides/prompt-engineering/six-strategies-for-getting-better-results)

[Key Concepts](/key-concepts)

[Query Ocient](/query-ocient)
