Ai Coding Tools

How to Build a Personal AI Assistant in 2 Hours with Cursor

By BTW Team4 min read

Comparing tools? See the AI tools tested on the show.

In short

A step-by-step guide that shows you how to create a functional personal AI assistant using Cursor in just two hours, suited for beginners and intermediates.

If you're like me, the idea of having a personal AI assistant sounds pretty appealing. But the thought of coding one from scratch? That can feel overwhelming. Luckily, with tools like Cursor, you can build your own AI assistant in just 2 hours. This isn’t some pie-in-the-sky promise; I’ve done it myself, and I’m here to share exactly how you can do it too.

Prerequisites: What You Need to Get Started

Before we dive in, here’s what you’ll need:

  • Cursor: A code editor that uses AI to assist you in writing code. It’s free to start with some features, and paid plans begin at $20/month.
  • Basic Understanding of JavaScript: If you can write simple functions and understand variables, you’re good to go.
  • An OpenAI API Key: This is necessary to access the GPT models that will power your assistant. OpenAI's API pricing starts at $0.0004 per token, which is quite affordable for small projects.

Step-by-Step Guide to Building Your AI Assistant

Step 1: Set Up Cursor

  1. Download and Install Cursor: Go to the Cursor website and download the app. It should take just a few minutes.
  2. Create a New Project: Open Cursor, and start a new project. Name it something like "My Personal AI Assistant."

Step 2: Create the Assistant Logic

  1. Define Your Assistant’s Purpose: Decide what you want your AI assistant to do. Examples could be answering questions, setting reminders, or fetching data from APIs.

  2. Write the Main Function: Here’s a simple function to get you started:

    async function getResponse(input) {
        const response = await fetch('https://api.openai.com/v1/engines/davinci-codex/completions', {
            method: 'POST',
            headers: {
                'Authorization': `Bearer YOUR_API_KEY`,
                'Content-Type': 'application/json'
            },
            body: JSON.stringify({
                prompt: input,
                max_tokens: 50
            })
        });
        return await response.json();
    }
    
  3. Test Your Function: In Cursor, run the function with a test input like "What’s the weather today?"

Step 3: Build a User Interface (Optional)

If you want to make your assistant more user-friendly, you can set up a simple HTML interface.

  1. Create an HTML File: Add an input box and a button to send messages to your assistant.
  2. Link Your JavaScript: Ensure your JavaScript file is linked to your HTML so that everything works together.

Step 4: Testing and Debugging

Run your assistant through various scenarios to see how it handles different inputs. If you encounter issues, check the console in Cursor for error messages.

Step 5: Deploy Your Assistant

Once you're satisfied with your assistant, you can deploy it using services like Vercel or Netlify, both of which have free tiers suitable for indie projects.

Troubleshooting Common Issues

  • API Key Errors: Ensure your OpenAI API key is correctly set up and has the right permissions.
  • Fetch Errors: Check your internet connection and ensure the API endpoint is correct.
  • Unexpected Responses: Refine your prompts to get better outputs from the AI.

Pricing Breakdown for Tools Used

| Tool | Pricing | Best For | Limitations | Our Take | |---------------|----------------------------|----------------------------|-------------------------------------|-----------------------------------| | Cursor | Free + $20/mo for pro | AI coding assistance | Limited features on the free plan | We use this for quick coding tasks | | OpenAI API | Starts at $0.0004 per token| Access to GPT models | Costs can add up with heavy use | Essential for AI functionality | | Vercel | Free tier available | Deploying web apps | Limited bandwidth on free tier | Great for indie projects |

What We Actually Use

For building our personal AI assistants, we primarily use Cursor for coding and OpenAI's API for the backend processing. If you want a more robust setup, consider adding Vercel for deployment.

Conclusion: Start Here

Building a personal AI assistant can be straightforward if you use the right tools. Start with Cursor and follow the steps I laid out. You can have a functional assistant up and running in just 2 hours. Don't let the complexities of coding scare you. With the right resources, you can do it!

Watch real AI builds every week

Built This Week is a weekly podcast where Jordan Metzner and Sam Nadler build something real with AI every episode, test new AI tools and talk with founders who build with AI.

See the tools

Watch real AI builds every week

Built This Week is a weekly podcast where Jordan Metzner and Sam Nadler build something real with AI every episode, test new AI tools and talk with founders who build with AI.

See the tools
Ai Coding Tools

3 AI Coding Tools That Are Overrated (and Why You Should Avoid Them)

3 AI Coding Tools That Are Overrated (and Why You Should Avoid Them) In the everevolving landscape of AI coding tools, it's easy to get swept up in the hype. As indie hackers and s

Nov 30, 20263 min read
Ai Coding Tools

5 Ways AI Coding Tools Can Accelerate Your MVP Development in 2026

5 Ways AI Coding Tools Can Accelerate Your MVP Development in 2026 In 2026, the landscape for indie hackers and solo founders has evolved significantly, especially with the advent

Nov 26, 20264 min read
Ai Coding Tools

5 AI Coding Tools That Make Legacy Code Feel Brand New in 2026

5 AI Coding Tools That Make Legacy Code Feel Brand New in 2026 If you’re a developer stuck maintaining legacy code, you know the frustration. It’s like navigating a maze blindfolde

Nov 23, 20264 min read
Ai Coding Tools

10 AI Coding Tools That Will Save You Hours of Debugging in 2026

10 AI Coding Tools That Will Save You Hours of Debugging in 2026 Debugging can feel like a neverending cycle of frustration. Whether you're a solo founder or an indie hacker, spend

Nov 18, 20265 min read
Ai Coding Tools

10 Common Mistakes When Using AI Coding Tools for MVP Development

10 Common Mistakes When Using AI Coding Tools for MVP Development As a founder in 2026, you’re likely aware that AI coding tools can significantly speed up the MVP development proc

Nov 16, 20264 min read
Ai Coding Tools

5 AI Coding Myths Every Beginner Developer Should Ditch in 2026

5 AI Coding Myths Every Beginner Developer Should Ditch in 2026 As a beginner developer, you’ve probably come across a ton of buzz surrounding AI coding tools. But with all the hyp

Nov 12, 20263 min read