PHPackages                             tim.alexander/myagent - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. tim.alexander/myagent

ActiveLibrary

tim.alexander/myagent
=====================

An intelligent PHP agent that uses recursive intelligence and iterative refinement to solve complex tasks

3.4.0(1y ago)117MITPHPPHP ^8.1

Since May 13Pushed 1y ago1 watchersCompare

[ Source](https://github.com/TimAnthonyAlexander/myagent)[ Packagist](https://packagist.org/packages/tim.alexander/myagent)[ Docs](https://github.com/TimAnthonyAlexander/myagent)[ RSS](/packages/timalexander-myagent/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (15)Used By (0)

MyAgent: PHP Programmatic GPT DeepResearch Agent
================================================

[](#myagent-php-programmatic-gpt-deepresearch-agent)

[![MyAgent Banner](https://camo.githubusercontent.com/abf1dfb2ec08143812f3becaca686a7cd2901c72974d01ebdf8f07c31742f562/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4d794167656e742d496e74656c6c6967656e742532305048502532304167656e742d626c7565)](https://camo.githubusercontent.com/abf1dfb2ec08143812f3becaca686a7cd2901c72974d01ebdf8f07c31742f562/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4d794167656e742d496e74656c6c6967656e742532305048502532304167656e742d626c7565)[![PHP Version](https://camo.githubusercontent.com/396e308627273611a751aa614834c4a6cd0b268c51ab52ab5330f94b99771fbc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e312532422d707572706c65)](https://camo.githubusercontent.com/396e308627273611a751aa614834c4a6cd0b268c51ab52ab5330f94b99771fbc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e312532422d707572706c65)[![License](https://camo.githubusercontent.com/5caa455d8debc46fb23abbadb45a733a937f3910a73fc875c2f7820468e1bb54/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e)](https://camo.githubusercontent.com/5caa455d8debc46fb23abbadb45a733a937f3910a73fc875c2f7820468e1bb54/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e)[![Packagist](https://camo.githubusercontent.com/ab71307009d8a6cd6d0e728c15017c4c6f6870a59a5e01c87528212fbc8fae58/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5061636b61676973742d74696d2e616c6578616e6465722532466d796167656e742d626c7565)](https://packagist.org/packages/tim.alexander/myagent)

MyAgent is a sophisticated PHP-based deep-research agent that uses recursive intelligence and iterative refinement to solve complex tasks. Powered by OpenAI's GPT models, it combines search, thinking, evaluation, and memory to produce high-quality solutions.

✨ Features
----------

[](#-features)

- **Iterative Refinement**: Repeatedly improves solutions until achieving high confidence scores
- **Multi-Model Intelligence**: Uses specialized GPT models for different cognitive functions
- **Memory Management**: Maintains context across iterations with intelligent memory system
- **Self-Evaluation**: Objectively scores its own solutions on a 0-10 scale
- **Feedback Loop**: Generates constructive feedback to guide improvement
- **Persistence**: Continues refining until reaching a perfect score or maximum attempts
- **PDF Reports**: Automatically generates and saves final reports as PDF files
- **Configurable**: Easily customize models and settings through configuration file

🚀 Installation
--------------

[](#-installation)

### As a Composer Package

[](#as-a-composer-package)

Install via [Packagist](https://packagist.org/packages/tim.alexander/myagent):

```
composer require tim.alexander/myagent
```

### From Source

[](#from-source)

1. Clone the repository:

    ```
    git clone https://github.com/TimAnthonyAlexander/myagent.git
    cd myagent
    ```
2. Install dependencies:

    ```
    composer install
    ```
3. Configure your OpenAI API key (one of these methods):

    a. Create a config file:

    ```
    mkdir -p config
    echo "your-openai-api-key" > config/openai.txt
    ```

    b. Pass it as a command line argument:

    ```
    php public/runagent.php --api-key=your-openai-api-key "Your task"
    ```

    c. Set it programmatically:

    ```
    $agent = new Agent();
    $agent->setApiKey('your-openai-api-key');
    ```
4. Configure models (optional):

    ```
    # The models.json file will be created automatically with defaults
    # You can edit it to customize which models are used
    ```

💻 Usage
-------

[](#-usage)

### Basic Usage

[](#basic-usage)

```
