AutoRAG

You do not construct these classes yourself. Every AiProjectHandle owns one AutoRagManager and exposes it as autorag. deploy, list and get hand back an AutoRag bound to one retriever. deploy returns an AutoRagDeployResult, whose service_info is a ServiceInfo documented in Models and whose autorag is the bound object. undeploy returns the ServiceInfo directly. ask returns a GraphRagQueryResponse.

class arango_ai_sdk.projects.services.autorag.AutoRagManager(service_api, api, project, refresh)

Deploy, list and look up the retrievers of one project.

Parameters:
  • service_api (ServiceApi) – Sends install and delete requests to ACP.

  • api (AutoRagApi) – Sends health and query requests to the retrievers themselves.

  • project (callable returning AiProject) – Returns the current project snapshot.

  • refresh (callable returning AiProject) – Reloads the project from the platform and returns the new snapshot.

deploy(*, chat_api_provider, embedding_api_provider, chat_secret_profile_id, embedding_secret_profile_id, chat_model=None, embedding_model=None, chat_api_url=None, embedding_api_url=None, labels=None, wait=False)

Install a new retriever in this project and return the deploy result.

Steps: build the install request, send it through ServiceApi.deploy_service to AcpPath.GRAPHRAG_RETRIEVER, refresh the project, bind an AutoRag to the new service id. ACP answers once Helm accepts the install, before the pod is up. With wait=True the call then runs AutoRag.wait_until_ready() with its defaults and reports the outcome in ready; a slow start never fails the deploy.

Parameters:
  • chat_api_provider (str) – Provider of the chat model, for example "openai".

  • embedding_api_provider (str) – Provider of the embedding model, for example "openai".

  • chat_secret_profile_id (str) – ID of the secret profile holding the chat provider’s API key.

  • embedding_secret_profile_id (str) – ID of the secret profile holding the embedding provider’s API key.

  • chat_model (str, optional) – Chat model name, for example "gpt-4o".

  • embedding_model (str, optional) – Embedding model name, for example "text-embedding-3-small".

  • chat_api_url (str, optional) – Override for the chat provider’s endpoint.

  • embedding_api_url (str, optional) – Override for the embedding provider’s endpoint.

  • labels (Mapping[str, str], optional) – Labels attached to the deployed service on the platform.

  • wait (bool) – Also wait for the service health check before returning.

  • not (Optional parameters are left out of the install request when)

  • value (given. The SDK does not validate the required strings; an empty)

  • is. (is sent as)

Returns:

service_info from ACP, ready as described above, and autorag bound to the new service.

Return type:

AutoRagDeployResult

Raises:
list()

Refresh the project and return an AutoRag per deployed retriever.

Return type:

list[AutoRag]

get(service_id)

Refresh the project and return the AutoRag bound to service_id.

Raises:

AutoRagNotDeployedError – No retriever with that id is in the project.

Parameters:

service_id (str)

Return type:

AutoRag

class arango_ai_sdk.projects.services.autorag.AutoRagDeployResult(service_info, ready, autorag)

What AutoRagManager.deploy returns: the service record, readiness and the object.

Parameters:
  • service_info (ServiceInfo)

  • ready (bool | None)

  • autorag (AutoRag)

service_info

The service as ACP described it right after accepting the install.

Type:

ServiceInfo

ready

True when deploy(wait=True) saw the health check answer OK within the bound, False when the bound passed first, None when nobody waited (wait=False).

Type:

bool or None

autorag

The object bound to the new service.

Type:

AutoRag

class arango_ai_sdk.projects.services.autorag.AutoRag(service_api, api, project, refresh, service_id)

One deployed retriever of a project, bound to its service id.

Obtained from AutoRagManager, never constructed by users. The id is fixed for the object’s lifetime, every other state property is read from the project snapshot and reflects a refresh.

Parameters:
  • service_api (ServiceApi) – Sends the delete request to ACP.

  • api (AutoRagApi) – Sends health and query requests to the retriever itself.

  • project (callable returning AiProject) – Returns the current project snapshot.

  • refresh (callable returning AiProject) – Reloads the project from the platform and returns the new snapshot.

  • service_id (str) – Id of the retriever this object is bound to.

property service_id: str

Return the id of the retriever this object is bound to.

property is_deployed: bool

Return whether the last project snapshot still lists this retriever.

property service_url: str | None

Return the retriever’s URL, or None when it is no longer deployed.

property service_path: str | None

Return the gateway path of the retriever, or None.

service_url minus scheme and host, without a trailing slash, so endpoints can be appended to it.

ask(query, *, query_type=QueryType.UNIFIED, response_instructions=None, include_metadata=False, partition_ids=None, show_citations=None, model=None)

Ask the retriever a question and return its answer.

Parameters:
  • query (str) – The question, in natural language. Required, an empty string is rejected.

  • query_type (QueryType) – How the retriever searches. Default UNIFIED, which works on both VectorRAG and Full GraphRAG partitions.

  • response_instructions (str, optional) – Style instructions for the answer, such as "Short answer".

  • include_metadata (bool) – Whether to include retrieval metadata in the response.

  • partition_ids (Sequence[str], optional) – Restrict retrieval to these partitions. When omitted the service selects the relevant partitions itself.

  • show_citations (bool, optional) – Whether to keep inline citations in the answer. Omitted means the service default.

  • model (str, optional) – Chat model to use for this query only, instead of the deploy-time default.

Returns:

result holds the answer, run_id the persisted query run.

Return type:

GraphRagQueryResponse

Raises:
  • ValueError – query is empty; nothing is sent.

  • AutoRagNotDeployedError – The retriever is no longer in the project.

  • QueryFailedError – The service answered with a failure code instead of a result.

  • ServiceError – Any other error answer from the service.

wait_until_ready(*, timeout=300.0, poll_interval=5.0)

Block until the retriever answers its health check with OK.

A failed request while the route or the pod is still coming up counts as not ready, not as an error. For the sake of convenience, this method is dedicated to AutoRag retrievers, and not shared with other types of services.

Parameters:
  • timeout (float) – Seconds to wait before giving up.

  • poll_interval (float) – Seconds between two health checks.

Returns:

True once the service is OK, False when timeout passed first.

Return type:

bool

Raises:

AutoRagNotDeployedError – The retriever is no longer in the project.

undeploy()

Stop and remove this retriever.

Steps: refresh the project, raise if the retriever is gone, send ServiceApi.delete with the bound id, refresh again.

Raises:
Return type:

ServiceInfo

class arango_ai_sdk.projects.services.autorag.AutoRagHealthState(*values)

Values of status in the retriever health check response.

OK = 'OK'
FAIL = 'FAIL'