--- title: "How do I use Candela to write or fix a query?" slug: "how-do-i-use-candela-to-write-or-fix-a-query" tags: ["LumiCode", "Candela"] updated: 2026-10-23T12:22:19Z published: 2026-10-23T12:22:19Z canonical: "support.lusid.com/how-do-i-use-candela-to-write-or-fix-a-query" --- > ## Documentation Index > Fetch the complete documentation index at: https://support.lusid.com/llms.txt > Use this file to discover all available pages before exploring further. # How do I use Candela to write or fix a query? Candela, FINBOURNE's AI agent, is built into LumiCode's prompt. Ask it how to get data out of a provider, why a query failed or how to make one faster, and run the query it suggests in one step. It knows your catalog, so its suggestions use the providers and fields you actually have. Candela availability Candela is currently available to some customers only. If it isn't available in your domain, LumiCode tells you when you use `/ai`, and everything else in LumiCode works as usual. ## Prerequisites - LumiCode installed and signed in. See [How do I install LumiCode?](/v1/docs/how-do-i-install-lumicode) ## Methods ### Method 1: Ask Candela a question 1. Type `/ai` followed by your question, and press Enter. For example: `/ai How do I list the equities I have, with their ISINs?` 2. Candela answers in the transcript. While it works, LumiCode shows which tool Candela is using. To stop waiting, press Ctrl+C. 3. Carry on the conversation at the prompt. Everything you type is sent to Candela until you go back to SQL. ![](https://cdn.document360.io/d575ad81-c0ed-4980-bbd1-d59ac5c3de82/Images/Documentation/image-CMVJVXFD.png?sv=2026-02-06&spr=https&st=2026-11-18T19%3A26%3A44Z&se=2026-11-18T20%3A26%3A44Z&sr=b&sp=r&sig=jal2radZ78VV8avrXW4rCoWxnS82a8GtMIAWXVOVSbE%3D) ### Method 2: Ask about the query you just ran Type `/ai last`, optionally followed by a question, and press Enter. For example: `/ai last Why did this fail?` or `/ai last Can this run faster?` Candela is given the query, and its error if it failed. ### Method 3: Ask about an older query 1. Type `/recent` and press Enter. 2. Select the query and press Enter. 3. Choose **discuss it with Candela**. `/results` offers the same choice for queries whose results are still available. ## Running what Candela suggests When Candela's answer contains a query, LumiCode offers it to you when the answer ends. If there's more than one, choose which. Then choose: - **run it now**: LumiCode leaves the conversation and runs the query. Press the Up arrow afterwards to edit it. - **put it in the editor history**: press the Up arrow at the prompt to edit it before you run it. Press Esc to ignore the suggestion. A suggestion that is only part of a query, such as a `where` clause, can only be put in the editor history. ## Leaving and coming back - To go back to running SQL, type `/sql`, or press Esc at an empty prompt. The conversation is kept. - To reopen a recent conversation, type `/ai resume`. - To start a new conversation, type `/ai` on its own. ## Related articles - [Candela](/v1/docs/candela-ai) - [How do I see where a value in my results came from?](/v1/docs/how-do-i-see-where-a-value-in-my-results-came-from) - [How do I diagnose a failed query?](/v1/docs/how-do-i-diagnose-a-failed-query)