Uthereal Cortex SDK vs LangChain
These two are often compared, but they solve different halves of the problem. One gives you the pieces to build retrieval. The other gives you retrieval with provenance already built.
Last updated · SDK v1.1.0 · changelog
Short answer: choose LangChain when you are orchestrating many tools and models and want to own the retrieval pipeline. Choose @uthereal-sdk/cortex when the product needs cited answers over your own documents and you would rather not operate parsing, chunking, embeddings, reranking and a citation UI. They also compose: use the Cortex rag endpoint as a retrieval tool inside a LangChain agent.
01
What each one actually is
- LangChain - an orchestration framework. Loaders, splitters, embeddings, vector stores, retrievers, chains and agents, assembled and operated by you.
- Uthereal Cortex SDK - a hosted retrieval service with a thin TypeScript client. One authenticated endpoint, cited answers, highlighted PDF evidence.
- Overlap - both can answer a question over your documents. The difference is who owns retrieval quality and provenance.
02
Who owns which work
- Document parsing - LangChain: you pick and tune loaders. Cortex: layout-aware, included.
- Chunking and re-indexing - LangChain: yours. Cortex: included.
- Embeddings and model versioning - LangChain: yours, including re-embedding costs. Cortex: included.
- Reranking - LangChain: optional component you wire and evaluate. Cortex: included.
- Claim-level citations - LangChain: build it. Cortex: returned by the API.
- PDF page evidence - LangChain: build it. Cortex: token-based page rendering with highlighting.
- Refusal when evidence is missing - LangChain: prompt engineering. Cortex: default behaviour.
- Infrastructure - LangChain: vector store, jobs, scaling, residency. Cortex: hosted, EU or Swiss resident.
03
Using them together
// Cortex as the retrieval tool inside your own orchestration
const evidence = await cortex.rag({ query, max_results: 8 });
// -> ranked passages with document, page and metadata, ready for your modelThis is the common pattern for teams that already run LangChain: keep the agent graph, replace the home-grown retriever with an evidence source that can prove itself.
04
How to choose
- Pick LangChain if retrieval quality is your differentiator and you have people to tune it
- Pick Cortex if provenance is a requirement and retrieval is a prerequisite, not the product
- Pick both if you need broad orchestration plus verifiable evidence
Frequently asked questions
- Is Uthereal Cortex a LangChain alternative?
- For the RAG use case, yes. LangChain is an orchestration framework: you assemble loaders, splitters, embeddings, a vector store, a retriever and a prompt, then operate all of it. @uthereal-sdk/cortex is a hosted retrieval service behind one install that returns cited answers. If you need general agent orchestration across many tools, LangChain still has the broader surface.
- Can I use both together?
- Yes. Call cortex.rag({ query, max_results }) as a retrieval tool inside a LangChain agent. You keep LangChain's orchestration and get ranked evidence with provenance instead of a home-grown retriever.
- Which gives better citations?
- LangChain returns source documents for the retrieved chunks; mapping individual claims to passages and rendering a highlighted PDF page is left to you. Cortex returns claim-level references with document, page and span, plus React components that render them.
- Which is faster to ship?
- A LangChain RAG demo takes an afternoon; a production one takes months of parsing, chunking, reranking and evaluation work. The SDK path is one install, one authenticated endpoint and a React component.
- What about vendor lock-in?
- Your documents stay yours and can be removed at any time, retrieval output is available as plain ranked JSON, and the generation model remains your choice. Processing is EU or Swiss resident with no training on your content.
Related
Ship a knowledge agent your users can trust
Create an agent, point the SDK at it, and let your AI coding tool do the wiring.
Questions? sdk@uthereal.ai