Commit Graph

5351 Commits (d5ab83aa34cdcb970c5b25b38681ef1783f68f17)

Author SHA1 Message Date
Bently d5ab83aa34
Updating api calls in AutoGPT builder (#7275)
* update api endpoints

* get multi-node working + fix node output

* updated multi-node running + re-add "wire" on rebuild

* Fix node data mapping

* removed getStatusValue
2024-06-28 10:39:26 +01:00
Reinier van der Leer cbae8b5c14
chore(agent, forge, benchmark): Clean up dependencies (#7286)
* Remove unused dependencies
* Move dependencies for moved code from `autogpt` to `forge`
* Loosen dependency for `uvicorn` to improve compatibility
2024-06-28 02:21:36 +02:00
Aarushi 854080f7af
ci(builder): Add CI for AutoGPT Builder (#7267)
Add a simple Node/NPM linting workflow for `rnd/autogpt_builder/`

---------

Co-authored-by: Reinier van der Leer <pwuts@agpt.co>
2024-06-28 01:30:34 +02:00
Reinier van der Leer fbb3891e79 chore(forge, agent, benchmark): Update `pytest-asyncio` to v0.23.x
Resolves #7283
2024-06-27 14:09:36 -06:00
Reinier van der Leer 4d8ee65ca7 fix(pre-commit): Add `benchmark/poetry.lock` to "Typecheck - Benchmark" trigger file pattern 2024-06-27 14:05:12 -06:00
Aarushi 6093acc813
Add more functionality to Nodes (#7278)
updating node behaviour
2024-06-27 17:03:10 +01:00
Nicholas Tindle 785a40ff9d
feat(server, autogpt): Add Example files and update build option (#7271) 2024-06-27 09:56:21 -05:00
Zamil Majdy 2bc22c5450
feat(rnd): Add support for dynamic input as list for AgentServer Block (#7268)
On AgentServer, To create a Block like StringFormatterBlock or LllmCallBlock, we need some way to dynamically link input pins and aggregate them into a single list input. This will give a better experience for the user to construct an input and link it from the output of the other nodes. The scope of this change is adding support for that in the least intrusive way.

Proposal
To differentiate the input list name and its singular entry we are using the $_<index> prefix. For example:
For the input items: list[int], you can set a pin items with values like [1,2,3,4]. But you can also add input pins like items_$_0 or items_$_4 with values 1 or 2, which will be appended to the items input in alphabetical order.
The execution engine will guarantee to wait for the execution until all the input pin value is produced, so input pin with list input will produce fix-sized list.
2024-06-27 21:51:34 +07:00
Aarushi cdc658695f
Add reactflow component in AutoGPT builder (#7270)
* Getting started with nextjs

* fix linting

* remove gitignore for package.json

* pulling in reactflow components

* updating css

* use environment variables

* clean up css / ui a lil

* Fixed nodes/run button animation

so they are always visible

---------

Co-authored-by: Bentlybro <tomnoon9@gmail.com>
2024-06-27 10:14:25 +01:00
Aarushi dd960f9306
Add support for nextjs based app (#7266)
* Getting started with nextjs

* fix linting

* remove gitignore for package.json
2024-06-27 10:02:54 +01:00
Krzysztof Czerwinski 6e1c9d44a4 Update Agent Server `README.md` 2024-06-26 19:41:12 +02:00
Zamil Majdy 26bcb26bb7
feat(rnd): Refactor AgentServer Node Input/Output Relation & Block output interface (#7231)
### Background

The current implementation of AgentServer doesn't allow for a single pin to be connected to multiple nodes, this will be problematic when you have a single output node that needs to be propagated into many nodes. Or multiple nodes that possibly feed the data into a single pin (first come first serve).

This infra change is also part of the preparation for changing the `block` interface to return a stream of output instead of a single output.  Treating blocks as streams requires this capability.

### Changes 🏗️

* Update block run interface from returning `(output_name, output_data)` to `Generator[(output_name, output_data)]`
* Removed `agent` term in the API, replace it with `graph` for consistency.
* Reintroduced `AgentNodeExecutionInputOutput`. `AgentNodeExecution` input & output will be a list of `AgentNodeExecutionInputOutput` which describes the input & output data of its execution. Making an execution has 1-many relation to its input output data.
* Propagating the relation and block interface change into the execution engine.
2024-06-26 12:41:55 +02:00
Nicholas Tindle f04ddceacf
docs(forge): Update and rename QUICKSTART.md to FORGE-QUICKSTART.md (#7215) 2024-06-25 19:03:05 -05:00
Bently 3e01b19d6f
chore(forge): Update `duckduckgo-search` to v6.1.7 (#7254)
This should (for now) mitigate the RateLimitErrors that people have been experiencing.
---------

Co-authored-by: Reinier van der Leer <pwuts@agpt.co>
2024-06-25 03:24:10 +02:00
Zamil Majdy 9f1e521857
feat(rnd): Add AutoGPT server scheduling service (#7226)
### Background

Agent execution should be able to be triggered in a recurring manner.
This PR introduced an ExecutionScheduling service, a process responsible for managing the execution schedule and triggering its execution based on a predefined cron expression.

### Changes 🏗️

* Added `scheduler.py` / `ExecutionScheduler` implementation.
* Added scheduler test.
* Added `AgentExecutionSchedule` table and its logical model & prisma queries.
* Moved `add_execution` from API server to `execution_manager`
2024-06-24 09:41:02 +07:00
Zamil Majdy d9226888b2
feat(rnd): Add node metadata on Agent Server Node object (#7237) 2024-06-21 17:50:50 +01:00
Zamil Majdy 210d7738b9
feat(rnd): Add IPC support on autogpt_server (#7212)
### Background

This PR adds support on IPC on autogpt_server.
To make this happen, there are a couple of refactoring efforts being made (will be described in the `Changes` section).
Currently, there are three independent processes:

```
AgentServer ----> ExecutionManager
    | 
     --> ExecutionScheduler
```


### Changes 🏗️

* Added Pyro5 for IPC support.
* Introduced `AppService`: a class to construct an independent process that can expose a method to other running processes (this is analogous to a microservice).
* Introduced `AppProcess`: used by `AppService` a class for creating a child process that can be executed in the background.
* Adapting existing codebase to user `AppService`.
2024-06-19 22:49:47 +07:00
Krzysztof Czerwinski c19ab2b24f
feat(forge): Component-specific configuration (#7170)
Remove many env vars and use component-level configuration that could be loaded from file instead.

### Changed

- `BaseAgent` provides `serialize_configs` and `deserialize_configs` that can save and load all component configuration as json `str`. Deserialized components/values overwrite existing values, so not all values need to be present in the serialized config.
- Decoupled `forge/content_processing/text.py` from `Config`
- Kept `execute_local_commands` in `Config` because it's needed to know if OS info should be included in the prompt
- Updated docs to reflect changes
- Renamed `Config` to `AppConfig`

### Added

- Added `ConfigurableComponent` class for components and following configs:
  - `ActionHistoryConfiguration`
  - `CodeExecutorConfiguration`
  - `FileManagerConfiguration` - now file manager allows to have multiple agents using the same workspace
  - `GitOperationsConfiguration`
  - `ImageGeneratorConfiguration`
  - `WebSearchConfiguration`
  - `WebSeleniumConfiguration`
- `BaseConfig` in `forge` and moved `Config` (now inherits from `BaseConfig`) back to `autogpt`
- Required `config_class` attribute for the `ConfigurableComponent` class that should be set to configuration class for a component
`--component-config-file` CLI option and `COMPONENT_CONFIG_FILE` env var and field in `Config`. This option allows to load configuration from a specific file, CLI option takes precedence over env var.
- Added comments to config models

### Removed

- Unused `change_agent_id` method from `FileManagerComponent`
- Unused `allow_downloads` from `Config` and CLI options (it should be in web component config if needed)
- CLI option `--browser-name` (the option is inside `WebSeleniumConfiguration`)
- Unused `workspace_directory` from CLI options
- No longer needed variables from `Config` and docs
- Unused fields from `Config`: `image_size`, `audio_to_text_provider`, `huggingface_audio_to_text_model`
- Removed `files` and `workspace` class attributes from `FileManagerComponent`
2024-06-19 09:14:01 +01:00
Reinier van der Leer 02dc198a9f
fix(agent): Fix resumption from mid-cycle state in CLI mode (#7224)
When an agent is resumed from a mid-cycle state (having made a proposal but not executed it yet), we need to use the previously determined `current_episode.action` proposal instead of calling `agent.propose_action()` again.
2024-06-18 19:30:24 +02:00
Reinier van der Leer 227cf41612
fix(agent, forge): Make LLM API key check provider-agnostic (#7220)
* Rename `assert_config_has_openai_api_key` to `assert_config_has_required_llm_api_keys`
* Make OpenAI credential check conditional (only if an OpenAI model is selected in the config)
* Implement checks for Groq and Anthropic credentials
* Use API calls for Groq and OpenAI credential checks to make sure the keys are valid
2024-06-14 20:56:03 +02:00
Reinier van der Leer 66f373fb57 docs: Update CONTRIBUTING.md
- Add reference to Code Guidelines
- Reorder list of directives to more logical order
2024-06-14 07:45:14 -07:00
Nicholas Tindle 8f3ed733b9
chore(rnd): Fix warning during server tests (#7213) 2024-06-14 06:56:53 -05:00
Krzysztof Czerwinski 9f71cd2437
feat(forge): Unbreak `forge` agent (#7196)
Revert some changes to fix forge agent and enable components support.
- Rename forge `Agent` to `ProtocolAgent`
- Bring back and update `forge/app.py` and `forge/agent/forge_agent.py`
- `ForgeAgent` inherits from `BaseAgent`, supports component execution and runs the same pipelines as autogpt Agent
- Update forge version from 0.1.0 to 0.2.0
- Update code comments
2024-06-12 13:45:00 +01:00
Nicholas Tindle 6ec708c771
ci(server): Agent Server CI (#7193) 2024-06-12 00:29:23 +07:00
Zamil Majdy af3febd79f
feat(rnd): Add missing code on execution logic for AutoGPT Server (#7209)
Add missing changes from previous commit
2024-06-11 16:15:52 +02:00
SwiftyOS 60e0d4c530 fix(rnd): fixed cli repeated star cmd quality of life 2024-06-11 13:10:53 +02:00
SwiftyOS 4aeae53a61 fixed typo 2024-06-11 12:29:13 +02:00
SwiftyOS d5c4eca739 Check if pid exists 2024-06-11 12:27:19 +02:00
SwiftyOS 1e4ef7b313 chore(benchmark): delete notebooks 2024-06-11 11:30:46 +02:00
Swifty fd18877dae
feat(rnd): CLI to Run and Stop the Server (#7195) 2024-06-11 11:21:34 +02:00
Nicholas Tindle c754ecd5d1
fix(docs): bad link from Options to built in components config (#7207) 2024-06-10 17:57:29 +01:00
Zamil Majdy e688cc31f0
feat(rnd): Implement agent block execution logic for AutoGPT Server (#7194)
### Background

This PR implements the main logic of the block execution engine for AutoGPT-Server.
An integration test is added to test the behavior.

*What you can do now with this PR*:
You can manually create a graph, by using the existing blocks as nodes (or write your own). Then execute the graph with an input.

*What you can't do yet*:
Listen to the graph execution result/update (you can follow the `AgentNodeExecution` table result, though).

### Changes 🏗️
* Split `data.py` (model file) into three modules:
    * `execution`: a model for node execution.
    * `graph`: a model for graph structure.
    * `block`: a model for agent block/component.
* Implemented executor main logic
* Simplify db structure:
    * Remove `AgentBlockInputOutput` in favor of `inputSchema` & `outputSchema` using serialized json/dict structure.
    * Remove `id` on `AgentBlock` in favor of using name (class name of the block) as its identifier.
    * Added `constantInput` column for `AgentNode` for hard-coded input/block configuration. Hence, removing`executionStateData` on `AgentNodeExecution`.
    * Rename AgentNodeLink input/output to source/sink to avoid confusion
* Change multithreading to multiprocessing, to allow the use of multiple `prisma` asynchronous client.
2024-06-10 19:30:34 +07:00
Nicholas Tindle b803e42189
feat(docs): add example uses and description of autogpt to the readme (#7205) 2024-06-10 13:08:55 +01:00
Reinier van der Leer 04769c54e4 docs: Update CONTRIBUTING.md
- Add links to roadmap
- Disable links to kanban board (which currently is not in active use)
- Clarify instruction to not submit broken code
2024-06-09 23:43:25 +02:00
Reinier van der Leer 8f18aebf90 Update wiki links to new location (Nexus/wiki -> AutoGPT/wiki) 2024-06-09 23:13:25 +02:00
github-actions[bot] 8e5535157f
feat(frontend): Update frontend build in `master` (#7203)
Update frontend build based on commit 8f43a346e9

Co-authored-by: Pwuts <12185583+Pwuts@users.noreply.github.com>
2024-06-08 18:55:01 -05:00
Reinier van der Leer 8f43a346e9
fix(frontend): Sync request models up with `forge.agent_protocol` (#7202)
Frontend broke in #7171 because of changes to the request models in `forge.agent_protocol`. This PR unbreaks it.

Changes:
- Make `input` required on `TaskRequestBody` and `StepRequestBody`
- Amend `toJson()` on `TaskRequestBody` and `StepRequestBody` to omit attributes with `null` value
2024-06-08 17:09:01 -05:00
Reinier van der Leer f2cb553c9a chore(agent, forge, benchmark): Update `pyright` to v1.1.366 2024-06-08 21:48:25 +02:00
Reinier van der Leer 4c17277539 chore(agent, forge): Update `duckduckgo-search` to v5.3.1 2024-06-08 21:44:39 +02:00
Krzysztof Czerwinski 2cd914d366
chore(agent): Remove `LogCycleHandler` (#7192)
- Remove no longer needed LogCycleHandler class and its usage in Agent
2024-06-06 11:47:30 +01:00
Swifty 39084192ff
fix(agent server): Update file layout for autogpt server (#7190) 2024-06-05 12:53:54 +02:00
Nicholas Tindle 23dfdad454
feat(autogpt,autogpt_server): Build AutoGPT's Constituent Parts for deployment (#7188) 2024-06-05 12:14:08 +07:00
Zamil Majdy 4de0fd8cbd
feat(db): Initialize Database Schema for AutoGPT server (#7168)
### Background

Introduced initial database schema for AutoGPT server.
It currently consists of 7 tables:

* `AgentGraph`: This model describes the Agent Graph/Flow (Multi Agent System).
    * `AgentNode`: This model describes a single node in the Agent Graph/Flow (Multi Agent System).
        * `AgentNodeLink`: This model describes the link between two AgentNodes.
        * `AgentNodeExecution`: This model describes the execution of an AgentNode.
* `AgentBlock`: This model describes a component that will be executed by the AgentNode (all the details required, like name, code, input/output).
    * `AgentBlockInputOutput`: This model describes the output (produced event) or input (consumed event) of an AgentBlock.
* `FileDefinition`: This model describe a file that can be used as input/output of an AgentNodeExecution.

### Changes 🏗️

* Add Prisma
* Add sqlite3
* Initialize database.
2024-06-05 12:09:58 +07:00
Swifty e3a5663a05
fix(agent server): Updated function names and type checking (#7185)
* fix agent server

* renamed functions

* simplified dir naming
2024-06-04 11:02:38 +02:00
SwiftyOS 246bc850a1 deleted nextgenautogpt 2024-06-04 09:56:42 +02:00
Reinier van der Leer 319232568a
fix+docs(agent): Update LLM access instructions & remove GPT-specific flags (#7183)
* Update instructions to set up OpenAI / GPT-4 access
* Add instructions to set up Anthropic access
* Add instructions to set up Groq access
* Remove GPT-specific `--gpt3only`, `--gpt4only` CLI flags and related logic
* Remove duplicate config instructions from docker setup page, replace it by a link to the standard setup instructions
2024-06-03 08:51:46 -05:00
SwiftyOS f71d97dd48 restored nextgenautogpt 2024-06-03 11:42:18 +02:00
Zamil Majdy 7a932cdf00
feat(rnd): add FastAPI support to existing project outline (#7165)
### Background

###### Project Outline
Currently, the project mainly consists of these components:

*agent_api*
A component that will expose API endpoints for the creation & execution of agents.
This component will make connections to the database to persist and read the agents.
It will also trigger the agent execution by pushing its execution request to the ExecutionQueue.

*agent_executor*
A component that will execute the agents.
This component will be a pool of processes/threads that will consume the ExecutionQueue and execute the agent accordingly. 
The result and progress of its execution will be persisted in the database.

###### How to test
Execute `poetry run app`. 
Access the swagger page `http://localhost:8000/docs`, there is one API to trigger an execution of one dummy slow task, you fire the API a couple of times and see the `agent_executor` executes the multiple slow tasks concurrently by the pool of Python processes.
The pool size is currently set to `5` (hardcoded in app.py, the code entry point).

##### Changes 🏗️

* Initialize FastAPI for the AutoGPT server project.
* Reduced number of queues to 1 and abstracted into `ExecutionQueue` class.
* Reduced the number of main components into two `api` and `executor`.
2024-06-02 23:39:01 -05:00
Reinier van der Leer 4e76768bc9
refactor(forge/llm): Create `BaseOpenAIProvider` -> deduplicate `GroqProvider` & `OpenAIProvider` implementation (#7178)
- Add `_BaseOpenAIProvider`, `BaseOpenAIChatProvider`, and `BaseOpenAIEmbeddingProvider`, which implement the shared functionality of OpenAI-like providers, e.g. `GroqProvider` and `OpenAIProvider`
- (Re)move as much code as possible from `GroqProvider` and `OpenAIProvider` by rebasing them on `BaseOpenAI(Chat|Embedding)Provider`

Also:
- Rename `get_available_models()` to `get_available_chat_models()` on `BaseChatModelProvider`
- Add `get_available_models()` to `BaseModelProvider`
- Add `get_available_embedding_models()` to `BaseEmbeddingModelProvider`
- Move common `fix_failed_parse_tries` config attribute into base `ModelProviderConfiguration`
2024-06-03 01:29:24 +02:00
RainRat cb9ad6f64d
fix typos (#7123)
* fix typos in various places

* Revert changes to NOTICES

---------

Co-authored-by: Nicholas Tindle <nicholas.tindle@agpt.co>
2024-05-31 11:16:23 +02:00