Vibe Coding - Using Cursor

I wanted to develop a RAG-based chatbot where users can upload a PDF and chat about its content. My goal was to use Cursor AI code editor to generate the codebase with a single prompt. Here’s what I learned from the experience.

  1. The most important thing is how you write the prompt. I tried multiple versions, from simple to very detailed, and saw how each affected the codebase and debugging. A clear, detailed prompt made a huge difference.
  2. In the first few tries, the code needed a lot of debugging. I used Cursor to troubleshoot by copying errors and applying its fixes. Sometimes, this felt endless, and I gave up on certain issues.
  3. In later attempts, I debugged manually, which was tough since I didn’t write the code myself. It took time to understand the flow.
  4. In the final rounds, I focused on writing better prompts instead of fixing issues. This hit the mark where I had minimal problems (mostly just port conflicts or Python library conflict issues).

I now have a very basic working RAG chatbot where I can upload a PDF and query it. Although, It’s simple and basic, handling one document at a time and only PDFs, but it’s a start and can be improved. 

Learnings:

  1. A better prompt leads to better code. My final prompt was detailed, clear, and gave specific instructions.
  2. You can either generate the whole codebase at once or build it step-by-step. For example, start with code for PDF extraction, then add chunking, vectorization, and retrieval logic once each part works.
  3. To write a good prompt, it’s not just about clear language. Knowing the technology behind what you’re building helps you give better instructions.

To view or add a comment, sign in

More articles by Tamimuddin Syed

  • Parameter Optimization for RAG Implementation: RAG for RAG

    Retrieval-Augmented Generation (RAG) chatbots have been around for quite some time now and it has evolved with so much…

  • Choosing between YAML and JSON Matters When Passing Tokens to LLM?

    Passing tokens or structured data to an LLM, the format we choose can be either a YAML or a JSON file. But does it make…

  • Entropy and RAG based Chatbot

    In information theory, entropy is a measure of uncertainty, randomness, or unpredictability in a system…

  • Knowledge Graphs in RAG Chatbots: Pros & Cons

    As Retrieval-Augmented Generation (RAG) chatbots transform how we interact with AI, integrating Knowledge Graphs (KGs)…

  • RAG: Variations and Evaluation

    Retrieval-Augmented Generation (RAG) is one of the most common and widely used aspect of AI. It blends retrieval and…

  • Text-to-SQL Using LLMs:

    As organizations strive to become more data-driven, text-to-SQL Large Language Models (LLMs) are emerging as a powerful…

Explore content categories