RAG LoC Evidence Dashboard
LLM Showdown #3 — all numbers from the public Kaggle notebook. Same task, same document, same query across all three frameworks.
Benchmark
Lines of Code — Full RAG Pipeline
Raw Data
LoC Breakdown
| Framework | Imports | Functional | Total |
| SynapseKit |
1 | 3 |
|
| LlamaIndex |
3 | 6 |
|
| LangChain |
5 | 8 |
|
Operational Cost
Provider Switch: OpenAI → Groq
| Framework | New pip | New import | Lines changed |
| SynapseKit |
No |
No |
1 |
| LlamaIndex |
Yes |
Yes |
3 |
| LangChain |
Yes |
Yes |
3 |
Cognitive Load
Mental Model Required
| Framework | Core concepts | Config pattern |
| SynapseKit |
1 |
Per-instance |
| LlamaIndex |
3 |
Global Settings |
| LangChain |
5 |
Explicit wiring |
Decision Guide
When to Pick Each
| If you need… | Pick |
| Fastest path to working pipeline | SynapseKit |
| Clean code, good defaults, some control | LlamaIndex |
| Custom logic between pipeline steps | LangChain |
| Self-documenting code for new engineers | LangChain |
| Multi-LLM agents (avoid global config) | SynapseKit or LangChain |
Key Findings
What the Numbers Show
- SynapseKit's 4-line pipeline isn't a toy — it runs a full load/chunk/embed/retrieve/generate cycle. The missing lines are abstracted, not missing.
- LangChain's 13 lines are entirely justified if you need per-step customisation. The verbosity is intentional — every line is a decision point you control.
- LlamaIndex hits a good middle ground: 9 lines with opinionated defaults you can override without rewriting the whole pipeline.
- The provider switch test is more revealing than LoC at hello-world. SynapseKit's 1-line change vs 3-line change for the others reflects a real architectural difference in how provider coupling is handled.
- LlamaIndex's global Settings is the one design choice most likely to bite teams in production — multi-agent systems need per-instance LLM config, not global state.
www.engineersofai.com · AI Letters #12 · Data: Kaggle LLM Showdown #3