Building with LLMs: Getting things done, fast.
Our mission at Fused is to help you get things done, fast. LLMs can help you write User Defined Functions, then leverage Fused to get feedback on your execution and make analytics faster
This setup helps you setup Cursor code editor in a way that helps you write & debug UDFs fast.
By the end of this guide you'll have:
- A custom Cursor setup that allows you to ask LLMs to write UDFs for you
- Cursor testing + debugging UDFs based on Fused best practices
- Gives you links to open UDFs in Workbench directly
Requirements
- A Fused Account with an engine
- A Cursor account
- Locally installed Cursor (update to latest version)
Setup
If you get blocked, check out some of the common issues in the Getting unblocked section at the end of this guide.
1. Install fused
locally.
This is to help Cursor write UDFs, save them to Workbench for you as well as test & debug them.
pip install "fused[all]" # this installs optional dependencies especially helpful for geospatial operations
You also need to be logged in to your Fused account for Cursor to be able to save UDFs to Workbench for you. You can test this with:
import fused
fused.api.whoami()
>>>
{
'name': 'user@example.com',
...
'is_active': True, # if you see this, you're logged in!
...
}
2. (Optional but recommended) Clone the udfs
public repo
At Fused we want to build things quickly so we made a common set of functions that we often re-use You can pass this to Cursor to help it write UDFs without having to re-invent the wheel.
git clone https://github.com/fusedio/udfs.git
cd udfs/
3. Start Cursor locally
Either click on it in your applications or:
cursor .
4. Give Cursor knowledge about Fused
Update Cursor to latest version
Cursor & all AI tools are evolving so quickly we recommend you update Cursor to the latest version. Some of the exact layouts might change by the time you read this.
On Mac you can update Cursor by clicking the top left application and selecting "Check for Updates"
- Go to Cursor settings -> "Indexing & Docs" -> "+ Add Docs"
- Give it
https://docs.fused.io/
Under the hood Cursor will go index the Fused docs so it has access to all the examples, Python SDK & Best Practices.
5. Giving Cursor some Rules
Cursor supports passing rules to help it write better code.
We're constantly testing & tweaking the best practices for getting LLMs to help us write good UDFs. We can pass some of our findings to Cursor directly:
- Go to Cursor settings -> "Rules" -> "+ Add Rule"
- Copy the txt from this Github Gist directly into the text field
Come back every once in a while to get more recent rules as we explore with LLM models, improve our docs & best practices.
If you find anything helpful, let us know on Discord, we're always looking to improve!