Oracle Database Agent SDK - Python APIs

Oracle Database Agent SDK provides Python APIs for building AI agents and workflows that run in Oracle AI Database. This guide covers the oracle-db-agent-sdk Python package.

Start here

Follow these two steps to prepare your database environment and run your first agent from Python:

  1. Set up your database. Ensure your database user can run agent workflows, configure access from the database to a supported model provider, and prepare a database-managed credential if the provider requires authentication. See the Agent Engine getting started guide.
  2. Run the quickstart. Install the SDK, configure a model, define a support agent, and ask it a question. See Quickstart: Build an AI Agent with Python.

Your Python application connects to Oracle AI Database through a python-oracledb connection. The database calls the model provider using the endpoint and credential specified in the model configuration. The quickstart includes optional API-key credential setup.

Continue with the Python SDK

After the quickstart, choose the task that matches your application:

Explore example applications

Use the examples as starting points for your own workflows:

  • Order support: look up an order with PL/SQL, then use a model to explain its status.
  • Claim review: run independent medical, policy, and fraud review branches.
  • Ticket routing: classify a support ticket and select a response branch.
  • Document review: revise a draft through repeated reviews with an iteration limit.
  • Case coordination: let a coordinator use a lookup tool and a specialist agent to resolve a case.

Each example provides a function that accepts a database connection and inputs.

Configure its model settings and required database resources before calling it.

Understand how workflows execute

Define agents and workflows in Python, then call execute() to run them in Oracle AI Database. The SDK uses AgentSpec to describe the workflow, and the database runs its steps and tool calls.

Use input and output contracts to understand how steps exchange data. See workflow patterns to choose how steps run, and connection and tool ownership for application responsibilities when managing connections and transactions.

Find exact API details

Use the Python API reference for function signatures, parameters, return values, and errors. For configuration or execution failures, see error handling and the database prerequisites.