Build a chatbot over your own documents
The demo is easy. The product is hard, and the gap is entirely about whether a reader can check the answer. Here is the shortest route to a document chatbot people will actually rely on.
Last updated · SDK v1.1.0 · changelog
Short answer: upload your documents to a Cortex agent, install @uthereal-sdk/cortex, expose one authenticated endpoint with createCortexHandler, and render answers with CitedAnswer. Every claim shows its source and PDF citations open the exact page, highlighted. No vector database or embedding pipeline required.
01
Four steps
- Create an agent at agent.uthereal.ai and upload your documents
- npm install @uthereal-sdk/cortex
- Mount createCortexHandler on one authenticated server endpoint, with the API key in server secrets
- Call it from the browser and render CitedAnswer with PDF evidence
02
The server endpoint
import { createCortexHandler } from "@uthereal-sdk/cortex/server";
export const handler = createCortexHandler({
config: {
baseUrl: process.env.CORTEX_API_BASE_URL!,
assistantId: process.env.CORTEX_ASSISTANT_ID!,
apiKey: process.env.CORTEX_SHARED_API_KEY!, // server secret only
},
allowedOrigin: "https://your-app.example",
authenticate: async (request) => {
const user = await verifyYourApplicationSession(request);
return user ? { id: user.id, externalUserId: user.cortexIdentity } : null;
},
store: yourStoreAdapter,
});03
What makes it trustworthy
- Claim-level citations rather than a list of consulted documents
- PDF citations that open the exact page with the passage highlighted
- Refusal when no passage supports the question
- Your own auth, history and quotas, through the CortexStore adapter
- EU or Swiss processing, zero retention, no training on your content
04
Let your coding tool build it
Lovable, Codex, Claude Code, Cursor, Windsurf and GitHub Copilot each have a ready-made instruction file for this SDK. Drop it in and describe the feature.
Add an assistant that answers only from our uploaded documents. Every claim
must cite its source, and PDF citations must open the exact page with the
passage highlighted. Use the Uthereal Cortex SDK and keep the API key in
server secrets.Frequently asked questions
- How do I build a chatbot over my own PDFs?
- Create an agent and upload the documents, mount one authenticated endpoint with createCortexHandler from @uthereal-sdk/cortex/server, and render answers with CitedAnswer. Retrieval, ranking and citation mapping are handled by the service.
- How do I stop it inventing answers?
- Ground it and let it refuse. The agent answers only from retrieved passages; when nothing supports the question it says so instead of generating. Claim-level citations make any remaining error visible immediately.
- How long does this take to build?
- A working cited chatbot is an afternoon with the SDK. Building the same provenance quality yourself, with parsing, chunking, reranking, evaluation and a PDF citation UI, is typically several months.
- What file types work?
- PDFs, manuals, policies, books, research papers and other long-form documents. Layout-aware parsing keeps headings, tables and footnotes intact so citations land on the right region.
- Where does my content live?
- Processing is EU or Swiss resident with zero retention, and nothing you upload trains anyone's model. Documents remain yours and can be removed at any time.
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