Ai Coding Tools

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

By BTW Team4 min read

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

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!

Follow Our Building Journey

Weekly podcast episodes on tools we're testing, products we're shipping, and lessons from building in public.

Subscribe

Never miss an episode

Subscribe to Built This Week for weekly insights on AI tools, product building, and startup lessons from Ryz Labs.

Subscribe
Ai Coding Tools

10 AI Coding Tools That Will Drastically Reduce Your Debugging Time

10 AI Coding Tools That Will Drastically Reduce Your Debugging Time As a developer, whether you're just starting out or have years of experience, debugging can feel like a neverend

Oct 16, 20265 min read
Ai Coding Tools

10 Common Mistakes When Integrating AI Coding Tools into Your Workflow

10 Common Mistakes When Integrating AI Coding Tools into Your Workflow As developers, we’re always on the lookout for ways to streamline our workflow and boost productivity. Enter

Oct 14, 20264 min read
Ai Coding Tools

5 Myths About AI Coding Tools That Could Hurt Your Development Process

5 Myths About AI Coding Tools That Could Hurt Your Development Process As a solo founder or indie hacker, you might be lured by the promises of AI coding tools that claim to simpli

Oct 13, 20264 min read
Ai Coding Tools

5 Common Mistakes Developers Make When Using AI Coding Tools in 2026

5 Common Mistakes Developers Make When Using AI Coding Tools in 2026 As AI coding tools have become an integral part of a developer's toolkit in 2026, many are still stumbling over

Oct 12, 20264 min read
Ai Coding Tools

5 Myths About AI Coding Tools: What Every Developer Should Know in 2026

5 Myths About AI Coding Tools: What Every Developer Should Know in 2026 As we dive into 2026, the landscape of AI coding tools has evolved significantly, yet many developers still

Oct 11, 20263 min read
Ai Coding Tools

Why AI Coding Assistants Are Overrated for Beginners in 2026

Why AI Coding Assistants Are Overrated for Beginners in 2026 As a solo founder or indie hacker, it’s tempting to think that AI coding assistants are the silver bullet to jumpstart

Oct 10, 20263 min read