|
1 | 1 | ---
|
2 | 2 | sidebar_position: 0
|
3 | 3 | sidebar_label: Quickstart
|
4 |
| -description: |
5 |
| - "Learn how to set up and deploy PromptQL. This guide covers installing prerequisites, configuring API keys, running |
6 |
| - PromptQL locally, and deploying to Hasura DDN." |
| 4 | +description: "Learn how to get started with PromptQL by asking complex questions and building automations." |
7 | 5 | keywords:
|
8 | 6 | - promptql
|
9 |
| - - hasura ddn |
10 | 7 | - quickstart
|
11 | 8 | - getting started
|
12 | 9 | - guide
|
13 |
| - - quickstart |
14 | 10 | sidebar_class_name: quickstart-icon
|
| 11 | +toc_max_heading_level: 4 |
15 | 12 | ---
|
16 | 13 |
|
17 |
| -import Prereqs from "@site/docs/_prereqs.mdx"; |
18 |
| -import Quickstart from "@site/docs/_quickstart_template.mdx"; |
| 14 | +import Thumbnail from "@site/src/components/Thumbnail"; |
19 | 15 |
|
20 | 16 | # Quickstart with PromptQL
|
21 | 17 |
|
22 |
| -In this getting started guide, you'll deploy PromptQL and connect it to a sample dataset β a hosted PostgreSQL database |
23 |
| -pre-loaded with IMDb movie data. You'll start by exploring the dataset through natural language queries, discovering how |
24 |
| -PromptQL can reliably answer questions and assist in decision-making. Then, you'll add custom business logic that lets |
25 |
| -PromptQL act on your behalf β like renting a movie for a user β showing how it can go beyond answering questions to |
26 |
| -automating tasks. |
| 18 | +## Introduction |
| 19 | + |
| 20 | +This guide is designed to give you a high-level overview of PromptQL and how you can use it to make better decisions |
| 21 | +about your business and automate tasks; all without any coding knowledge required. |
| 22 | + |
| 23 | +:::info Prerequisites |
| 24 | + |
| 25 | +Before continuing, you'll need a [Hasura Cloud account](https://cloud.hasura.io/signup/new_user). |
| 26 | + |
| 27 | +If you have your own project, you can apply the information below to it. Otherwise, we have a |
| 28 | +[collection of sandboxes](/index.mdx#demos) which allow you to try PromptQL and get a feel for the experience. Below, |
| 29 | +we'll use the `sandbox-gtm` example. |
| 30 | + |
| 31 | +If you're looking to build a new project from scratch, check out |
| 32 | +[these guides](/how-to-build-with-promptql/overview.mdx). |
| 33 | + |
| 34 | +::: |
| 35 | + |
| 36 | +## Guide |
| 37 | + |
| 38 | +### Open your project |
| 39 | + |
| 40 | +Each PromptQL project can be accessed via a unique URL. You can access all your projects |
| 41 | +[from the PromptQL Console](https://promptql.console.hasura.io/). |
| 42 | + |
| 43 | +<Thumbnail |
| 44 | + src="/img/get-started/pql-console-all-projects.png" |
| 45 | + alt="The PromptQL Cloud Console with all projects." |
| 46 | + width="1000px" |
| 47 | +/> |
| 48 | + |
| 49 | +When you navigate to a project, you're dropped into its **playground**; this is the chat interface that allows you to |
| 50 | +ask questions about your data and create automations. |
| 51 | + |
| 52 | +<Thumbnail src="/img/get-started/pql-playground.png" alt="The PromptQL Playground." width="1000px" /> |
| 53 | + |
| 54 | +### Talk to your data |
| 55 | + |
| 56 | +Primarily, you'll interact with PromptQL in one of two ways: either by asking questions, or creating automations. |
| 57 | + |
| 58 | +#### Ask a complex question |
| 59 | + |
| 60 | +Using the `sandbox-gtm` project, we're going to ask the following question: |
| 61 | + |
| 62 | +> _Which enterprise deals are at risk of slipping this quarter based on engagement patterns?_ |
| 63 | +
|
| 64 | +While this question seems simple, it's complex because it requires defining what qualifies as an enterprise deal, |
| 65 | +identifying signals that indicate a deal is at riskβsuch as low engagement or delayed progressβand analyzing various |
| 66 | +engagement patterns, including sales activities, buyer signals, and product usage, all in comparison to historical and |
| 67 | +successful deal benchmarks. |
| 68 | + |
| 69 | +If you're using your own project, start by asking a similarly strategic question relevant to your data. Otherwise, |
| 70 | +[click here](https://promptql.console.hasura.io/share/05437507-6b31-4037-a302-0dbcec5de2ae) to be dropped into a thread |
| 71 | +replay. |
| 72 | + |
| 73 | +##### Query plan |
| 74 | + |
| 75 | +When you ask a question, PromptQL will respond with a **query plan**. This is a step-by-step breakdown in plain language |
| 76 | +of how it will process your request, including any data retrieval, filtering, or AI operations it will perform. |
| 77 | + |
| 78 | +<Thumbnail |
| 79 | + src="/img/get-started/pql-query-plan.png" |
| 80 | + alt="A query plan for a question detailing all steps to find the right data." |
| 81 | + width="1000px" |
| 82 | +/> |
| 83 | + |
| 84 | +It helps make PromptQL's approach transparent by explaining what it's going to do before it does it, including any |
| 85 | +assumptions it's making about the data or process. |
| 86 | + |
| 87 | +Take a look at the query plan generated for your question and see how PromptQL takes a complex question and breaks it |
| 88 | +down into a series of steps, just like a human would. |
| 89 | + |
| 90 | +:::tip Query plans are modifiable |
| 91 | + |
| 92 | +You can edit a query plan by clicking the pencil next to a query plan. |
| 93 | + |
| 94 | +You have domain-specific expertise which you can share with PromptQL. When you modify a query plan, PromptQL remembers |
| 95 | +and self-corrects for future threads! |
| 96 | + |
| 97 | +::: |
| 98 | + |
| 99 | +##### Execution |
| 100 | + |
| 101 | +The query plan is then **executed** against your data. |
| 102 | + |
| 103 | +<Thumbnail src="/img/get-started/pql-execution.png" alt="A query plan's execution of Python and SQL." width="1000px" /> |
| 104 | + |
| 105 | +PromptQL pulls the necessary data and uses AI to help make sense of it. Behind the scenes, it fetches information from |
| 106 | +your database and organizes it using Python, so you can focus on the insights, not the code. |
| 107 | + |
| 108 | +If you're curious, expand the execution in your project and see the code PromptQL is executing against your datasource. |
| 109 | +And, just like the query plan, if you see something that should be different, let PromptQL know! |
| 110 | + |
| 111 | +##### Artifacts |
| 112 | + |
| 113 | +Typically, the execution of a query plan will result in an **artifact**. |
| 114 | + |
| 115 | +<Thumbnail |
| 116 | + src="/img/get-started/pql-artifact.png" |
| 117 | + alt="A table artifact produced via the execution of a query plan." |
| 118 | + width="1000px" |
| 119 | +/> |
| 120 | + |
| 121 | +Artifacts are structured outputs like tables, text, or visualizations that store the processed data or analysis results, |
| 122 | +which can be referenced later in the conversation, exported, or used to start new threads for further analysis. |
| 123 | + |
| 124 | +We have a more in-depth guide for making decisions with PromptQL; check it out [here](/decision-making.mdx). |
| 125 | + |
| 126 | +:::tip This is a conversation! |
| 127 | + |
| 128 | +Talking with PromptQL is like talking to a human. This means it's an iterative process wherein you ask a question, it |
| 129 | +responds, and you build on that response by refining, clarifying, or asking follow-up questions. The more context you |
| 130 | +provide, the better the answers become. |
| 131 | + |
| 132 | +::: |
| 133 | + |
| 134 | +#### Give it a task to automate |
| 135 | + |
| 136 | +Using the same sandbox project, we'll ask PromptQL to generate an automation for us: |
| 137 | + |
| 138 | +> I need an automation to help me identify risky opportunities in my sales pipeline. I want to input a date range and |
| 139 | +> get back a list of opportunities that need attention. Specifically, I want to know which deals: |
| 140 | +> |
| 141 | +> - Haven't had any recent activity |
| 142 | +> - Are missing important contact relationships |
| 143 | +> - Show low engagement from the customer |
| 144 | +> - Are taking longer than expected to close |
| 145 | +> |
| 146 | +> Can you create something that gives me a risk score for each opportunity and suggests specific actions I should take? |
| 147 | +> I'd like the results in a format that makes it easy for me to prioritize which deals need immediate attention. |
| 148 | +
|
| 149 | +This task-based prompt asks PromptQL to build an **automation**: a reusable workflow that runs against your data and |
| 150 | +gives you consistent, structured results. Rather than just answering a one-time question, automations are designed to |
| 151 | +help you monitor, score, or act on key insights regularly. |
| 152 | + |
| 153 | +<Thumbnail |
| 154 | + src="/img/get-started/playground-quickstart-automation.png" |
| 155 | + alt="A PromptQL-generated automation." |
| 156 | + width="1000px" |
| 157 | +/> |
| 158 | + |
| 159 | +In this example, PromptQL will identify the relevant data, define what makes a deal βrisky,β build a scoring system to |
| 160 | +prioritize those deals, and suggest actionsβall packaged in a format thatβs easy to review and reuse. Just like with |
| 161 | +query plans, PromptQL explains each step and lets you modify the logic, so you stay in control of the process. |
| 162 | + |
| 163 | +If you're using your own project, give PromptQL a similar task to automate. Otherwise, |
| 164 | +[click here](https://promptql.console.hasura.io/share/88a988ff-b44b-42b8-9859-846fa4be3f9c) to be dropped into a thread |
| 165 | +replay. |
27 | 166 |
|
28 |
| -<Prereqs /> |
| 167 | +We also have a dedicated guide to building your own automations available [here](/automation.mdx). |
29 | 168 |
|
30 |
| -## Build your first PromptQL app |
| 169 | +## Next steps |
31 | 170 |
|
32 |
| -<Quickstart /> |
| 171 | +Now that you've had your first set of conversations with PromptQL, we recommend checking out these docs around its |
| 172 | +[core capabilities](/capabilities.mdx). |
0 commit comments