OACP Docs
v2.0
Getting StartedComponentsAPI ReferenceExamplesGuides
Getting Started
Introduction
Quick Start
Installation
Basic Usage
Core Concepts
Agents
Agent Systems
Voting Strategies
Storage Backends
Adaptive Prompting
Examples
Research Team
Game AI Simulation
Content Pipeline
Code Review
Advanced Topics
Custom Voting Strategies
Custom Storage Backends
Performance Optimization
Deployment
CLI Commands
Overview
Environment Setup
Monitoring
Log Management
Web Dashboard
Advanced Commands

Agents

Learn how to create, configure, and manage intelligent agents in OACP with adaptive prompting capabilities.

Creating Agents

Agents are the core building blocks of OACP. Each agent has a specific role and can adapt its behavior over time.

from oacp import Agent

# Create a basic agent
agent = Agent(
    name="researcher",
    role="Research and gather information on given topics",
    model="gpt-4",
    temperature=0.7
)

# Create an agent with custom prompting
agent = Agent(
    name="analyst",
    role="Analyze data and provide insights",
    system_prompt="You are an expert data analyst...",
    adaptive_prompting=True
)

Agent Configuration

Basic Parameters

ParameterTypeDescription
namestrUnique identifier for the agent
rolestrDescription of the agent's purpose
modelstrLLM model to use (default: gpt-3.5-turbo)
temperaturefloatCreativity level (0.0-1.0)

Adaptive Prompting

OACP agents can learn and improve their prompts based on interaction history and feedback.

# Enable adaptive prompting
agent = Agent(
    name="adaptive_researcher",
    role="Research specialist",
    adaptive_prompting=True,
    learning_rate=0.1,
    feedback_threshold=5
)

# The agent will automatically improve its prompts based on:
# - Success/failure of tasks
# - User feedback
# - Peer agent evaluations
# - Performance metrics

Agent Interactions

# Direct agent interaction
response = agent.process("What are the latest trends in AI?")

# Agent-to-agent communication
message = agent.send_message(other_agent, "Please review this analysis")

# Batch processing
results = agent.process_batch([
    "Task 1: Research topic A",
    "Task 2: Research topic B",
    "Task 3: Research topic C"
])

Best Practices

Clear Role Definition

Define specific, focused roles for each agent to avoid overlap and improve coordination.

Enable Adaptive Learning

Use adaptive prompting for agents that perform repetitive tasks to improve over time.

Monitor Performance

Regularly review agent performance metrics and adjust configurations as needed.