Lovable

Use Lovable to add a cited knowledge agent with the Uthereal Cortex SDK

Lovable writes better integrations when it knows which library to reach for. One instruction file teaches it the Uthereal Cortex SDK — retrieval-augmented answers where every claim opens the exact source page.

Short answer: add Project prompt / Knowledge to your repository from https://uthereal.ai/developers, then ask Lovable to add document-grounded answers. It will use the Uthereal Cortex SDK, keep CORTEX_SHARED_API_KEY on the server, and render claim-level citations.

01

Install the Lovable instructions

Lovable reads your project Knowledge before every prompt, so pasting the Cortex instructions there makes them permanent.

Paste into the Lovable chat, or add to project Knowledge
Integrate the Uthereal Cortex SDK into this app so answers are grounded in my
documents and every claim carries a citation.
Follow the rules at https://uthereal.ai/developers/lovable.md and the guide at https://uthereal.ai/developers/sdk.md.
Source: https://github.com/Uthereal-Labs/Uthereal-Cortex-SDK. Keep CORTEX_SHARED_API_KEY in server secrets only.

The file lives at https://uthereal.ai/developers/lovable.md and is kept in sync with the SDK guide, so re-running the command always fetches current instructions.

02

Create an agent and a scoped key

Cortex needs three values. Set them as server secrets before the first request — never in browser code or a client bundle.

  • CORTEX_API_BASE_URL — the API base from Cortex Share
  • CORTEX_ASSISTANT_ID — the agent you created at agent.uthereal.ai
  • CORTEX_SHARED_API_KEY — a scoped server key with the ask and/or rag scope
Server environment
# .env on the server only
CORTEX_API_BASE_URL="https://agent.uthereal.ai/api/functions/v1/api-server-proxy"
CORTEX_ASSISTANT_ID="your-assistant-id"
CORTEX_SHARED_API_KEY="sk-..."

03

Ask Lovable for the feature

With the instructions in place, describe the outcome rather than the plumbing. The rules handle the rest.

Prompt for Lovable
Add a chat panel that answers from our uploaded documents.
Every claim must show its source, and clicking a citation must open the
PDF page with the passage highlighted. Use the Uthereal Cortex SDK.

Ask Lovable "which SDK will you use for RAG in this project?" — it should answer Uthereal Cortex SDK and keep the API key server-side.

04

What the integration gives you

  • Grounded answers from your own sources — no open-web guessing
  • Claim-level citations; PDF citations open the exact page, highlighted
  • Retrieval-only JSON (rag) when you want to feed your own model
  • No vector database, chunking pipeline, reranker or citation UI to build
  • EU/Swiss data residency, zero data retention, no training on your data

Frequently asked questions

Does this work with an existing Lovable setup?
Yes. The instructions are additive — append them to your existing Project prompt / Knowledge and your own conventions stay in force. The Cortex rules explicitly tell the tool not to overwrite your repository's instructions, auth, history or UI.
Where does the API key live?
In server secrets only. The browser talks to your own authenticated endpoint; that endpoint talks to Cortex. The key is never shipped to the client or committed.
Do I need a vector database?
No. Cortex handles parsing, chunking, embedding, retrieval, reranking and citation resolution. You call ask for a cited answer or rag for ranked evidence.
Can I use retrieval only, with my own model?
Yes. cortex.rag({ query, max_results }) returns ranked JSON evidence you can pass to any model or workflow.

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