Skip to content

Latest commit

 

History

History
118 lines (89 loc) · 4.58 KB

README.md

File metadata and controls

118 lines (89 loc) · 4.58 KB

AI Agent Playground

Python Poetry Code style: black Imports: isort pre-commit

An experimental playground for learning and exploring different AI Agent paradigms and types. This repository provides a flexible framework for implementing, testing, and understanding various AI agent architectures through hands-on experimentation.

Prerequisites

  • Ollama for LLM API
    • Must be installed and running
    • At least one model must be pulled
  • Python 3.12+
  • Poetry for dependency management

Features

  • Multiple reasoning paradigms:
    • ReAct (Reasoning and Acting)
    • ReWOO (Reasoning Without Observation)
  • Different agent types:
    • Simple Reflex Agent
    • Model-based Reflex Agent
    • More agent types coming soon...
  • Dynamic model selection from available Ollama models

Project Structure

src/
├── agents/
│   ├── paradigms/                 # Reasoning paradigm implementations
│   │   ├── base.py                # Base paradigm class
│   │   ├── react.py               # ReAct paradigm
│   │   └── rewoo.py               # ReWOO paradigm
│   └── types/                     # Agent type implementations
│       ├── base.py                # Base agent type class
│       ├── simple_reflex.py       # Simple reflex agent
│       └── model_based_reflex.py  # Model-based reflex agent
├── clients/
│   └── ollama_client.py           # Ollama API client
└── cli.py                         # Command-line interface

Usage

The CLI provides various options to experiment with different combinations of paradigms and agent types:

Basic Commands

# List available options and models
poetry run ai-agent --help

# Run with default settings (ReAct paradigm + Simple Reflex agent)
poetry run ai-agent

# Use ReWOO paradigm with a specific model
poetry run ai-agent --paradigm rewoo --model mistral

# Run a specific experimental goal
poetry run ai-agent --paradigm react --agent-type model-based-reflex --goal task_management

Available Options

  • --paradigm: Choose reasoning paradigm (react or rewoo)
  • --agent-type: Choose agent type (simple-reflex or model-based-reflex)
  • --model: Select LLM model from available Ollama models
  • --max-steps: Set maximum number of steps
  • --verbose: Enable detailed logging

Troubleshooting

If you encounter errors when starting the CLI, ensure:

  1. Ollama is properly installed
  2. Ollama service is running
  3. You have pulled at least one model using ollama pull <model-name>

The CLI will provide specific error messages to help you identify and resolve any issues.

Reasoning Paradigms

ReAct (Reasoning and Acting)

  • Combines reasoning and acting in a loop
  • Think-Act-Observe cycle for step-by-step problem solving
  • Suitable for tasks requiring continuous feedback
  • Best for: debugging, research, interactive problem-solving

ReWOO (Reasoning Without Observation)

  • Plans actions upfront before execution
  • Reduces redundant tool usage
  • Efficient for well-defined tasks with clear steps
  • Best for: task planning, strategy development, decision analysis

Agent Types

Simple Reflex Agent

  • Responds immediately to current perception
  • No internal state maintenance
  • Suitable for straightforward stimulus-response scenarios
  • Best for: quick decisions, simple tasks, immediate responses

Case Studies

See examples/case-studies for detailed analysis of AI Agent implementations in production services.

References