What is OpenAGI?
OpenAGI is a groundbreaking initiative that aims to democratize the development of autonomous, human-like agents. This project is built with the belief that artificial intelligence has transformative capabilities which can address numerous real-life challenges. By providing an accessible framework, OpenAGI helps developers create these autonomous agents more easily, thereby moving closer to the vision of achieving Artificial General Intelligence (AGI) for everyone.
Installation Guide
To start with OpenAGI, setting up is straightforward:
-
Create a Virtual Environment:
- For Mac and Linux users, open your terminal and type:
python3 -m venv venv source venv/bin/activate
- For Windows users, use:
python -m venv venv venv/scripts/activate
- For Mac and Linux users, open your terminal and type:
-
Install OpenAGI:
- Use pip to install:
pip install openagi
- Alternatively, clone the repository and install:
git clone https://github.com/aiplanethub/openagi.git pip install -e .
- Use pip to install:
Example: Planning a Trip Using an Agent
OpenAGI's functionalities can be illustrated through a simple example like creating a "Trip Planner Agent":
- Import necessary modules and define a task plan without human intervention.
- Use a tool like DuckDuckGo Search for fetching data.
- Configure the agent with OpenAI models.
- Set it up to plan itineraries based on user preferences, such as a peaceful trip to San Francisco.
Here's an example code snippet:
from openagi.agent import Admin
from openagi.planner.task_decomposer import TaskPlanner
from openagi.actions.tools.ddg_search import DuckDuckGoSearch
from openagi.llms.openai import OpenAIModel
from openagi.worker import Worker
plan = TaskPlanner(human_intervene=False)
action = DuckDuckGoSearch
import os
os.environ['OPENAI_API_KEY'] = "sk-xxxx"
config = OpenAIModel.load_from_env_config()
llm = OpenAIModel(config=config)
trip_plan = Worker(
role="Trip Planner",
instructions="User loves calm places, suggest the best itinerary accordingly.",
actions=[action],
max_iterations=10)
admin = Admin(
llm=llm,
actions=[action],
planner=plan,
)
admin.assign_workers([trip_plan])
res = admin.run(query="Give me total 3 Days Trip to San Francisco Bay area", description="You are a knowledgeable local guide with extensive information about the city, its attractions, and customs")
print(res)
Autonomous Multi-Agent System
OpenAGI can execute tasks autonomously without constant human oversight. For instance, creating a "Sports Agent" to provide cricket match updates autonomously.
Here’s how you build it:
- Set up the environment with necessary API keys and models.
- Define the planner to enable autonomous execution with optional human intervention.
- Use the agent to retrieve and relay the results of sports matches dynamically.
Long-Term Memory Capabilities
OpenAGI enhances interactions through Long Term Memory (LTM):
- Agents remember past interactions to ensure continuity.
- They learn over time, adapting to user input.
- Responses are contextually relevant by referencing prior conversations.
- Successive interactions boost their accuracy and efficiency.
Example setup includes defining memory settings and using OpenAI models for processing queries.
Application Scenarios
OpenAGI is versatile and can be used across various sectors:
- Education: Creates personalized learning environments and automates administrative tasks.
- Finance: Useful for fraud detection, risk assessment, and offering tailored banking advice.
- Healthcare: Monitors patients, offers medical recommendations, and manages data.
How to Contribute
The project is open-source, welcoming contributions in the form of features, infrastructure enhancements, or documentation improvements. For detailed guidelines, refer to their contribution page on GitHub.
By joining OpenAGI, developers not only engage in an innovative community but also pave the way for the future of autonomous AI agents.