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

FrameworkImportsFunctionalTotal
SynapseKit 13
4
LlamaIndex 36
9
LangChain 58
13
Operational Cost

Provider Switch: OpenAI → Groq

FrameworkNew pipNew importLines changed
SynapseKit No No 1
LlamaIndex Yes Yes 3
LangChain Yes Yes 3
Cognitive Load

Mental Model Required

FrameworkCore conceptsConfig 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 pipelineSynapseKit
Clean code, good defaults, some controlLlamaIndex
Custom logic between pipeline stepsLangChain
Self-documenting code for new engineersLangChain
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