Skip to content

Micro Template for Autonomous agent capable of managing tasks and interacting with a language model (LLM) to generate and execute tasks

Notifications You must be signed in to change notification settings

macmuriithi/template-microAutoGpt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Template : Micro Autonomous Agent Executor

This PHP code defines a template for an Autonomous Agent class that can perform tasks based on objectives using a Language Model. Here's a brief overview of the code:

Overview

The Autonomous Agent is designed to perform tasks by generating a list of tasks based on a given objective and executing them. It leverages a Language Model (LLM) to generate tasks related to the specified objective. The agent stores information in its memory as it completes tasks and allows you to retrieve this information.

Class Structure

The AutonomousAgent class consists of the following key methods and properties:

Properties

  • $taskList: An array to store tasks.
  • $memory: An array to store information or results.

Methods

  • addTask($task): Adds a task to the agent's task list.
  • setObjectiveAndGenerateTasks($llm, $objective): Sets an objective and generates tasks based on it using the provided Language Model.
  • executeTasks(): Executes tasks in the task list. You can customize the task execution logic within this method.
  • retrieveInformation(): Retrieves information or results from the agent's memory.

Usage

$agent = new AutonomousAgent();
$llm = new YourLLM();
$objective = "Generate a report on AI advancements.";
$agent->setObjectiveAndGenerateTasks($llm, $objective);
$agent->executeTasks();
$information = $agent->retrieveInformation();
foreach ($information as $result) {
     echo $result . "\n";
 }




About

Micro Template for Autonomous agent capable of managing tasks and interacting with a language model (LLM) to generate and execute tasks

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages