-
Notifications
You must be signed in to change notification settings - Fork 45.1k
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
WIP: Templates & Contexts #2480
WIP: Templates & Contexts #2480
Conversation
This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request. |
…Gravitas#2665) Co-authored-by: qianchengliang <[email protected]>
Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly. |
I understand this is a draft, but can you please state your intentions in the description? |
This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request. |
This is a mass message from the AutoGPT core team. For more details (and for infor on joining our Discord), please refer to: |
…to context & template system
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This PR exceeds the recommended size of 200 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size |
This PR exceeds the recommended size of 200 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size |
Deployment failed with the following error:
|
This PR exceeds the recommended size of 200 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size |
agreed - while this is a massive diff/patch, some of it looks potentially useful and related to ongoing efforts. There's also a custom DSL added, as well as a ton of new commans for "context" management and the LLM is asked to provide "essence" to the agent, and a "big picture". Overall, this looks indeed like a ton of work, and at least 3-4 components of it would seem applicable to the project as a whole - but obviously only if the effort can be re-aligned with other ongoing efforts. Someone that capable of writing a ton of code and touching a ton of files in a project like this without breaking things, should ideally team up with other devs to ensure that those changes can be contributed back in a useful and feasible fashion |
This PR exceeds the recommended size of 200 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size |
I appreciate the engagement, and I especially appreciate the links to those related issues 😸 I never had any intentions of merging this work; ultimately this has been somewhat of a playground to test various ways of building in templates & contexts (and test other things like DSL parsing & prompt changes as you've noted). While this has been generally successful, I'm not sure if I will continue developing this beyond what I just did to push the rest of the WIP code and make it public/update the docs/copy the PR from my fork. I anticipate working this system into something else with LangChain, but for now I've gone through and refined this so it's public and documented in case others take interest/see value in the ideas presented here. |
closing as per comments by author |
Introducing Templates & Contexts: A structured way to keep AutoGPT on track
Preface:
Summary
This PR is huge and introduces a couple primary things to explore constraining how AutoGPT reads & writes files, including enforcement of writing markdown
.md
files using prompting (and by removing code commands) for more consistent output. This makes the next pieces more consistent.Templates,
These are markdown files intended for AutoGPT to reference, write files from, and validate. The SystemGPT can also create new templates and reference them during research.
.md
templates in theauto_gpt_workspace/templates
folder to to loosely guide output from the start.USE_THIS_TEMPLATE_NO_MATTER_WHAT.md
or something similar to guide the AI. It will be using natural language to determine which template to use, so get creative and don't feel constrained on file name length.Contexts
This feature strives to create contextual loops for the System GPT. Currently, "context" means a folder & markdown file that gets passed back through the prompt that tries to act as an overview for a smaller chunk of actions, in pursuit of the larger purpose/goals.
Experimental/Unfinished:
Motivation
As Auto-GPT generates more content, it becomes increasingly important to keep it in a controlled circuit for it to progress and improve. By introducing Contexts, the System GPT is better incentivized to focus and generate output as it goes about it's tasks. Templates also enable structure in output, and allow a way to structure output in real time as a user.
Design
Templates are written in markdown and can be added to and removed from the templates folder at will, in real time, to guide output.
Contexts are organized using Markdown files, which offer a simple yet flexible format for structuring content. Each context is represented by a main Markdown file containing the context name, goal, parameters for success, files, sources, and highlights. Currently, the SystemGPT is forced to write to the context folder but ideally this would be configurable. As a user, you can edit the
context_template.md
file, which gets copied to the project folder and used as a reference for all context created during AutoGPT's activity. The default context template is:Key Components
Example
How a markdown file holding context might be structured:
Future Work
The ultimate goal is to create links in a chain that ultimately reaches the end goal. Markdown seems like a good way of doing this.
Full Prompt
The rule set for this was generated using my AIPRM Research Prompt Generator by typing "the newest (last few weeks) AI tools for photography":
After entering these instructions into this version of AutoGPT: