Skip to content

Commit

Permalink
Integrate custom agent skill and embedding into quick start
Browse files Browse the repository at this point in the history
  • Loading branch information
wwwwww1020 committed Sep 2, 2023
1 parent d55df38 commit cacc6b7
Show file tree
Hide file tree
Showing 23 changed files with 419 additions and 175 deletions.
26 changes: 18 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
[![Twitter Follow](https://img.shields.io/twitter/follow/SolidGPT?style=social)](https://twitter.com/SolidGPT)
# 🚀 What’s this

SolidGPT is a human-AI collaboration platform. Users can add private data and tailor agent workflows using techniques like embedding finetuning. Our goal: empower AI to work with humans using tools to accomplish business tasks.
SolidGPT is a human-AI collaboration framework. Users can add private data and create their own agent workgraph using embedding finetuning and in-context learning simply with our framework. Our goal: empower AI to work with humans using tools to accomplish business tasks.

Currently, agents are optimized for software development using tools like Notion, Lowdefy, and more. From the inception of an idea to the documentation of software development, task division, and eventual task implementation - everything can either be automatically or semi-automatically accomplished within SolidGPT.
Currently, our framework are optimized for software development using tools Notion, Lowdefy. From the inception of an idea to the documentation of software development, task division, and eventual task implementation - everything can either be automatically or semi-automatically accomplished within SolidGPT.

# 🏁 Quick Start

Expand All @@ -29,23 +29,33 @@ Currently, agents are optimized for software development using tools like Notion

## **Run Demo**

```python
cd demo
python3 quickstart.py
Run a acutal real start up project "AI Says" - stock analysis app dev workflow, include the brainstorming, write product requirement, write high level design, create kanban.
```sh
cd quickstart
python3 creategraph.py
python3 quickstart.py system
```

Run a webapp dev workflow, include the brainstorming, write product requirement, write high level design, create kanban, generate app code, run web app.
```sh
cd quickstart
python3 creategraph.py
python3 quickstart.py webapp
```

### **Start Your Own Graph**
## **Start Your Own Graph**
0. (Optional) Customize your own agent and skill [(learn more)](https://github.com/AI-Citizen/SolidGPT/blob/main/docs/customagentskill.md)
1. Create a graph using Solid Portal or a JSON file. [(learn more)](https://github.com/AI-Citizen/SolidGPT/blob/main/docs/solidporta.md)
1. Create a graph using Solid Portal. [(learn more)](https://github.com/AI-Citizen/SolidGPT/blob/main/docs/solidporta.md). You can also create a graph json file by code. Please check `quickstart/creategraph.py`
2. Create an entry point located in the solidgpt folder and input the workgraph json file path
```python
# your_file_name.py
from solidgpt.src.orchestration.orchestration import *
Initializer()
app = Orchestration()
app.add_graph("workspace/config/config_data.json", "default graph")
app.add_graph("your/graph/config_file.json", "default graph")
app.run_graph_with_name("default graph")
```
You can check the `quickstart/quickstart.py` as example.
3. Run the code with python3 your_file_name.py


Expand Down
112 changes: 0 additions & 112 deletions demo/creategraph.py

This file was deleted.

6 changes: 0 additions & 6 deletions demo/quickstart.py

This file was deleted.

28 changes: 14 additions & 14 deletions docs/customagentskill.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,32 @@ You can customize agent skills in two ways:
1. Create a agent skill JSON file
```JSON
{
"skill_name": "Internal Engineer tools expert ",
"basic_description": "Response the engineers' questions base on the knowledege I provide to you",
"instruction": "First step you need to check all of the readme resources and internal wiki and then..",
"qa_example": "Q: How to setup the SolidGPT project?\nA: You need to install the python3 and docker.....",
"principles": "Alwayls follow the content which I provide to you; If you are not sure answer no; Give the code example if question related to the code",
"embedding_background_data_list": "ReadmeEmbedding,WikiEmbedding",
"model_name": "gpt-3.5-turbo-16k",
"skill_name": "WrteSystemDesign",
"basic_description": "Write System High-Level Dev Design",
"instruction": "Here is the output document strucuture\n1. Introduction\nScope:\nGoals:\n2. Components\n3. Service Workflow\n4. APIs in Detail\n5. Database Table Schema\n... [List other tables in the same fashion]\n5. Dataflow and Architecture\n```mermaid\n```",
"qa_example": "",
"principles": "List specific API desgin, List specific Database table design, Ouput in Markdown, Use Mermaid for Diagrams",
"embedding_background_data_list": "",
"model_name": "gpt-4",
"input_method": "SkillIOParamCategory.PlainText",
"output_method": "SkillIOParamCategory.PlainText"
}
}
```

- **skill_name:** Input what agent skill you want to build
- **basic_description:** Briefly describe the nature of the task (recommended under 100 words)
- **instruction: **Furnish a comprehensive set of instructions for performing the task.
- **instruction:**Furnish a comprehensive set of instructions for performing the task.
- **(Optional)qa_example:** Present an illustrative example of input and corresponding output for this Skill.
- **principles:** Offer some guiding principles for undertaking the task
- **(Optional)embedding_background_data_list: **Proivde your embedding resource folder here. If you have multiple resource folders, list their paths here separated by commas.
- **(Optional)model_name: **Specify the OpenAI model to be used; you can input your fine-tuned model here.
- **input_method/output_method: **Currently, only plain text input and output are supported; no need to modify
- **(Optional)principles:** Offer some guiding principles for undertaking the task
- **(Optional)embedding_background_data_list:**Proivde your embedding resource folder here. If you have multiple resource folders, list their paths here separated by commas. [Learn more about embedding private data](https://github.com/AI-Citizen/SolidGPT/blob/main/docs/embeddingprivatedata.md)
- **(Optional)model_name:**Specify the OpenAI model to be used; you can input your fine-tuned model here.
- **input_method/output_method:**Currently, only plain text input and output are supported; no need to modify
}

2. Save the Agent Skill JSON file as .json
3. Locate Agent Skill JSON file into the Project_ROOT/localstorage/customizedskilldefinition

## Auto generate
## Auto Generate(Beta)
```python
from solidgpt.src.diy.custom.customskillgenerator import CustomSkillGenerator
from solidgpt.src.manager.initializer import Initializer
Expand Down
47 changes: 47 additions & 0 deletions docs/embeddingprivatedata.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Embedding Your Private Data(Beta)
SolidGPT can help you embedding your resource data eigher in runtime or in pre-runtime.

## Start
> Embedding in runtime can skip the first step.
1. Embedding
```sh
cd quickstart
python3 embedding_data.py data_label your_resource_data_file_path
```
You can also move all your resource data files to `localstorage/embedding/originalresources` folder and run `python3 embedding_data.py data_label` to embed all the resource data files in the folder.
There will generate two kinds of data, embedding resource data and divided resource data in the `localstorage/embedding/embeddedresources`, `localstorage/embedding/dividedresources` folder.

> Embedding in runtime can start from here
1. Add the data label to the custom agent skill
```JSON
{
"skill_name": "EmbeddingDataExampleSkill",
"basic_description": "Write System High-Level Dev Design",
"instruction": "Here is the output document strucuture\n1. Introduction\nScope:\nGoals:\n2. Components\n3. Service Workflow\n4. APIs in Detail\n5. Database Table Schema\n... [List other tables in the same fashion]\n5. Dataflow and Architecture\n```mermaid\n```",
"qa_example": "",
"principles": "List specific API desgin, List specific Database table design, Ouput in Markdown, Use Mermaid for Diagrams",
"embedding_background_data_list": "data_label", // Add the embedding data label here
"model_name": "gpt-4",
"input_method": "SkillIOParamCategory.PlainText",
"output_method": "SkillIOParamCategory.PlainText"
}
```
1. Add the EmbeddingDataExampleSkill into the graph by SolidPortal, code, manually edit workgraph JSON file. [Learn more about buiding workgraph](https://github.com/AI-Citizen/SolidGPT/blob/main/Readme.md#start-your-own-graph)
1. Run the graph with the custom agent skill which includes the embedding data
```python
# your_file_name.py
from solidgpt.src.orchestration.orchestration import *
Initializer()
# Register your embedding data in to the runtime embedding manager
embedding_manager.add_embed_model("<your_data_label>", EmbeddingModelParameter(
resource_name= "<your_data_label>",
original_resources_folder_path= "<your_private_data_resource_path>",
divided_resources_folder_path= "<your_divided_resource_folder_path>", # generated in step 1, default is PROJECT_ROOT/localstorage/embedding/dividedresources
embedded_resources_folder_path= "<your_embedded_resource_folder_path>", # generated in step 1, defau1t is PROJECT_ROOT/localstorage/embedding/embeddedresources
has_embedded=True
))

app = Orchestration()
app.add_graph("your/graph/config_file.json", "default graph") # You can add the EmbeddingDataExampleSkill into the work graph
app.run_graph_with_name("default graph")
```
6 changes: 3 additions & 3 deletions localstorage/customizedskilldefinition/WriteSystemDesign.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"skill_name": "WrteSystemDesign",
"basic_description": "Write System High-Level Dev Design",
"instruction": "Assume you are the Principal Engineer. Based on the PRD, you first need to design a high-level architecture and service workflow and provide me mermaid code to them . Please help me draft a High-Level Design. You should highlight all the APIs in detail and assist in designing the database table schema.",
"instruction": "Here is the output document strucuture\n1. Introduction\nScope:\nGoals:\n2. Components\n3. Service Workflow\n4. APIs in Detail\n5. Database Table Schema\n... [List other tables in the same fashion]\n5. Dataflow and Architecture\n```mermaid\n```",
"qa_example": "",
"principles": "Cloud-First Approach(Azure),Simplicity and MVP (Minimum Viable Product)",
"principles": "List specific API desgin, List specific Database table design, Ouput in Markdown, Use Mermaid for Diagrams",
"embedding_background_data_list": "",
"model_name": "gpt-4",
"input_method": "SkillIOParamCategory.PlainText",
"output_method": "SkillIOParamCategory.PlainText"
}
}
56 changes: 56 additions & 0 deletions localstorage/workspace/config/system_config_data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
[
{
"node_id": "0",
"manual_review_result": true,
"agent": "Product Manager",
"skill": "Write Product Requirement Documentation",
"inputs": [
{
"param_path": "/Users/wuqiten/Workplace/solidgpt-workspace/SolidGPT/solidgpt/../localstorage/workspace/in/AIProductBasicInfo.json",
"loading_method": "SkillInputLoadingMethod.LOAD_FROM_STRING",
"load_from_output_id": -1
}
],
"outputs": [
{
"id": 0
}
]
},
{
"node_id": "1",
"manual_review_result": true,
"agent": "Principal Engineer",
"skill": "WrteSystemDesign",
"inputs": [
{
"param_path": "",
"loading_method": "SkillInputLoadingMethod.LOAD_FROM_OUTPUT_ID",
"load_from_output_id": 0
}
],
"outputs": [
{
"id": 1
}
]
},
{
"node_id": "2",
"manual_review_result": true,
"agent": "Principal Engineer",
"skill": "Create Kanban Board",
"inputs": [
{
"param_path": "",
"loading_method": "SkillInputLoadingMethod.LOAD_FROM_OUTPUT_ID",
"load_from_output_id": 1
}
],
"outputs": [
{
"id": 2
}
]
}
]
Loading

0 comments on commit cacc6b7

Please sign in to comment.