Quickstart¶
This page walks through the first three steps of every SDK script: connect to your deployment, create a project and create a secret profile. Uploading files, deploying AutoGraph and ingesting extend this same script; the end of the page points to them.
You need:
the endpoint of your Arango deployment, including the port, exactly as the deployment publishes it, for example
https://<your-deployment>:8529;a username and password that can access the database you want to work in;
an API key for the model provider you want AutoGraph to use, for example an OpenAI key.
Create a client, a project and a secret profile¶
from arango_ai_sdk import ArangoAIClient
client = ArangoAIClient(
base_url="https://<your-deployment>:8529",
username="<username>",
password="<password>",
)
try:
project = client.project.create(
project_name="my_first_project",
project_type="autograph",
description="Created from the quickstart.",
)
print(project.name, project.project_type, project.db_name)
profile = client.secret_profile.create(
name="openai-quickstart",
secret="<your-api-key>",
provider="openai",
description="Created from the quickstart.",
)
print(profile.profile_id, profile.name, profile.profile_type)
finally:
client.close()
What happened¶
Constructing
ArangoAIClientsigned you in. The SDK exchanged the credentials for a token, checked that the database exists, and keeps the token in memory for the client’s lifetime. Wrong credentials or a misspelt database fail here, not on the first real call. See Authentication.client.project.create(...)created the project and returned anAiProjectHandlebound to it. The handle is where everything project-scoped happens; the client itself is not tied to any project. See Creating a project.client.secret_profile.create(...)stored the API key encrypted on the platform and returned it as aProfile. Keepprofile.profile_id: later stages refer to the key by that ID and never see the key itself. See Creating a secret profile.client.close()released the network connections. It is safe to call more than once.
Every exception the SDK raises descends from
ArangoAIError, so one except clause is
enough to catch anything the SDK can raise. See Errors.
What comes next¶
The rest of the pipeline continues from the project handle and the
profile ID this script created:
Upload the documents under the project’s categories with
client.files.upload_folder(...). See Files.Deploy AutoGraph into the project with
project.autograph.deploy(...), passing the profile ID for the chat and embedding models. See Deploying AutoGraph.Build the context graph with
project.autograph.ingest(...). See Ingesting in one call. The same work is also available as separate steps: Building the corpus, Choosing a strategy per cluster, Reading the stored strategies and Importing the graph.Deploy a retriever with
project.autorag.deploy(...)and ask it withretriever.ask(...). See AutoRAG.
A notebook that runs the whole flow against a sample corpus, from sign-in
through ingestion, a question and clean-up, ships in the repository under
examples/sdk-demo/AI_Suite_SDK_demo.ipynb. Its ingest cell is
commented and shows the one-call form.