PRODSovereign European BaaS platformOpen Dashboard →

AI

AI that already knows your data.

Chat, embeddings, retrieval and natural language to SQL in the same SDK as your database, with vectors stored in your own PostgreSQL.

5
AI features in one SDK
SSE
token streaming
ai.tsTS
import { createClient } from '@aurabase/aurabase-js'
const aura = createClient(
'https://my-project.aurabase.cloud',
'aura_anon_xxx',
)
const { data, error } = await aura.ai.chat(
[{ role: 'user', content: 'Summarize this text in one sentence.' }],
{ model: 'gpt-4o-mini', temperature: 0.2, max_tokens: 200 },
)
if (error) throw error
console.log(data?.content)

What’s included

Everything to ship an AI feature. Without a second backend.

Chat

Chat completions

Send messages and get an answer, with the model and temperature you choose.

Streaming

Token streaming

Read tokens as they arrive, and cancel the stream with an AbortSignal.

Usage

Token usage in every answer

Responses report input, output and reasoning tokens, and a finish reason that shows when an answer was cut short.

Embeddings

Embeddings

Turn text into vectors and store them next to your data.

Knowledge

Built-in RAG

Ingest content, then ask questions and get answers with their sources.

Corpus

Namespaces you can manage

List, re-index and delete the corpora your project has built.

Search

Semantic search

Find content by meaning, with a result count and a similarity threshold.

Data

Natural language to SQL

Ask a question in plain words. The server reads your real schema and caps the rows the SQL returns.

Storage

Vectors in your own database

Embeddings live in your project’s PostgreSQL, which ships with pgvector.

How it works

From content to an answer.

  1. 1

    Ingest

    Send your content to a namespace with ragIngest.

  2. 2

    Embed

    Aurabase turns it into vectors stored in your database.

  3. 3

    Ask

    Call rag or semanticSearch with a question.

  4. 4

    Answer

    Get the answer with its sources, or stream tokens with chatStream.

REST API

Prefer plain HTTP? It’s all here.

The SDK is a thin layer over these routes. Send your project’s API key with each request.

MethodEndpointDescription
POST/v1/ai/chatGet a complete chat answer.
POST/v1/ai/chat/streamStream a chat answer as server-sent events.
POST/v1/ai/embedCreate an embedding for a text.
POST/v1/ai/rag/ingestAdd content to a RAG namespace.
POST/v1/ai/rag/queryAnswer a question from a namespace, with sources.
GET/v1/ai/rag/namespacesList RAG namespaces.
POST/v1/ai/rag/{namespace}/reindexRe-index a namespace after an embedding change.
DELETE/v1/ai/rag/{namespace}Delete a namespace and its documents.
GET/v1/ai/searchSearch a namespace by meaning.
POST/v1/ai/nl2sqlTurn a question into SQL for your database.

Questions

Good to know.

Can I stream answers to my users?+
Yes. chatStream() returns an async iterable of tokens, and the last chunk carries the finish reason and token usage.
How do I build a knowledge base?+
Call ragIngest() with a namespace and some content. The namespace is created on the first ingest. Then use rag() to ask questions.
How does natural language to SQL know my schema?+
The server reads it from your project’s database. You can’t send a schema yourself. The generated SQL is limited to 100 rows by default and 1,000 at most.
Can the model call tools or functions?+
Not yet. Tool and function calling isn’t supported.
Can I re-index after changing the embedding model?+
Yes. reindexNamespace() rebuilds a namespace, and deleteNamespace() removes it with its documents.
Do I get a cost per request?+
No cost figure is returned. Each answer does report its token usage, so you can compute your own.

Ready to add AI?

Ship your first AI feature today.

AI is included in every project. No credit card required.