OMAR
Field NotesCV
LangChain: When the Framework Helps and When It Hurts
← All Notes
AI Engineering26 May 2026 · 4 min read

LangChain: When the Framework Helps and When It Hurts

For a three-step chain, the raw SDK is shorter and clearer. For an agent with twelve tools and retries, it is not.

LangChain gets criticised for being heavy and praised for being comprehensive, and both camps are describing real experiences with different problems.

Here is the line I use to decide.

When the raw SDK wins

For a linear sequence — take input, build a prompt, call the model, parse the result — the provider SDK is shorter, clearer, and easier to debug:

const res = await client.messages.create({
  model: 'claude-sonnet-4-5',
  max_tokens: 1024,
  messages: [{ role: 'user', content: prompt }]
})

Adding a framework here buys abstraction over three lines you already understand. When something breaks you debug your own code instead of reading someone else's chain implementation.

Most AI features I ship for clients are this. A support assistant, a summariser, a classifier — no framework needed.

When the framework wins

The moment you have an agent with a dozen tools, retries, fallbacks between providers, streaming, and conversation memory, you are going to build an orchestration layer whether you name it or not. Yours will be worse than one maintained by many people who have hit the edge cases you have not yet.

Signals you have crossed the line:

  • More than about five tools with conditional routing between them
  • Multi-step retrieval where one query's result decides the next
  • Provider fallback that must preserve conversation state
  • You have written your own retry-and-parse wrapper twice

The honest middle

Use the framework for orchestration, not for prompting. The abstractions that help are the ones managing control flow: tool routing, state, retries. The abstractions that hurt are the ones hiding the prompt, because eventually you need to see exactly what was sent, and a framework that makes that hard costs you an afternoon.

Whatever you choose, keep prompts in your own files, log the exact request and response, and make sure you could rip the framework out in a day if it stopped being worth it.

The cost nobody mentions

Frameworks in this space move fast. Breaking changes between minor versions are common, and pinning versions matters more than in most of your dependency tree. Budget for that maintenance before you adopt.

Resources

AIOpen Sourcelangchain

Need this built properly?

I build secure, fast, bilingual platforms for clients across Egypt, Saudi Arabia, the UAE and Kuwait.

Keep Reading