Getting Started with AgenticFleet

This guide will help you get started with AgenticFleet quickly and efficiently.

Prerequisites

Before you begin, ensure you have:

  • Python 3.12 or higher
  • pip or uv package manager
  • OpenAI API key
  • Azure OpenAI key (if using Azure)

Installation

Using pip

pip install agentic-fleet
uv pip install agentic-fleet

Quick Start

1. Set Up Environment

Create a .env file:

OPENAI_API_KEY=your_openai_key
AZURE_OPENAI_KEY=your_azure_key
AZURE_OPENAI_ENDPOINT=your_azure_endpoint
AZURE_OPENAI_VERSION=your_azure_version

2. Create Configuration

Create a config.yaml file:

application:
  debug: false
  log_level: INFO
  host: localhost
  port: 8000

agents:
  default_model: gpt-4
  temperature: 0.7

3. Create Your First Agent

from agentic_fleet import Agent, AgentCapabilities

# Create a code review agent
agent = Agent.create(
    name="code_reviewer",
    capabilities=[
        AgentCapabilities.CODE_REVIEW,
        AgentCapabilities.DOCUMENTATION
    ]
)

# Use the agent
result = agent.review_code("def hello(): print('world')")
print(result.suggestions)

4. Create a Fleet

from agentic_fleet import Fleet, FleetType

# Create a development fleet
fleet = Fleet.create(
    name="dev_team",
    type=FleetType.CODE_DEVELOPMENT,
    agents=[
        "architect",
        "developer",
        "reviewer"
    ]
)

# Start a task
result = fleet.start_task("Create a new API endpoint")

5. Run the Application

# Start with default settings
agenticfleet start

# Or with custom settings
agenticfleet start --host localhost --port 8000

Core Concepts

1. Agents

Agents are the building blocks of AgenticFleet:

from agentic_fleet import Agent

agent = Agent.create(
    name="researcher",
    model="gpt-4",
    system_message="You are a skilled researcher..."
)

response = agent.process("Research quantum computing")

2. Fleets

Fleets orchestrate multiple agents:

from agentic_fleet import Fleet

fleet = Fleet.create(
    name="research_team",
    agents=["researcher", "analyst", "writer"],
    config={
        "coordination_pattern": "sequential",
        "max_rounds": 5
    }
)

3. Tasks

Tasks represent work items:

from agentic_fleet import Task

task = Task.create(
    title="Research Project",
    description="Research quantum computing advances",
    priority="high"
)

result = fleet.process_task(task)

4. Memory

Manage agent memory:

from agentic_fleet import Memory

memory = Memory.create(
    owner_id=agent.id,
    content={
        "key_insights": ["Important finding..."],
        "context": "Research context..."
    }
)

Next Steps

  1. Configuration

  2. Development

  3. Integration

  4. Advanced Topics

Common Issues

Port Already in Use

# Check running instances
agenticfleet status

# Force stop all instances
agenticfleet stop --force

API Key Issues

from agentic_fleet import verify_credentials

# Verify API keys
verify_credentials()

Memory Issues

from agentic_fleet import clean_memory

# Clean up old memories
clean_memory(older_than_days=7)

Best Practices

  1. Development

    • Use version control
    • Follow the documentation
    • Write tests for custom agents
  2. Deployment

    • Use environment variables
    • Monitor resource usage
    • Implement proper logging
  3. Security

    • Secure API keys
    • Use OAuth when possible
    • Regular security updates