diff --git a/README.MD b/README.MD index 224ce2d0a..c897a2e1e 100644 --- a/README.MD +++ b/README.MD @@ -9,13 +9,14 @@

Open-source framework to build, manage and run useful Autonomous AI Agents

- +

- + +

@@ -26,15 +27,12 @@ SuperAGI stars - -SuperAGI pull-requests - -SuperAGI Commits +SuperAGI Commits

@@ -76,7 +74,7 @@
-## 📽 Setting Up SuperAGI using Docker Hub +### 📽 Setting Up SuperAGI using Docker Hub

@@ -87,29 +85,27 @@
Not sure how to setup? Learn here

-
-

-
Deploy SuperAGI to DigitalOcean with one click. -

-## 💡 Features +### 💡 Features -- Provision, Spawn & Deploy Autonomous AI Agents -- Extend Agent Capabilities with Tools -- Run Concurrent Agents Seamlessly -- Graphical User Interface -- Action Console -- Multiple Vector DBs -- Agent Trajectory Fine-Tuning -- Performance Monitoring -- Agent Memory Storage -- Resource Manager +- Provision, spawn & deploy autonomous AI agents +- Tools/Toolkits for extended agent capabilities +- Concurrent agent runs +- Schedule agents +- Action console +- Multiple vector DBs +- Agent trajectory fine-tuning +- Performance monitoring +- Tool memory +- Resource manager +- Knowledge embeddings +- Agent workflows -## 🛠 Tools +### 🛠 Tools Twitter Coding Tool Instagram Knowledge Search Email Jira File Manager Google Search Dall-E Github Web Interaction Duckduckgo Google Calendar Google Calendar Serp API Searx Web Scraper Notion Apollo -## 💻 Screenshots +### 💻 Screenshot

@@ -118,13 +114,24 @@

-## 🛣 Roadmap +### 🛣 Roadmap [Click here to checkout the latest roadmap 🔗](https://github.com/users/TransformerOptimus/projects/5/views/1) +### ⚙️ Setting up + +1. Download the repo using `git clone https://github.com/TransformerOptimus/SuperAGI.git` in your terminal or directly from github page in zip format. + +2. Navigate to the directory using `cd SuperAGI` and create a copy of `config_template.yaml`, naming it `config.yaml` (take note of the file extension `.yaml`, *not* `.yml`). +3. Enter your LLM API Key or Auth token in `config.yaml` file. +4. Ensure that Docker is installed in your system, if not, Install it from [here](https://docs.docker.com/get-docker/). +5. Once you have Docker Desktop running, run the command: `docker-compose up --build` in the SuperAGI directory. Open your browser and navigate to `http://localhost:3000` to access SuperAGI. + +- If you wish to change the port it's running on, open the `docker-compose.yml` file and update the `proxy` container port forwarding, for example: `"3000:80"` + -## 🌐 Architecture +### 🌐 Architecture
SuperAGI Architecture @@ -157,31 +164,11 @@
-## ⚙️ Setting up - -1. Download the repo using `git clone https://github.com/TransformerOptimus/SuperAGI.git` in your terminal or directly from github page in zip format. - -2. Navigate to the directory using `cd SuperAGI` and create a copy of `config_template.yaml`, naming it `config.yaml` (take note of the file extension `.yaml`, *not* `.yml`). -3. Enter your unique OpenAI API Key, Google key, Custom search engine ID without any quotes or spaces in `config.yaml` file. Follow the links below to get your keys: - -|Keys|Accessing the keys| -|--|--| -|**OpenAI API Key**| Sign up and create an API key at [OpenAI Developer](https://beta.openai.com/signup/)| -|**Google API key**| Create a project in the [Google Cloud Console](https://console.cloud.google.com/) and enable the API you need (for example: [Google Custom Search JSON API](https://developers.google.com/custom-search/v1/introduction)).| -|**Custom search engine ID**| Visit [Google Programmable Search Engine](https://programmablesearchengine.google.com/about/) to create a custom search engine for your application and obtain the search engine ID.| - -4. Ensure that Docker is installed in your system, if not, Install it from [here](https://docs.docker.com/get-docker/). -5. Once you have Docker Desktop running, run the command: `docker-compose up --build` in the SuperAGI directory. Open your browser and navigate to `http://localhost:3000` to access SuperAGI. - - - If you wish to change the port it's running on, open the `docker-compose.yml` file and update the `proxy` container port forwarding, for example: `"3000:80"` - - - -## ⚠️ Under Development! +### ⚠️ Under Development! This project is under active development and may still have issues. We appreciate your understanding and patience. If you encounter any problems, please first check the open issues. If your issue is not listed, kindly create a new issue detailing the error or problem you experienced. Thank you for your support! -## 👩‍💻 Contributors +### 👩‍💻 Contributors [![TransformerOptimus](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/133493246?v=4&w=50&h=50&mask=circle)](https://github.com/TransformerOptimus) [![Cptsnowcrasher](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/133322218?v=4&w=50&h=50&mask=circle)](https://github.com/Cptsnowcrasher) [![vectorcrow](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/133646556?v=4&w=50&h=50&mask=circle)](https://github.com/vectorcrow) [![Akki-jain](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/92881074?v=4&w=50&h=50&mask=circle)](https://github.com/Akki-jain) [![Autocop-Agent](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/129729746?v=4&w=50&h=50&mask=circle)](https://github.com/Autocop-Agent)[![COLONAYUSH](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/60507126?v=4&w=50&h=50&mask=circle)](https://github.com/COLONAYUSH)[![luciferlinx101](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/129729795?v=4&w=50&h=50&mask=circle)](https://github.com/luciferlinx101)[![mukundans89](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/101278493?v=4&w=50&h=50&mask=circle)](https://github.com/mukundans89)[![Fluder-Paradyne](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/121793617?v=4&w=50&h=50&mask=circle)](https://github.com/Fluder-Paradyne)[![nborthy](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/101320057?v=4&w=50&h=50&mask=circle)](https://github.com/nborthy)[![nihirr](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/122777244?v=4&w=50&h=50&mask=circle)](https://github.com/nihirr)[![Tarraann](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/97586318?v=4&w=50&h=50&mask=circle)](https://github.com/Tarraann)[![neelayan7](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/43145646?v=4&w=50&h=50&mask=circle)](https://github.com/neelayan7)[![Arkajit-Datta](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/61142632?v=4&w=50&h=50&mask=circle)](https://github.com/Arkajit-Datta)[![guangchen811](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/103159823?v=4&w=50&h=50&mask=circle)](https://github.com/guangchen811)[![juanfpo96](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/14787156?v=4&w=50&h=50&mask=circle)](https://github.com/juanfpo96)[![iskandarreza](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/32027019?v=4&w=50&h=50&mask=circle)](https://github.com/iskandarreza)[![jpenalbae](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/8380459?v=4&w=50&h=50&mask=circle)](https://github.com/jpenalbae)[![pallasite99](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/26508636?v=4&w=50&h=50&mask=circle)](https://github.com/pallasite99)[![xutpuu](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/11964505?v=4&w=50&h=50&mask=circle)](https://github.com/xutpuu)[![alexkreidler](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/11166947?v=4&w=50&h=50&mask=circle)](https://github.com/alexkreidler)[![hanhyalex123](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/100895608?v=4&w=50&h=50&mask=circle)](https://github.com/hanhyalex123)[![ps4vs](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/91535358?v=4&w=50&h=50&mask=circle)](https://github.com/ps4vs)[![eltociear](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/22633385?v=4&w=50&h=50&mask=circle)](https://github.com/eltociear) [![shaiss](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/113060?v=4&w=50&h=50&mask=circle)](https://github.com/shaiss) [![AdityaRajSingh1992](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/105219157?v=4&w=50&h=50&mask=circle)](https://github.com/AdityaRajSingh1992) @@ -204,8 +191,9 @@ This project is under active development and may still have issues. We appreciat [![ResoluteStoic](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/105219157?v=4&w=50&h=50&mask=circle)](https://github.com/ResoluteStoic) [![JohnHunt999](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/137149331?v=4&w=50&h=50&mask=circle)](https://github.com/JohnHunt999) [![Maverick-F35](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/138012351?v=4&w=50&h=50&mask=circle)](https://github.com/Maverick-F359) -[![PaulRBerg](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/8782666?v=4&w=50&h=50&mask=circle)](https://github.com/PaulRBerg) [![jorgectf](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/46056498?v=4&w=50&h=50&mask=circle)](https://github.com/jorgectf) +[![AdityaSharma13064](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/138581531?v=4&w=50&h=50&mask=circle)](https://github.com/AdityaSharma13064) +[![lalitlj](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/138583454?v=4&w=50&h=50&mask=circle)](https://github.com/lalitlj)

Back to top

diff --git a/gui/pages/Content/Agents/AgentCreate.js b/gui/pages/Content/Agents/AgentCreate.js index 0a0652db9..f438fcce1 100644 --- a/gui/pages/Content/Agents/AgentCreate.js +++ b/gui/pages/Content/Agents/AgentCreate.js @@ -164,6 +164,7 @@ export default function AgentCreate({ } else { setModel(selected_model); } + console.log(response) }) .catch((error) => { console.error('Error fetching models:', error); diff --git a/gui/pages/Content/Models/ModelInfo.js b/gui/pages/Content/Models/ModelInfo.js index ebc5be89a..745aee8ef 100644 --- a/gui/pages/Content/Models/ModelInfo.js +++ b/gui/pages/Content/Models/ModelInfo.js @@ -8,7 +8,7 @@ export default function ModelInfo(modelDetails){
-
+
Installation Type
{modelData === 'Marketplace' && marketplace_logo} diff --git a/install_tool_dependencies.sh b/install_tool_dependencies.sh index 7f37ee224..360395e50 100755 --- a/install_tool_dependencies.sh +++ b/install_tool_dependencies.sh @@ -1,10 +1,19 @@ #!/bin/bash +# Update and upgrade apt settings and apps +apt update && apt upgrade -y +xargs apt install -y < /app/requirements_apt.txt + # Run the project's main requirements.txt pip install -r /app/requirements.txt -# Loop through the tools directories and install their requirements.txt if they exist for tool in /app/superagi/tools/* /app/superagi/tools/external_tools/* /app/superagi/tools/marketplace_tools/* ; do +# Loop through the tools directories and install their apt_requirements.txt if they exist + if [ -d "$tool" ] && [ -f "$tool/requirements_apt.txt" ]; then + echo "Installing apt requirements for tool: $(basename "$tool")" + xargs apt install -y < "$tool/requirements_apt.txt" + fi +# Loop through the tools directories and install their requirements.txt if they exist if [ -d "$tool" ] && [ -f "$tool/requirements.txt" ]; then echo "Installing requirements for tool: $(basename "$tool")" pip install -r "$tool/requirements.txt" diff --git a/main.py b/main.py index 5c5314a34..4f3f83865 100644 --- a/main.py +++ b/main.py @@ -75,8 +75,13 @@ db_url = urlparse(db_url) db_url = db_url.scheme + "://" + db_url.netloc + db_url.path -engine = create_engine(db_url) -# SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine) +engine = create_engine(db_url, + pool_size=20, # Maximum number of database connections in the pool + max_overflow=50, # Maximum number of connections that can be created beyond the pool_size + pool_timeout=30, # Timeout value in seconds for acquiring a connection from the pool + pool_recycle=1800, # Recycle connections after this number of seconds (optional) + pool_pre_ping=False, # Enable connection health checks (optional) + ) # app.add_middleware(DBSessionMiddleware, db_url=f'postgresql://{db_username}:{db_password}@localhost/{db_name}') app.add_middleware(DBSessionMiddleware, db_url=db_url) diff --git a/superagi/controllers/agent_execution.py b/superagi/controllers/agent_execution.py index 955d864a7..9658712ec 100644 --- a/superagi/controllers/agent_execution.py +++ b/superagi/controllers/agent_execution.py @@ -129,21 +129,21 @@ def create_agent_execution(agent_execution: AgentExecutionIn, organisation = agent.get_agent_organisation(db.session) agent_execution_knowledge = AgentConfiguration.get_agent_config_by_key_and_agent_id(session= db.session, key= 'knowledge', agent_id= agent_execution.agent_id) - - EventHandler(session=db.session).create_event('run_created', + + EventHandler(session=db.session).create_event('run_created', {'agent_execution_id': db_agent_execution.id, 'agent_execution_name':db_agent_execution.name}, - agent_execution.agent_id, + agent_execution.agent_id, organisation.id if organisation else 0) if agent_execution_knowledge and agent_execution_knowledge.value != 'None': knowledge_name = Knowledges.get_knowledge_from_id(db.session, int(agent_execution_knowledge.value)).name if knowledge_name is not None: - EventHandler(session=db.session).create_event('knowledge_picked', - {'knowledge_name': knowledge_name, + EventHandler(session=db.session).create_event('knowledge_picked', + {'knowledge_name': knowledge_name, 'agent_execution_id': db_agent_execution.id}, - agent_execution.agent_id, + agent_execution.agent_id, organisation.id if organisation else 0) - + Models.api_key_from_configurations(session=db.session, organisation_id=organisation.id) if db_agent_execution.status == "RUNNING": execute_agent.delay(db_agent_execution.id, datetime.now()) @@ -205,7 +205,7 @@ def create_agent_run(agent_execution: AgentRunIn, Authorize: AuthJWT = Depends(c #update status from CREATED to RUNNING db_agent_execution.status = "RUNNING" db.session.commit() - + AgentExecutionConfiguration.add_or_update_agent_execution_config(session = db.session, execution = db_agent_execution, agent_execution_configs = agent_execution_configs) @@ -213,16 +213,16 @@ def create_agent_run(agent_execution: AgentRunIn, Authorize: AuthJWT = Depends(c EventHandler(session=db.session).create_event('run_created', {'agent_execution_id': db_agent_execution.id, 'agent_execution_name':db_agent_execution.name}, - agent_execution.agent_id, + agent_execution.agent_id, organisation.id if organisation else 0) agent_execution_knowledge = AgentConfiguration.get_agent_config_by_key_and_agent_id(session= db.session, key= 'knowledge', agent_id= agent_execution.agent_id) if agent_execution_knowledge and agent_execution_knowledge.value != 'None': knowledge_name = Knowledges.get_knowledge_from_id(db.session, int(agent_execution_knowledge.value)).name if knowledge_name is not None: - EventHandler(session=db.session).create_event('knowledge_picked', - {'knowledge_name': knowledge_name, + EventHandler(session=db.session).create_event('knowledge_picked', + {'knowledge_name': knowledge_name, 'agent_execution_id': db_agent_execution.id}, - agent_execution.agent_id, + agent_execution.agent_id, organisation.id if organisation else 0) if db_agent_execution.status == "RUNNING": diff --git a/superagi/controllers/models_controller.py b/superagi/controllers/models_controller.py index f4f018e9a..abb771060 100644 --- a/superagi/controllers/models_controller.py +++ b/superagi/controllers/models_controller.py @@ -4,6 +4,7 @@ from superagi.apm.call_log_helper import CallLogHelper from superagi.models.models import Models from superagi.models.models_config import ModelsConfig +from superagi.config.config import get_config from fastapi_sqlalchemy import db import logging from pydantic import BaseModel @@ -121,7 +122,9 @@ def get_knowledge_list(page: int = 0, organisation=Depends(get_user_organisation @router.get("/marketplace/list/{page}", status_code=200) def get_marketplace_knowledge_list(page: int = 0): - organisation_id = 2 + organisation_id = get_config("MARKETPLACE_ORGANISATION_ID") + if organisation_id is not None: + organisation_id = int(organisation_id) page_size = 16 query = db.session.query(Models).filter(Models.org_id == organisation_id) diff --git a/superagi/jobs/scheduling_executor.py b/superagi/jobs/scheduling_executor.py index 9d61c657c..f0d5a542a 100644 --- a/superagi/jobs/scheduling_executor.py +++ b/superagi/jobs/scheduling_executor.py @@ -1,7 +1,9 @@ +import ast from datetime import datetime from fastapi import HTTPException from sqlalchemy.orm import sessionmaker +from superagi.models.tool import Tool from superagi.models.workflows.iteration_workflow import IterationWorkflow from superagi.worker import execute_agent @@ -60,8 +62,8 @@ def execute_scheduled_agent(self, agent_id: int, name: str): session.add(agent_execution_config) organisation = agent.get_agent_organisation(session) model = session.query(AgentConfiguration.value).filter(AgentConfiguration.agent_id == agent_id).filter(AgentConfiguration.key == 'model').first()[0] - - EventHandler(session=session).create_event('run_created', + + EventHandler(session=session).create_event('run_created', {'agent_execution_id': db_agent_execution.id, 'agent_execution_name':db_agent_execution.name}, agent_id, @@ -70,10 +72,10 @@ def execute_scheduled_agent(self, agent_id: int, name: str): if agent_execution_knowledge and agent_execution_knowledge.value != 'None': knowledge_name = Knowledges.get_knowledge_from_id(session, int(agent_execution_knowledge.value)).name if knowledge_name is not None: - EventHandler(session=session).create_event('knowledge_picked', - {'knowledge_name': knowledge_name, + EventHandler(session=session).create_event('knowledge_picked', + {'knowledge_name': knowledge_name, 'agent_execution_id': db_agent_execution.id}, - agent_id, + agent_id, organisation.id if organisation else 0) session.commit() diff --git a/superagi/models/models.py b/superagi/models/models.py index 5de459d3f..815697298 100644 --- a/superagi/models/models.py +++ b/superagi/models/models.py @@ -6,8 +6,10 @@ from superagi.helper.encyption_helper import decrypt_data import requests, logging -# marketplace_url = "https://app.superagi.com/api" -marketplace_url = "http://localhost:8001" +marketplace_url = "https://app.superagi.com/api" +# marketplace_url = "http://localhost:8001" + + class Models(DBBaseModel): """ Represents a Model record in the database diff --git a/superagi/tools/tool_response_query_manager.py b/superagi/tools/tool_response_query_manager.py index d2caf5e23..2429945b1 100644 --- a/superagi/tools/tool_response_query_manager.py +++ b/superagi/tools/tool_response_query_manager.py @@ -11,8 +11,10 @@ def __init__(self, session: Session, agent_execution_id: int,memory:VectorStore) def get_last_response(self, tool_name: str = None): return AgentExecutionFeed.get_last_tool_response(self.session, self.agent_execution_id, tool_name) - + def get_relevant_response(self, query: str,metadata:dict, top_k: int = 5): + if self.memory is None: + return "" documents = self.memory.get_matching_text(query, metadata=metadata) relevant_responses = "" for document in documents["documents"]: diff --git a/tools.json b/tools.json index 5c1875c8f..94de16ccc 100644 --- a/tools.json +++ b/tools.json @@ -1,8 +1,4 @@ { - "tools": { - "DuckDuckGo": "https://github.com/TransformerOptimus/SuperAGI-Tools/tree/main/DuckDuckGo", - "notion": "https://github.com/TransformerOptimus/SuperAGI-Tools/tree/main/notion", - "duck_duck_go": "https://github.com/TransformerOptimus/SuperAGI-Tools/tree/main/duck_duck_go", - "google_analytics": "https://github.com/TransformerOptimus/SuperAGI-Tools/tree/main/google_analytics" - } + "tools": { + } } \ No newline at end of file