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!
6. Select the right models
When starting a new chat, you can select which model you want to use. At the time of writing this (June 2025) we recommend:
claude-4-sonnet
to have the best results (though takes a bit longer to respond)
6. (Optional but recommended) Enable "Auto-Run"
You can ask Cursor to auto-run the code it suggests you:
- Go to Cursor settings -> "Chat" -> "Auto-Run"
- Enable "Auto-Run"
Auto run allows Cursor to work in the background, iterate on a UDF as it tests it and iterating by itself. But it does so by running all the code it comes up with.
We recommend you ask Cursor to make a UDF for you first without toggling this on so you can see what it's doing.
Keep in mind your LLM has access to:
- Overwrite your existing UDFs
- Deleting UDFs
- Running any UDF on your behalf
That being said, Auto-Run is still a great way to get things done fast!
Ask Cursor to write UDFs for you!
Start a new Chat and ask cursor to make a UDF for you:
Write a new UDF that returns the building density for a given bounding box.
Cursor should give you a link to the UDF in Workbench that you can click on open!
Examples of what Cursor can help you with:
- Joining different UDFs together
- Give it names of UDFs you want to combine, it should help you write a new UDF that joins them together
- Improve the performance of an existing UDF
- Ask your LLM to improve a UDF you already have by looking at the Best Practices and seeing how it can help you
- Find interesting datasets from the list of Public UDFs
Getting unblocked
Cursor can't run fused
locally properly
If you get errors when trying to run fused commands in Cursor, it's likely because Cursor is not using the right Python environment. Here are a few things to try:
-
Make sure you have the right Python environment activated. You can do this by:
- Opening the command palette (Cmd/Ctrl + Shift + P)
- Searching for "Python: Select Interpreter"
- Selecting the environment where you installed fused
-
If that doesn't work pass what you need to activate the correct environment to Fused as rule:
- Go to Cursor settings -> "Rules" -> "+ Add Rule"
- Give it instructions, for example:
Always run:
`source /Users/user/miniforge3/etc/profile.d/conda.sh` and then `conda activate fused` to use the latest fused packages
- Try restarting Cursor after activating the right environment
You might need to tinker a bit to make sure you've got the proper environment activated. If nothing else, ask Cursor to help you!
Cursor Agent hangs after running some code
This seems to be a bug if you have zsh
and powerlevel10k
.
At time of writing this isn't fully solved but forums recommend editing your .zshrc
file to remove the powerlevel10k
plugin.
I don't see some of these settings in Cursor Settings
Cursor & AI tools are evolving so quickly we recommend you update Cursor to the latest version as some of the exact layouts keep changing.
On Mac you can update Cursor by clicking the top left application and selecting "Check for Updates"
I don't see the UDF I wrote in Workbench
You might not be logged into your Fused Account. Try:
import fused
fused.api.whoami()
>>>
{
'name': 'user@example.com',
...
'is_active': True, # if you see this, you're logged in!
...
}
Cursor might also have not been able to save the UDF to Workbench. Sometimes just ask it again! It can also give you the name of the UDF it wrote, which you can then find in your Saved UDFs in Workbench.
Share your findings with us!
We're always looking to improve our best practices and make it easier to get things done with LLMs.
If you have any feedback, let us know on Discord!