Skip to main content

Documentation Index

Fetch the complete documentation index at: https://arivu.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

What the backend needs

The REST adapter in integrations/rest_adapter.py exposes the pipeline as a FastAPI application.Required values:
  • ARIVU_API_KEY or api_key if you want auth
  • A host and port for the API server
  • Optional CORS configuration when embedding in browser apps

What the REST API returns

Query result

Returns the generated SQL, the natural-language response, success state, and session ID.

Approval flow

Returns pending_approval: true when the SQL must be approved before execution.

RLHF feedback

Accepts positive/negative feedback for a session.

Health check

Returns backend health, integration name, schema age, and active mode.

Setup steps

1

Create the REST server

Instantiate RESTIntegration with your Arivu connection.
2

Add an API key

Set ARIVU_API_KEY if you want requests to require authentication.
3

Start the server

Call adapter.start(host="0.0.0.0", port=8000) or mount the FastAPI app in your own process.
4

Call /query

POST a natural-language question and receive the generated SQL and answer in the JSON response.

Example

from arivu.integrations.rest_adapter import RESTIntegration

adapter = RESTIntegration(
    db=db,
    api_key="your-secret-key",
)

adapter.start(host="0.0.0.0", port=8000)
curl -X POST http://localhost:8000/query \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-secret-key" \
  -d '{"question":"How many users signed up today?","user_id":"rest_user"}'

Backend behavior

  • Session IDs default to the provided user_id field, so API clients can keep their own session identity.
  • pending_approval responses are returned in JSON so a caller can show a manual approval flow.
  • /refresh refreshes the schema cache.
  • /session/{session_id} returns stored session history.
  • CORS is enabled by default to support browser clients, but you should restrict origins in production.
Use an API key in production. The REST adapter is intentionally simple so you can plug it into any client, but that also means auth is your responsibility.