Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(rnd): Implement agent block execution logic for AutoGPT Server #7194

Conversation

majdyz
Copy link
Contributor

@majdyz majdyz commented Jun 6, 2024

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, removingexecutionStateData 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.

PR Quality Scorecard ✨

  • Have you used the PR description template?   +2 pts
  • Is your pull request atomic, focusing on a single change?   +5 pts
  • Have you linked the GitHub issue(s) that this PR addresses?   +5 pts
  • Have you documented your changes clearly and comprehensively?   +5 pts
  • Have you changed or added a feature?   -4 pts
    • Have you added/updated corresponding documentation?   +4 pts
    • Have you added/updated corresponding integration tests?   +5 pts
  • Have you changed the behavior of AutoGPT?   -5 pts
    • Have you also run agbenchmark to verify that these changes do not regress performance?   +10 pts

Copy link

netlify bot commented Jun 6, 2024

βœ… Deploy Preview for auto-gpt-docs ready!

Name Link
πŸ”¨ Latest commit b5072ff
πŸ” Latest deploy log https://app.netlify.com/sites/auto-gpt-docs/deploys/6666af921b9c9a0008753424
😎 Deploy Preview https://deploy-preview-7194--auto-gpt-docs.netlify.app
πŸ“± Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@majdyz majdyz requested review from Swiftyos, ntindle and kcze June 6, 2024 10:12
kcze
kcze previously requested changes Jun 6, 2024
Copy link
Contributor

@kcze kcze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Structure looks good! My main concern is typing; we could use schema or at least use something better than dict[str, str] for Block inputs/outputs. I understand that we need to store all that inside the database, but I don't think we should ignore type safety.

rnd/autogpt_server/autogpt_server/data/block.py Outdated Show resolved Hide resolved
rnd/autogpt_server/autogpt_server/data/block.py Outdated Show resolved Hide resolved
rnd/autogpt_server/autogpt_server/data/block.py Outdated Show resolved Hide resolved
rnd/autogpt_server/autogpt_server/data/db.py Show resolved Hide resolved
rnd/autogpt_server/autogpt_server/data/graph.py Outdated Show resolved Hide resolved
@majdyz majdyz requested a review from kcze June 7, 2024 03:56
@majdyz majdyz enabled auto-merge (squash) June 10, 2024 09:34
@majdyz majdyz dismissed kcze’s stale review June 10, 2024 12:30

Change requests have been addressed. Feel-free to add more comment in the PR though if there are more comments, I'll address it in the following PR.

@majdyz majdyz merged commit e688cc3 into master Jun 10, 2024
11 checks passed
@majdyz majdyz deleted the zamilmajdy/agpt-738-implement-the-component-execution-logic-execute-component branch June 10, 2024 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: βœ… Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants