Skip to main content

About

The Auggie Python SDK provides a programmatic interface to Auggie for building custom integrations and agents in Python applications.

Installation

Usage

Basic Initialization

Full Configuration

Custom CLI Arguments

The cli_args parameter allows you to pass additional command-line arguments to the Auggie CLI when spawning the agent process. This is useful for passing custom or experimental CLI flags that aren’t exposed as dedicated parameters.
Common CLI arguments:
  • --quiet - Only show final assistant message
  • --max-turns <n> - Limit the number of agentic turns
  • --retry-timeout <sec> - Timeout for rate-limit retries (seconds)
  • --shell <name> - Select shell: bash | zsh | fish | powershell
  • --rules <path> - Additional rules file (repeatable)
  • --permission <rule> - Set tool permissions with ‘tool-name:policy’ format
  • --startup-script <script> - Inline startup script to run before each command
The cli_args are appended after all other CLI arguments, giving you flexibility to pass any additional flags or options supported by the underlying Auggie CLI. See the CLI reference for available command-line options.

Output Modes

The Python SDK supports multiple output modes to fit different use cases:

Typed Returns

Specify the exact type you expect, and the SDK ensures the agent returns data in that format:

Automatic Type Inference

When no return_type is specified, the agent automatically infers the best type:

Structured Data with Dataclasses

Return complex structured data using Python dataclasses:

Streaming Mode

Listen to real-time updates using an event listener:
Supported return types: int, float, str, bool, list, dict, List[T], Dict[K, V], dataclasses, Enum

Custom Functions

The Python SDK supports custom function calling, allowing you to provide Python functions that the agent can intelligently call during execution. This enables the agent to interact with external systems, perform calculations, fetch data, and more.

Creating Custom Functions

Define Python functions with type hints and docstrings. The agent will automatically understand how to use them:

Function Requirements

For functions to work properly with the agent:
  1. Type Hints Required: All parameters must have type annotations
  2. Docstrings Required: Function must have a docstring with:
    • Function description (first paragraph)
    • Parameter descriptions in the Args: section
  3. JSON-Serializable: Arguments and return values must be JSON-serializable
  4. Keyword Arguments: Functions must accept keyword arguments

Example with Multiple Functions

How It Works

  1. Function schemas are automatically generated from type hints and docstrings
  2. The agent receives the instruction and available functions
  3. The agent intelligently decides when to call functions
  4. The SDK executes the functions and sends results back to the agent
  5. The agent continues processing and can call more functions if needed
  6. Final response is returned according to return_type
Function Calling Limits: Function calling is limited to 5 rounds to prevent infinite loops.

See Also