Ai Coding Tools

How to Build an AI-Powered Personal Assistant in Under 2 Hours

By BTW Team3 min read

How to Build an AI-Powered Personal Assistant in Under 2 Hours

In 2026, AI is everywhere, but building your own AI-powered personal assistant might seem daunting. The good news? You can actually whip one up in under 2 hours - even if you're not a coding wizard. I know because I've done it, and I want to share exactly how you can achieve the same.

Prerequisites: What You Need to Get Started

Before diving in, let’s make sure you have everything you need:

  1. Basic coding knowledge: Familiarity with JavaScript or Python will make things smoother.
  2. API access: You'll need an account with OpenAI or a similar service to access AI models.
  3. Development environment: Set up Node.js for JavaScript or Python on your machine.
  4. A text editor: VS Code or any code editor of your choice will do.

Step-by-Step Guide to Building Your Assistant

Step 1: Set Up Your Environment

  • Time: 10 minutes
  • Expected Output: A working development environment.
  1. Download and install Node.js or Python.
  2. Install the necessary libraries:
    • For Node.js:
      npm install axios dotenv
      
    • For Python:
      pip install requests python-dotenv
      

Step 2: Get API Keys

  • Time: 10 minutes
  • Expected Output: Your API keys stored securely.
  1. Sign up for OpenAI and generate an API key.
  2. Create a .env file in your project directory and store your key like this:
    OPENAI_API_KEY=your_api_key_here
    

Step 3: Write the Code

  • Time: 60 minutes
  • Expected Output: A simple AI personal assistant that can answer questions.

Here’s a basic template in JavaScript:

require('dotenv').config();
const axios = require('axios');

const getResponse = async (query) => {
  const response = await axios.post('https://api.openai.com/v1/completions', {
    model: "text-davinci-003",
    prompt: query,
    max_tokens: 150,
  }, {
    headers: {
      'Authorization': `Bearer ${process.env.OPENAI_API_KEY}`,
    }
  });

  return response.data.choices[0].text.trim();
};

const runAssistant = async () => {
  const userInput = "What’s the weather like today?";
  const response = await getResponse(userInput);
  console.log(`Assistant: ${response}`);
};

runAssistant();

Step 4: Test Your Assistant

  • Time: 20 minutes
  • Expected Output: Your assistant responds to queries.

Run your code and test a few different queries. Modify the prompt in the userInput variable to see how your assistant responds to various questions.

Step 5: Troubleshooting Common Issues

  • Problem: The assistant doesn’t respond.

    • Solution: Check your API key and ensure your environment variables are set up correctly.
  • Problem: Responses are not relevant.

    • Solution: Adjust the prompt to be more specific or try increasing the max_tokens.

Pricing Breakdown for Tools Used

| Tool | Pricing | Best For | Limitations | Our Take | |--------------------|-------------------------|------------------------------|-----------------------------------|------------------------------------| | OpenAI | Free tier + $20/mo pro | AI text generation | Limited queries per minute | We use this for generating responses. | | Node.js | Free | JavaScript runtime | Requires JavaScript knowledge | Essential for our backend work. | | Python | Free | Versatile scripting | Slower than Node.js for some tasks | We don't use this for real-time apps. |

What's Next?

Now that you have a basic AI personal assistant, consider enhancing its features. You could integrate it with a calendar API to manage your schedule or a weather API for real-time updates.

If you're looking to scale this further, think about:

  • Adding a front-end interface using React or Vue.js.
  • Deploying your assistant on a cloud platform like AWS or Heroku.

Conclusion: Start Here

Building an AI-powered personal assistant in under 2 hours is totally achievable with the right tools and approach. Start with the basic setup and expand from there. Don’t forget to iterate based on your needs and how you plan to use your assistant.

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