Prompt
What should I use instead of LangChain for a simpler agent setup?
Latest observation
If you want something simpler than LangChain for an agent setup, it depends on how much abstraction you want to keep.
Good simpler alternatives
1. Use the OpenAI API directly
Best if you want the least framework overhead.
- You control the prompt, tools, and loop yourself
- Easier to debug
- Fewer moving parts than LangChain
Typical pattern:
- Send user input to the model
- If the model requests a tool, call it
- Feed the result back
- Repeat until final answer
This is usually the best choice for a small agent.
2. OpenAI Agents SDK
Best if you want agent-style abstractions but still want something lighter than LangChain.
- Designed specifically for agent workflows
- Easier tool calling and orchestration
- Less general-purpose complexity than LangChain
Good middle ground if you still want helpers for tools, memory, and routing.
3. LiteLLM
Best if your main issue is provider switching, not agent logic.
- Unified API across OpenAI, Anthropic, Gemini, etc.
- Very lightweight
- Often paired with your own agent loop
4. PydanticAI
Best if you want structured outputs and clean Python ergonomics.
- Simple, typed agent definitions
- Good for tool use and validation
- Less bloated than LangChain
Great for production Python code where you want reliability and readability.
5. Semantic Kernel
Best if you want something more structured but still modular.
- Supports agents/tools/plugins
- More enterprise-y than minimal
- Usually simpler than LangChain in some areas, but still a framework
My practical recommendation
- Simplest overall: use the OpenAI API directly
- Simplest “agent framework” option: OpenAI Agents SDK
- Best Pythonic structured option: PydanticAI
Rule of thumb
If your agent only needs:
- tool calling
- a small memory loop
- basic routing
then don’t use LangChain. Start with:
- OpenAI API directly, or
- OpenAI Agents SDK / PydanticAI if you want a bit more structure.
If you want, I can show you a minimal agent example in plain OpenAI API, PydanticAI, or OpenAI Agents SDK.