
Eat Your Own Dog Food

Daniel Lopes

TL;DR: Start with prompt engineering for immediate results and flexibility. Add RAG when your AI needs access to current, changing information or must cite sources. Use fine-tuning when you need consistent, specialized behavior that goes beyond what prompts can achieve (typically requires 10K+ examples). Successful systems often combine all three approaches.
You're building your next application and it will rely heavily on AI features. You've heard of "RAG integration", "fine-tuned models" and "prompt engineering", but what exactly are these things, and which one do you actually need?
You don't have to pick one. But you do need to understand what each approach actually does, when it makes sense, and how to get the best results.
RAG sounds simple - just add a search function to your AI, right? Wrong. What actually happens under the hood will change how you think about AI architecture entirely.
When someone asks your AI a question, RAG first searches through your knowledge base (stored as vectors in a database), finds the most relevant chunks of information, and then feeds both the original question and that retrieved context to your language model. The result? More accurate, up-to-date responses that can cite specific sources.
The architecture isn't complicated. You need three main components: a way to convert your documents into searchable vectors (embeddings), a vector database to store and search those embeddings, and the coordination logic that ties everything together. Vector databases like Pinecone deliver p99 latencies of 47ms at billion-vector scale.
What's worth noting: graph-based systems have been showing promising results for retrieval efficiency. These systems use specialized tree-based optimizations that may offer advantages for certain RAG architectures. At GrowthX we use Neo4j with with an implementation of Light Rag and the results are early but already very good.
Here's what everyone gets wrong about fine-tuning. They think you're teaching the AI new facts. You're not. You're rewiring how it thinks.
Fine-tuning starts with a pre-trained model that already knows language patterns, then trains it further on your specific data to adjust its behavior and knowledge. Think of it as specialization rather than education from zero.
There are different flavors of fine-tuning, and this matters for both your results and budget. QLoRA has proven effective for most production scenarios, achieving 90-95% of full fine-tuning accuracy while reducing memory requirements by up to 16x. For a 65B parameter model, that's the difference between needing 780GB of memory versus just 48GB.
When does the complexity and cost make sense? When you have substantial data (typically >10K examples) and need consistent behavior that goes beyond what prompt engineering can achieve. Benchmarks show fine-tuning achieving 47.2% accuracy on mathematical reasoning versus 39.4% with zero-shot prompting.
Prompt engineering is the art of asking AI the right question in the right way. But it's evolved far beyond "please be helpful." We're talking about structured approaches that can rival fine-tuning performance on many tasks.
The breakthrough in 2025? Prompts that walk through problems step-by-step hitting 97.9% accuracy on mathematical reasoning tasks. That's not a typo. Stanford AI Index 2025 research confirms that models like OpenAI's o3, when using systematic reasoning prompts, achieve graduate-level performance across physics, chemistry, and biology.
Modern prompt engineering includes techniques like few-shot learning with carefully selected examples, chain-of-thought reasoning for complex problems, and specialized formatting that guides model behavior. Anthropic's Prompt Improver shows 30% accuracy increases through systematic optimization of prompts.
But there's a ceiling. You can optimize your prompts extensively, but you can't fundamentally change what the model knows or how it behaves at a deep level.
So when does RAG actually make sense? When your AI needs to know things that change faster than you can retrain it.
Customer support chatbots that need to reference current product documentation, pricing, and policies. Legal research applications that must search through constantly updated regulations. Internal knowledge management where you want employees to query company documentation, procedures, and institutional knowledge.
The EPA's RAG implementation showcases this perfectly — they achieved 85% reduction in chemical assessment processing time (from months to hours) while maintaining 85% accuracy by giving their AI access to vast regulatory databases.
RAG also makes sense when you need transparency. Since the system retrieves specific sources, users can see exactly where information came from.
But couldn't we just use prompts for everything? Sure, right after you explain to your users why the chatbot thinks it's still 2023.
Fine-tuning is your move when you need consistent, specialized behavior that goes beyond knowledge retrieval. Think about scenarios where the way the AI responds is as important as what it knows.
Domain-specific applications like medical diagnosis support, legal document drafting, or technical code generation benefit from fine-tuning. The model learns not just facts, but the reasoning patterns, terminology, and style preferences specific to that field.
High-volume deployments also favor fine-tuning. Once you've invested in training, each inference is faster and more cost-effective since the specialized knowledge is embedded directly in the model's weights, eliminating external retrieval operations. ICML 2024 analysis shows fine-tuned models at $0.0042 per example versus $0.012 for prompting approaches.
The catch: fine-tuning requires substantial upfront investment. You need quality training data, GPU resources, and time. Plus, there's a safety consideration — NeurIPS 2024 research shows fine-tuned models can have 5×-20× higher attack success rates for harmful content generation.
Fine-tuning isn't just about data. It's about deciding whether you want an AI that thinks like your domain experts or one that can Google really fast.
Start with prompt engineering. Seriously. I cannot stress this enough.
Prompt engineering excels for general-purpose applications where you need flexibility rather than deep specialization. Content generation, summarization, and analysis tasks often work beautifully with well-crafted prompts.
Rapid prototyping and iteration heavily favor prompting. You can test ideas, adjust behavior, and refine outputs without any model training. The feedback loop is immediate.
The sweet spot? Applications where you need good performance across diverse tasks rather than excellence in one specific domain. Many successful AI products start with sophisticated prompt engineering and only move to fine-tuning or RAG when specific limitations become apparent.
Start with prompting. Start with prompting. I really mean it.
As a full-stack developer, you already understand APIs, databases, and system integration. That's actually most of what you need for RAG. The concepts map directly to familiar patterns — APIs for language models, vector databases that work like specialized search engines, and orchestration logic that's similar to microservice coordination.
Prompt engineering using existing APIs. Spend time with the OpenAI Cookbook or Anthropic's documentation. Build something small that shows value to your team.
RAG with existing tools. Services like Pinecone, Weaviate, Turbopuffer, or even Azure AI Search handle the complexity of vector operations for you. You're essentially building a smart search interface that feeds results to a language model.
Fine-tuning comes last. It requires the most specialized knowledge and infrastructure, but the principles connect to concepts you already know from machine learning frameworks.
For RAG, Pinecone is a mature option with great reliability and performance. Weaviate gives you more knobs to twist and buttons to push while keeping costs reasonable. Chroma hits the sweet spot for quick builds and smaller projects where you want to get something running without the operational overhead.
For orchestration, LangChain remains popular but can be complex for simple use cases. LlamaIndex focuses specifically on data integration patterns. Many teams build custom orchestration using standard web frameworks — which might be the right approach if you're already comfortable with backend development.
Quality and cost planning both matter. With RAG systems, you're looking at $200-$2000/month depending on usage, but focus your optimization efforts on chunking strategy (how you split documents), retrieval accuracy (finding the right context), and embedding quality (how well your vectors represent meaning). These factors impact your results more than cost optimization.
When implementing fine-tuning you have multiple different approaches with different tradeoffs.
Full Fine-Tuning involves updating all model parameters during training. While this offers maximum adaptability, it requires substantial computational resources - typically 40-67GB VRAM for 7B parameter models and 64-80GB for 13B models. This approach works best when complete model behavior modification is needed and resources aren't constrained.
Parameter-Efficient Fine-Tuning (PEFT) is widely used for most production implementations:
The optimal approach depends on your specific constraints. For many production scenarios, QLoRA offers a strong balance between performance and resource efficiency, allowing teams to fine-tune large models with modest hardware requirements while maintaining most performance benefits of full fine-tuning.
When it comes to fine-tuning, you have two fundamentally different paths: using closed API services (OpenAI, Anthropic via Bedrock) or fine-tuning open source models (Llama, Mistral, etc.). Each has distinct trade-offs.
Closed API Models offer significantly simplified implementation. With OpenAI's fine-tuning, you upload JSONL-formatted data and manage jobs through simple API calls. Anthropic's Claude fine-tuning follows a similar API-based approach through Amazon Bedrock.
Open Source Models require comprehensive setup: environment configuration, dataset preprocessing, training loops, and evaluation pipelines. You're working directly with frameworks like Hugging Face Transformers, managing every aspect of the training process.
Closed APIs impose specific constraints. OpenAI requires JSONL format with conversational structure. AWS documentation shows Claude fine-tuning has a 10,000 record training limit and 1,000 record validation limit. But you get guardrails and tested infrastructure.
Open Source offers unlimited flexibility. Any data format, any preprocessing pipeline, complete control over hyperparameters and training algorithms. The tradeoff is you're responsible for everything.
Closed APIs implement ongoing fees for both training and inference. Check pricing carefully—these add up at scale but eliminate infrastructure costs.
Open Source requires upfront infrastructure investment (GPUs, storage, compute) but eliminates ongoing API fees. It's "pay once, own forever" economics, which favors high-volume production deployments.
Go with closed APIs when:
Choose open source when:
You absolutely don't need to pick one. The most successful setups combine approaches strategically. It's common to have even a three-layer architecture where fine-tuned models provide domain expertise, RAG systems add current information, and prompt engineering with context optimization optimizes the user interface.
The quality threshold sits around 1K-10K high-quality examples for most domains. Below that, advanced prompt engineering with few-shot examples performs comparably. Above 100K examples, fine-tuning shows clear advantages. Quality matters more than quantity — well-curated datasets of 1K examples can outperform larger but noisier datasets.
Focus on:
Start simple. Measure performance. Scale based on real user needs rather than theoretical capabilities.
Prompt engineering gets you moving fast. RAG adds knowledge and context. Fine-tuning provides specialization and consistency. Most successful applications use all three, applied thoughtfully to different parts of the problem. You'll probably end up using all three. Build something that works first, then optimize based on what your users actually need and what your infrastructure can reasonably support.
Starting too complex. Teams can jump straight to sophisticated hybrid architectures when they could achieve 80% of the value with thoughtful prompt engineering. The building sequence matters: prove value with prompts, add RAG for knowledge access, then consider fine-tuning for specialized behavior.
Anywhere between 1K-10K high-quality examples represents the quality threshold for most domains. Below that threshold, advanced prompt engineering with carefully selected few-shot examples performs comparably to fine-tuning with less complexity. Above 100K examples, fine-tuning shows clear advantages, especially for domain-specific reasoning patterns. But quality trumps quantity every time — focus on clean, representative data over volume.
You absolutely don't need to pick one, and the best systems don't. Multi-layer architectures can be the best approach: fine-tuned models provide domain expertise, RAG systems add current information, and prompt engineering with context optimization optimizes the user interface.