Skip to content
PHP2Shell: The PHP Bug
Akshay Thakare

LLM Frameworks: Raw SDK, LangChain, LangGraph and Agent SDKs

What each layer of the LLM tooling stack gives you, what it costs in complexity, and how to choose for a project.

AI ToolsIntermediate2 min readUpdated 11 Oct 2026

The layers

LayerGives youCost
Provider SDK (direct API)Full control, fewest surprisesYou write retries, tool loops and state yourself
Component libraries (e.g. LangChain)Integrations: loaders, vector stores, model wrappersAbstractions to learn; version churn
Graph / workflow frameworks (e.g. LangGraph)Explicit state machines, checkpoints, human-in-the-loopMore structure to design
Agent SDKs from model providersTool loops, handoffs, tracing out of the boxTied to one ecosystem's conventions

How to choose

  • A single call or a simple RAG endpoint: the provider SDK is often clearest.
  • Many integrations (loaders, stores) you would otherwise write: a component library.
  • Multi-step workflows that must resume, branch and pause for approval: a graph framework.
  • Tool-using agents where built-in tracing and handoffs fit your needs: an agent SDK.

Keep your core logic portable

Put prompts, tool functions and business rules in your own modules. Let the framework call them. Then switching frameworks, or removing one, is a contained change.

Python.py
# your code: framework-independent
def lookup_order(order_id: str) -> dict: ...
 
# thin adapter for whichever framework you use
tools = [as_framework_tool(lookup_order)]

Finished this note?

Share