Skip to main content

AI Refinery™ SDK

Python 3.12+

Get Your API Key from AI Refinery

To start using AI Refinery™, you must first create an account and obtain an API key. Contact us through AI Refinery™ official website to submit your request and start your journey with AI Refinery™ SDK.

Introduction

AI Refinery™ by Accenture is a Cloud Service for developing and executing AI multi-agent solutions. It is a platform designed to help organizations:

  • Adopt and customize large language models (LLMs) to meet specific business needs.

  • Integrate generative AI across various enterprise functions using a robust AI stack.

  • Foster continuous innovation with minimal human intervention.

  • Ensure seamless integration and ongoing advancements in AI capabilities within your projects.

The AI Refinery™ SDK is engineered to facilitate the development of AI solutions by leveraging features supported by AI Refinery such as:

  • The Distiller Framework: A framework designed to streamline complex workflows by orchestrating various agents that handle different tasks.
  • Inference API: An Api designed to seamlessly connect to any Language Model supported by AI Refinery™.
  • Knowledge Extraction: An API that is designed to extract knowledge from various formats of input documents containing text, tables, and figures.

Documentation

Comprehensive documentation for the SDK is available on the official documentation website.

All the APIs integrated in the AI Refinery™ SDK are detailed in API page.

Installation

We recommend using a MacOS or a Linux system to install the SDK. For Windows setup, we recommend using WSL (Windows Subsystem Linux), a Linux kernel you can access from Windows. For instructions on installing WSL, please visit this page. Please use Ubuntu Distro 22.04 or above.

pip install airefinery-sdk

Examples

1. Design your Stock Investment Strategy Advisor

This example uses the AI Refinery™ SDK to create and run an AI system that can provide suggestions on investing in stocks. This example demonstrates:

  • How to manage AI agents using a "Directed Acyclic Graph (DAG)" workflow representation.
  • Usecases of AI Refinery™ UtilityAgent and SuperAgent.
  • AI Agent parallel processing, allowing all tasks to begin execution as soon as they receive the necessary input information.

2. Integrate Your Custom Python Functions with the Tool Use Agent

The Tool Use Agent is a utility agent designed to perform function calls using provided tools. It enables dynamic execution of functions based on user queries, allowing for a flexible and extensible system. By integrating both built-in and custom tools, the agent can process a wide range of tasks—from simple calculations to complex data processing.

3. Integrate Responsible AI (RAI) into your project

The RAI module is a Responsible AI framework designed to help you define, load, and apply safety or policy rules to user queries via a Large Language Model (LLM). This module automatically applies system base rules for RAI checks and allows users to create and add custom rules for specific needs.

4. Process your documents to extract the knowledge for your project

This example introduces The Knowledge Extraction API that allows you to send a document and then extract the knowledge/information contained within the documents. This example demonstrates:

  • How to perform knowledge extraction tasks from your PPTX, PDF, DOCX, PPT, and DOC files.
  • The DocumentProcessingClient.
  • How to construct a knowledge database for your project.

5. For more examples, check all our tutorials here.

Quickstart

  1. Create your first project
  • Create a directory named sdk-project.
  • Inside thesdk-project directory, create a Python file named example.py to place the Python code needed to run the SDK Distiller client.
  • Also, within the sdk-project directory, create a YAML file named example.yaml to provide your project configuration.

This gives you the following project structure:

sdk-project/  
│  
├── example.py  
├── example.yaml
  1. Configure your project with a single YAML file

You can start by configuring the orchestrator for this project to have access to

  • A CustomAgent with the name Assistant Agent that you implement and add to executor_dict executor_dict
  • An AIRefienry built-in utility agent named Search Agent. that you can call and use as-is

The settings for each of these utility agents are specified under utility_agents. You have the flexibility to expand your project based on your requirements. You can add additional custom agents that you define in the future or integrate built-in agents from our agent library.

orchestrator:
  # Agent name list that the Orchestrator would route the user's queries to
  agent_list:
    - agent_name: "Assistant Agent"
    - agent_name: "Search Agent"

# List of all utility_agents active in the project
utility_agents:

  # Agent 1 configuration
  - agent_class: CustomAgent
    agent_name: "Assistant Agent"
    agent_description: "The Assistant Agent helps the users in their projects."
    config: {}

  # Agent 2 configuration
  - agent_class: SearchAgent
    agent_name: "Search Agent"
  1. Create you first AIRefinery client

AsyncAIRefinery API creates a distiller client. This client will interface with the AI Refinery™ service to run your project. Below is a function that sets up the distiller client. Here's what it does:

  • Authenticate using AIREFINERY_API_KEY from your os environment variables.
  • Defines the simple_agent function that will cover the scope of the Assistant Agent using AI Refinery™ Inference-as-a-service.
  • Instantiates a AsyncAIRefinery.
  • Creates a project named my_first_project using the configuration specified in the example.yaml file.
  • Adds the simple_agent to the executor_dict under the name Assistant Agent.
  • Runs the project in interactive mode.
import asyncio
import os

from air import AsyncAIRefinery

API_KEY =str(os.getenv("AIREFINERY_API_KEY"))

async def simple_agent(query: str):

    prompt = "You are an AI assistant that helps users navigate their projects."
    client = AsyncAIRefinery(api_key=API_KEY)

    response = await client.chat.completions.create(
        messages=[{"role": "user", "content": prompt}],
        model="openai/gpt-oss-120b",
    )
    return response.choices[0].message.content

async def distiller_client_test():
    client = AsyncAIRefinery(api_key=API_KEY)
    project_name = "my_first_project"

    # upload your config file to register a new distiller project
    client.distiller.create_project(config_path="example.yaml", project=project_name) 

    # Define a mapping between your custom agent to Callable.
    # When the custom agent is summoned by the super agent / orchestrator,
    # distiller-sdk will run the custom agent and send its response back to the
    # multi-agent system.
    executor_dict = {
        "Assistant Agent": simple_agent,
    }
    async with client.distiller(
        project=project_name,
        uuid="test_user",
        executor_dict=executor_dict,
    ) as dc:
        responses = await dc.query("Hello")
        async for response in responses:
            print(response["content"])  

if __name__ == "__main__":

    asyncio.run(distiller_client_test())

Execution

To execute my_first_project, run the following commands on your terminal:

cd sdk-project/
python example.py

Running these commands will create your project on the AI Refinery™ server and run your Distiller client.

Releases & Versioning

airefinery-sdk is currently on version 1.MINOR.PATCH.

The airefinery-sdk package defines the main interfaces and runtime logic for the entire AIRefinery Platform. To maintain stability, we will clearly announce any breaking changes in advance and reflect them through appropriate version updates and deprecation announcement. As a rule, any changes that break compatibility in stable parts of the API will result in a minor or major version update, depending on the scope of the change.

Minor version increases will occur for:

  • Introduction of new agents or capabilities

  • Additions to supported features

Patch version increases will occur for:

  • Bug fixes

  • Minor improvements or refinements that do not affect API stability

Metadata

Release files for airefinery-sdk 1.33.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for airefinery-sdk 1.33.2
File Size Uploaded Provenance Actions
airefinery_sdk-1.33.2.tar.gz 175.6 kB With provenance Details for airefinery_sdk-1.33.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for airefinery-sdk 1.33.2
File Interpreter ABI Platform Actions
airefinery_sdk-1.33.2-py3-none-any.whl Python 3 none any Details for airefinery_sdk-1.33.2-py3-none-any.whl

Total release size: 417.4 kB

Release files / airefinery_sdk-1.33.2.tar.gz

Download URL airefinery_sdk-1.33.2.tar.gz
Size 175.6 kB
Tags Source
SHA-256 checksum
How to use checksums
a04a59c0931e4a41fc452bbe8f3583a87c5a20d8dad55c6b0258a033b22edd2b
BLAKE2b-256 checksum
How to use checksums
2eaa3b08c9fd05ccc2c9fb52b4fc7ed8b6963ff2f126d9c0bb60bf9245baa2a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.

Transparency log

Release files / airefinery_sdk-1.33.2-py3-none-any.whl

Download URL airefinery_sdk-1.33.2-py3-none-any.whl
Size 241.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8be533695cdfe57653a1d932976ee2b75ba8b2e5a2f879fae6d9fdd839d0d6d6
BLAKE2b-256 checksum
How to use checksums
a6fbc23da5e0b3e0a75a3efeeb845ae58ba38184228aad3c275f0ebe9c6eb513
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.

Transparency log

Security for airefinery-sdk 1.33.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for airefinery_sdk-1.33.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.33.2 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page