Skip to content

Installation

Requirements

  • Python 3.12+
  • uv (recommended) or pip
  • OpenAI API key

uv is a fast Python package manager that handles dependencies and virtual environments automatically.

# Install uv if you don't have it
curl -LsSf https://astral.sh/uv/install.sh | sh

# Add AF to your project
uv add ds-agentic-flow

Install with pip (alternative)

pip install ds-agentic-flow

This installs AF and its dependencies, including the OpenAI Agents SDK.

Set up your API key

AF uses the OpenAI Agents SDK, which requires an API key:

export OPENAI_API_KEY="your-api-key"

Or create a .env file:

OPENAI_API_KEY=your-api-key

And load it in your code:

from dotenv import load_dotenv
load_dotenv()

Development Setup

To contribute or run samples locally:

# Clone the repository
git clone https://github.com/daiichisankyo/AgenticFlow.git
cd AgenticFlow

# Install with dev dependencies
uv sync --group dev

# Run tests
uv run pytest

# Run linter
uv run ruff check src/

# Build documentation
uv sync --group docs
uv run mkdocs serve

Project Structure

AgenticFlow/
├── pyproject.toml      # Package config + dependency groups
├── uv.lock             # Lock file
├── src/agentic_flow/   # Library source
├── tests/              # Test suite
└── sample/             # Sample applications

Dependency Groups

Group Purpose Command
dev Testing, linting uv sync --group dev
docs Documentation uv sync --group docs
sample Sample apps uv sync --group sample

Run sample applications:

uv sync --group sample
uv run python -m sample.guide.cli

Verify installation

import agentic_flow as af

assistant = af.Agent(
    name="assistant",
    instructions="Say hello.",
    model="gpt-5.2",
)

async def greet(message: str) -> str:
    return await assistant(message)

runner = af.Runner(flow=greet)
result = runner.run_sync("Hi!")
print(result)

If you see a greeting, you're ready to go.


Next: Quickstart