From b63f955e15b13f8f9679ed236fd6874b92ab9ff9 Mon Sep 17 00:00:00 2001 From: Lingjie Feng Date: Thu, 11 Apr 2024 13:39:55 -0400 Subject: [PATCH] feat: add new knowledge contribution --- CONTRIBUTING_KNOWLEDGE.md | 51 +++++++++++++++++++++++++++++++++++++++ README.md | 2 +- 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 CONTRIBUTING_KNOWLEDGE.md diff --git a/CONTRIBUTING_KNOWLEDGE.md b/CONTRIBUTING_KNOWLEDGE.md new file mode 100644 index 0000000..f7b3e72 --- /dev/null +++ b/CONTRIBUTING_KNOWLEDGE.md @@ -0,0 +1,51 @@ +# Contributing to Prior Knowledge Augmentation + +WebWand's Prior Knowledge Augmentation system is designed to enhance the tool's web navigation and task execution capabilities by leveraging a shared knowledge base. Contributions to this system help make WebWand smarter and more capable. + +## What Kind of Knowledge Are We Looking For? + +We seek knowledge that: +- Enhances the understanding of specific web pages or actions, making task execution more reliable. +- Includes insights into website layouts, common patterns, and user interfaces that are not immediately obvious. +- Provides rules or annotations that help the AI better interpret the purpose of elements on a page. + +For example, if a website has two buttons with the same name but different functionalities, it's crucial to describe in notes how to distinguish between them. + +## How to Add and Test New Knowledge + +We offer two convenient ways to add and test new knowledge in real-time: +- Via Form: Within the WebWand UI settings, navigate to the "Custom Knowledge Base" and select "Add Host Knowledge with Form" to input new knowledge using a user-friendly form. +- Via JSON: If you prefer to work directly with JSON, choose "Add Host Knowledge with JSON" to enter your custom knowledge. + +You can test the new knowledge by running several tasks on the relevant web pages to ensure WebWand behaves as expected. + +Once you've tested various knowledge inputs and are satisfied with the new knowledge's performance, you can then copy that knowledge into the db.json file. + +1. Locate the `db.json` file in the `src/helpers/knowledge` directory of the WebWand repository. +2. Add your knowledge in the JSON format, following the existing structure. `annotationRules` is optional. + ```json + { + "example.com": { + "rules": [ + { + "regexes": ["some-page-regex"], + "knowledge": { + "notes": ["Your insights or notes about this page or action"], + "annotationRules": [ + { + "selector": "CSS selector", + "allowInvisible": true, + "allowCovered": true, + "allowAriaHidden": true + } + ] + } + } + ] + } + } +3. Please ensure your contributions are clear and concise, with regexes and selectors accurately defined. + +## Submitting Your Contribution + +Please check out the [Contribution Guide](CONTRIBUTING.md). Share your testing process and results in your pull request to help reviewers understand the impact of your contribution. Specifically, describe how the new knowledge help WebWand acheive something it previously cannot perform correctly. \ No newline at end of file diff --git a/README.md b/README.md index a4ffb4d..3505676 100755 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ Check out our [Troubleshooting Guide](TROUBLESHOOTING.md) for help with common p Interested in contributing to WebWand? We'd love your help! Check out our [Contribution Guide](CONTRIBUTING.md) for guidelines on how to contribute, report bugs, suggest enhancements, and more. -We encourage everyone in the community to add new knowledge to the "Prior Knowledge Augmentation" system. Check out the default knowledge file ["db.json"](src/helpers/knowledge/db.json). +We also encourage everyone in the community to add new knowledge to the "Prior Knowledge Augmentation" system to make WebWand even smarter. For detailed instructions on what kind of knowledge we're looking for and how to test and submit it, please see our [Contributing Knowledge Guide](CONTRIBUTING-KNOWLEDGE.md). ## Credits