1
LlamaIndex open source
Best for: Retrieval over your own documents
Pricing: Free and open source. Running it costs either your own hardware or an inference provider's per-token fee. Open source; a managed cloud parsing and indexing service is sold separately. source
Strengths
- Purpose-built for ingestion, indexing and retrieval
- Excellent document loaders and parsers
- Clearer mental model than LangChain for RAG specifically
Trade-offs
- Narrower than LangChain outside retrieval
- Also moves quickly with breaking changes
- Its own abstractions still take learning
Verdict: Choose it when the problem is genuinely retrieval. For RAG it is the more focused tool.
source code ↗ 2
Haystack open source
Best for: Production pipelines you need to reason about
Pricing: Free and open source. Running it costs either your own hardware or an inference provider's per-token fee. Open source, with a commercial platform available from deepset. source
Strengths
- Explicit pipeline model — easy to see what runs and in what order
- Stable and production-focused
- Strong evaluation tooling
Trade-offs
- More verbose to set up
- Smaller community than LangChain
- Fewer prebuilt integrations
Verdict: The grown-up option. Pick it when the system must be maintainable by someone who did not write it.
source code ↗ 3
DSPy open source
Best for: Optimising prompts systematically
Pricing: Free and open source. Running it costs either your own hardware or an inference provider's per-token fee. Open source; you pay only for model calls during compilation and inference. source
Strengths
- Treats prompting as something to optimise rather than hand-tune
- Measurable improvements on well-defined tasks
- Genuinely different approach, not another wrapper
Trade-offs
- Steep conceptual learning curve
- Needs an evaluation set to be useful at all
- Overkill for simple applications
Verdict: Worth it when you have a measurable task and prompt quality matters enough to optimise properly.
source code ↗ 4 TP The provider SDK directly
Best for: Most applications, honestly
Pricing: Free libraries; you pay only your model provider's per-token pricing. AI pricing changes unusually fast, so check the vendor's current page before deciding. source
Strengths
- No abstraction between you and the model — trivial to debug
- One fewer fast-moving dependency
- Modern SDKs handle tool calling and structured output natively
Trade-offs
- You write your own retry, chunking and orchestration logic
- No prebuilt loaders or integrations
- More boilerplate for complex agent flows
Verdict: Start here. Add a framework when you can name the specific thing it does that your own code does badly.