Skip to main content

Quick Start

This guide shows how to create and run your first AI agent with BindAI in just a few minutes. By the end of this guide, you will have:
  • Created an AI agent
  • Connected it to a language model
  • Sent your first prompt
  • Received a response

Before You Begin

Make sure you have completed the Installation guide. You will also need an API key for your chosen model provider. For OpenAI:

Create an Agent

Create a new file named main.py.
Run the file.
Example output:

What Happened?

The example performs four simple steps.

1. Create an Agent

This creates a new AI agent configured to use the OpenAI provider and the selected model. The instructions become the agent’s system prompt.

2. Send a Message

The chat() method sends your prompt to the configured language model.

3. Receive the Result

The response returned by the model is available through result.output.

Loading an Agent from YAML

Instead of configuring agents in Python, BindAI also supports YAML configuration. Example:
Load the agent.
YAML configuration makes it easier to manage agents without modifying application code.

Using Templates

BindAI includes ready-to-run templates demonstrating common patterns. Examples include:
  • Agent Basics
  • Workflow Basics
  • Conditions
  • Loops
  • Parallel Execution
  • Retry Policies
  • Scheduling
You can execute a template directly.
Templates are the recommended way to learn the framework because every example is fully runnable.