Frameworks compose your app (LangChain, LlamaIndex, DSPy, Mastra). Vector DBs store embeddings (Pinecone). Observability tools watch traces (Langfuse). Different layers of the stack.
Picture building a house. The framework is the contractor who connects the rooms, wires the lights, and routes the plumbing. They put the pieces together. The vector DB is the warehouse next door that holds all your bricks and lumber. The contractor goes to the warehouse to fetch what they need, but the warehouse does not build the house. The observability tool is the security camera in the hallway, watching what happens inside the finished house. Useful, but it does not lay any bricks. App frameworks, storage, monitoring. Three different jobs, often confused.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Categorising LLM tooling sounds trivial. Until you discover that mid-project decisions hinge on the layer model. A framework choice locks in ejection cost; a vector DB choice locks in retrieval performance; an observability choice locks in vendor profile. Each one is independent, each one is a multi-year commitment, and each one belongs to a distinct layer of the stack.
This dive walks through the three layers, what makes each correct option in this question a framework, why Pinecone and Langfuse are not, and how to pick the right item within each layer. The interview signal is not memorising which name goes where; it is understanding what each layer actually does.
The three-layer model
A production LLM application has three layers that get picked separately:
- Application framework. The composition layer. Gives you primitives (chains, agents, retrievers, parsers, signatures, workflows) that wrap providers and let you build apps without orchestrating raw SDK calls. LangChain, LlamaIndex, DSPy, Mastra, Vercel AI SDK, LangGraph, AutoGen, CrewAI, Haystack v2 all live here.
- Vector database. The storage layer for embeddings. Holds vectors, indexes them for approximate nearest neighbour search, and serves top-k queries. Pinecone, Weaviate, Qdrant, Milvus, Chroma, pgvector, LanceDB live here. They have SDKs, they have managed offerings, they have query APIs. But they do not compose an application.
- Observability platform. The tracing and analytics layer. Captures spans (LLM calls, tool invocations, retrievals), aggregates them, exposes them through a UI, often supports evals over stored traces. Langfuse, LangSmith, Phoenix, Helicone, Weave, Datadog APM live here.
Every production stack runs at least one of each. Conflating layers, 'we picked Pinecone for our agent loop', 'Langfuse handles our composition', 'LangChain is our vector store', is a tell that the candidate has only built on one slice and does not know what the others do.
Situations where this technique stops working.
2–4 min · Everything important, quickly.
| Layer | Role | Examples |
|---|---|---|
| App framework | Compose chains, agents, RAG; abstract providers | LangChain, LlamaIndex, DSPy, Mastra, Vercel AI SDK |
| Vector DB | Store embeddings; ANN search | Pinecone, Weaviate, Qdrant, Chroma, pgvector |
| Observability | Capture traces; evals; analytics | Langfuse, LangSmith, Phoenix, Helicone, Weave |
Real products, models, and research that use this idea.
- Stripe and Notion engineering blog posts describe stacks with LangChain (or raw SDK) + Pinecone + Langfuse. Three distinct layers each picked separately.
- Mastra's launch in 2025 filled the TypeScript framework gap that LangChain.js had not fully addressed; adoption tracks the agent + workflow + eval-first framing.
What an interviewer would ask next. Try answering before peeking at the approach.
QWhere do you put DSPy if your runtime is LangChain?
DSPy is the compile-time optimiser layer. You write programs in DSPy, compile against a trainset and metric, export the compiled prompts and demonstrations, and run them on whatever runtime. LangChain, raw SDK, anything. DSPy and LangChain are not substitutes; they sit at different stages.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Calling Pinecone or Langfuse a framework. That confuses storage and monitoring with composition, and signals only one slice of the stack has been built on.
60 second bullets to scan on the way to the call.
The three layers: framework, vector DB, observability
What each LangChain / LlamaIndex / DSPy / Mastra actually composes
Primary sources. Browse if you want the original framing.
Same topic, related formats. Practice these next.