Uthereal Cortex SDK vs Vercel AI SDK
This comparison comes up because both are TypeScript SDKs with React components. They are not competing; they cover different layers of the same feature.
Last updated · SDK v1.1.0 · changelog
Short answer: the Vercel AI SDK is the model and streaming UI layer. @uthereal-sdk/cortex is the knowledge layer that grounds answers in your documents and returns claim-level citations with highlighted PDF pages. Use the Vercel AI SDK for the chat experience, Cortex for evidence, or Cortex alone if you want the cited answer and the UI components in one install.
01
Two layers, one feature
- Vercel AI SDK - provider abstraction, tool calling, streaming, useChat. No opinion about where the truth comes from.
- Uthereal Cortex SDK - document retrieval, ranking, claim-to-source mapping, refusal behaviour, PDF evidence rendering.
- Together - the chat UX you already like, grounded in sources a user can verify.
02
Using them together
// a Vercel AI SDK tool backed by Cortex retrieval
const tools = {
searchKnowledge: {
description: "Search the company knowledge base and return cited passages",
parameters: z.object({ query: z.string() }),
execute: async ({ query }) => cortex.rag({ query, max_results: 8 }),
},
};If you want claim-level citations in the rendered answer rather than passages in a tool result, call the Cortex ask endpoint directly and render CitedAnswer.
03
How to choose
- Only need a chat interface over a general model: Vercel AI SDK
- Need answers grounded in your own documents, with sources: Cortex
- Need both, with your own model choice and streaming UI: combine them
Frequently asked questions
- Is Uthereal Cortex an alternative to the Vercel AI SDK?
- Not really; they sit at different layers. The Vercel AI SDK is a model and streaming UI layer: providers, tool calls, useChat. @uthereal-sdk/cortex is the knowledge layer: retrieval over your documents with claim-level citations and PDF page evidence. Many teams use both.
- Can I combine them?
- Yes. Call cortex.rag({ query, max_results }) inside a Vercel AI SDK tool or server action, then stream the grounded response through streamText. Or use the Cortex ask endpoint directly and render CitedAnswer for the citation UI.
- Does the Vercel AI SDK do RAG?
- It gives you the plumbing for tool calls and streaming; retrieval itself is yours to build, usually with a vector store, an embedding pipeline and prompt assembly. It has no opinion about citations or provenance.
- Which one handles citations?
- Cortex. It returns claims bound to references with document, page and span, and ships React components that render them, including the highlighted PDF page.
- Do both run on the edge?
- Yes. The Cortex SDK server entry is a Web Request and Response handler and runs on Vercel Edge, Cloudflare Workers, Deno 2, Bun and Node.js 22+.
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